one-design-next 0.0.4-alpha.100

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 (520) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/dist/_util/canUseDom.d.ts +1 -0
  4. package/dist/_util/canUseDom.js +3 -0
  5. package/dist/_util/color.d.ts +103 -0
  6. package/dist/_util/color.js +250 -0
  7. package/dist/_util/date.d.ts +53 -0
  8. package/dist/_util/date.js +657 -0
  9. package/dist/_util/focusManager.d.ts +12 -0
  10. package/dist/_util/focusManager.js +56 -0
  11. package/dist/_util/queueMtPolyfill.d.ts +5 -0
  12. package/dist/_util/queueMtPolyfill.js +19 -0
  13. package/dist/_util/time.d.ts +44 -0
  14. package/dist/_util/time.js +150 -0
  15. package/dist/_util/useActive.d.ts +6 -0
  16. package/dist/_util/useActive.js +25 -0
  17. package/dist/_util/useControlledState.d.ts +8 -0
  18. package/dist/_util/useControlledState.js +30 -0
  19. package/dist/_util/useLayoutEffect.d.ts +4 -0
  20. package/dist/_util/useLayoutEffect.js +30 -0
  21. package/dist/alert/index.d.ts +63 -0
  22. package/dist/alert/index.js +137 -0
  23. package/dist/alert/style/index.css +184 -0
  24. package/dist/alert/style/index.d.ts +2 -0
  25. package/dist/alert/style/index.js +2 -0
  26. package/dist/auto-complete/index.d.ts +64 -0
  27. package/dist/auto-complete/index.js +149 -0
  28. package/dist/avatar/index.d.ts +68 -0
  29. package/dist/avatar/index.js +177 -0
  30. package/dist/avatar/primitive.d.ts +6 -0
  31. package/dist/avatar/primitive.js +23 -0
  32. package/dist/avatar/style/index.css +74 -0
  33. package/dist/avatar/style/index.d.ts +2 -0
  34. package/dist/avatar/style/index.js +2 -0
  35. package/dist/button/index.d.ts +15 -0
  36. package/dist/button/index.js +64 -0
  37. package/dist/button/style/index.css +338 -0
  38. package/dist/button/style/index.d.ts +2 -0
  39. package/dist/button/style/index.js +2 -0
  40. package/dist/calendar/index.d.ts +25 -0
  41. package/dist/calendar/index.js +379 -0
  42. package/dist/calendar/style/index.css +5 -0
  43. package/dist/calendar/style/index.d.ts +2 -0
  44. package/dist/calendar/style/index.js +2 -0
  45. package/dist/card/header.d.ts +26 -0
  46. package/dist/card/header.js +37 -0
  47. package/dist/card/index.d.ts +24 -0
  48. package/dist/card/index.js +31 -0
  49. package/dist/card/style/index.css +141 -0
  50. package/dist/card/style/index.d.ts +1 -0
  51. package/dist/card/style/index.js +1 -0
  52. package/dist/cascader/CascaderOptionContent.d.ts +20 -0
  53. package/dist/cascader/CascaderOptionContent.js +85 -0
  54. package/dist/cascader/Panel.d.ts +53 -0
  55. package/dist/cascader/Panel.js +131 -0
  56. package/dist/cascader/index.d.ts +59 -0
  57. package/dist/cascader/index.js +436 -0
  58. package/dist/cascader/style/index.css +414 -0
  59. package/dist/cascader/style/index.d.ts +2 -0
  60. package/dist/cascader/style/index.js +2 -0
  61. package/dist/cascader/utils.d.ts +14 -0
  62. package/dist/cascader/utils.js +109 -0
  63. package/dist/chart/index.d.ts +14 -0
  64. package/dist/chart/index.js +11 -0
  65. package/dist/chart/style/index.css +1 -0
  66. package/dist/chart/style/index.d.ts +2 -0
  67. package/dist/chart/style/index.js +2 -0
  68. package/dist/checkbox/Checkbox.d.ts +77 -0
  69. package/dist/checkbox/Checkbox.js +178 -0
  70. package/dist/checkbox/Context.d.ts +35 -0
  71. package/dist/checkbox/Context.js +2 -0
  72. package/dist/checkbox/Group.d.ts +68 -0
  73. package/dist/checkbox/Group.js +151 -0
  74. package/dist/checkbox/index.d.ts +5 -0
  75. package/dist/checkbox/index.js +3 -0
  76. package/dist/checkbox/style/index.css +330 -0
  77. package/dist/checkbox/style/index.d.ts +2 -0
  78. package/dist/checkbox/style/index.js +2 -0
  79. package/dist/collapse/index.d.ts +43 -0
  80. package/dist/collapse/index.js +111 -0
  81. package/dist/collapse/primitive.d.ts +21 -0
  82. package/dist/collapse/primitive.js +103 -0
  83. package/dist/collapse/style/index.css +59 -0
  84. package/dist/collapse/style/index.d.ts +2 -0
  85. package/dist/collapse/style/index.js +2 -0
  86. package/dist/color-picker/index.d.ts +55 -0
  87. package/dist/color-picker/index.js +588 -0
  88. package/dist/color-picker/style/index.css +135 -0
  89. package/dist/color-picker/style/index.d.ts +2 -0
  90. package/dist/color-picker/style/index.js +2 -0
  91. package/dist/config-provider/index.d.ts +46 -0
  92. package/dist/config-provider/index.js +37 -0
  93. package/dist/date-picker/MonthPicker.d.ts +31 -0
  94. package/dist/date-picker/MonthPicker.js +161 -0
  95. package/dist/date-picker/QuarterPicker.d.ts +36 -0
  96. package/dist/date-picker/QuarterPicker.js +168 -0
  97. package/dist/date-picker/YearPicker.d.ts +13 -0
  98. package/dist/date-picker/YearPicker.js +84 -0
  99. package/dist/date-picker/index.d.ts +240 -0
  100. package/dist/date-picker/index.js +1249 -0
  101. package/dist/date-picker/style/index.css +511 -0
  102. package/dist/date-picker/style/index.d.ts +2 -0
  103. package/dist/date-picker/style/index.js +2 -0
  104. package/dist/date-range-picker/index.d.ts +58 -0
  105. package/dist/date-range-picker/index.js +1043 -0
  106. package/dist/dialog/index.d.ts +139 -0
  107. package/dist/dialog/index.js +300 -0
  108. package/dist/dialog/style/index.css +228 -0
  109. package/dist/dialog/style/index.d.ts +2 -0
  110. package/dist/dialog/style/index.js +2 -0
  111. package/dist/dialog/useModalPosition.d.ts +6 -0
  112. package/dist/dialog/useModalPosition.js +34 -0
  113. package/dist/drawer/index.d.ts +92 -0
  114. package/dist/drawer/index.js +214 -0
  115. package/dist/drawer/style/index.css +244 -0
  116. package/dist/drawer/style/index.d.ts +2 -0
  117. package/dist/drawer/style/index.js +2 -0
  118. package/dist/dropdown/index.d.ts +91 -0
  119. package/dist/dropdown/index.js +846 -0
  120. package/dist/dropdown/style/index.css +206 -0
  121. package/dist/dropdown/style/index.d.ts +2 -0
  122. package/dist/dropdown/style/index.js +2 -0
  123. package/dist/ellipsis-text/index.d.ts +19 -0
  124. package/dist/ellipsis-text/index.js +97 -0
  125. package/dist/ellipsis-text/style/index.css +1 -0
  126. package/dist/ellipsis-text/style/index.d.ts +2 -0
  127. package/dist/ellipsis-text/style/index.js +2 -0
  128. package/dist/empty/index.d.ts +20 -0
  129. package/dist/empty/index.js +2398 -0
  130. package/dist/empty/style/index.css +80 -0
  131. package/dist/empty/style/index.d.ts +2 -0
  132. package/dist/empty/style/index.js +2 -0
  133. package/dist/form/index.d.ts +106 -0
  134. package/dist/form/index.js +272 -0
  135. package/dist/form/style/index.css +84 -0
  136. package/dist/form/style/index.d.ts +2 -0
  137. package/dist/form/style/index.js +2 -0
  138. package/dist/hover-fill/index.d.ts +50 -0
  139. package/dist/hover-fill/index.js +258 -0
  140. package/dist/hover-fill/style/index.css +35 -0
  141. package/dist/hover-fill/style/index.d.ts +2 -0
  142. package/dist/hover-fill/style/index.js +2 -0
  143. package/dist/icon/index.d.ts +11 -0
  144. package/dist/icon/index.js +102 -0
  145. package/dist/icon/style/index.css +15 -0
  146. package/dist/icon/style/index.d.ts +2 -0
  147. package/dist/icon/style/index.js +2 -0
  148. package/dist/icon/svg/alert/alert-circle-filled.svg +1 -0
  149. package/dist/icon/svg/alert/alert-circle.svg +1 -0
  150. package/dist/icon/svg/alert/help-circle-filled.svg +1 -0
  151. package/dist/icon/svg/alert/help-circle.svg +1 -0
  152. package/dist/icon/svg/alert/info-circle-filled.svg +1 -0
  153. package/dist/icon/svg/alert/info-circle.svg +1 -0
  154. package/dist/icon/svg/alert/stop.svg +1 -0
  155. package/dist/icon/svg/alert/warning-filled.svg +1 -0
  156. package/dist/icon/svg/alert/warning.svg +1 -0
  157. package/dist/icon/svg/content/QRcode.svg +1 -0
  158. package/dist/icon/svg/content/bell-filled.svg +1 -0
  159. package/dist/icon/svg/content/bell.svg +1 -0
  160. package/dist/icon/svg/content/bidding.svg +1 -0
  161. package/dist/icon/svg/content/calendar.svg +1 -0
  162. package/dist/icon/svg/content/code.svg +1 -0
  163. package/dist/icon/svg/content/customColumn.svg +1 -0
  164. package/dist/icon/svg/content/data.svg +1 -0
  165. package/dist/icon/svg/content/dataReport-filled.svg +1 -0
  166. package/dist/icon/svg/content/dataReport.svg +1 -0
  167. package/dist/icon/svg/content/download-1.svg +1 -0
  168. package/dist/icon/svg/content/download-filled.svg +1 -0
  169. package/dist/icon/svg/content/download.svg +1 -0
  170. package/dist/icon/svg/content/exchange.svg +1 -0
  171. package/dist/icon/svg/content/filter-filled.svg +1 -0
  172. package/dist/icon/svg/content/filter.svg +1 -0
  173. package/dist/icon/svg/content/hot-filled.svg +1 -0
  174. package/dist/icon/svg/content/hot.svg +1 -0
  175. package/dist/icon/svg/content/link.svg +1 -0
  176. package/dist/icon/svg/content/location.svg +1 -0
  177. package/dist/icon/svg/content/maxSize.svg +1 -0
  178. package/dist/icon/svg/content/mobile-filled.svg +1 -0
  179. package/dist/icon/svg/content/mobile.svg +1 -0
  180. package/dist/icon/svg/content/mute.svg +1 -0
  181. package/dist/icon/svg/content/mutiImage-filled.svg +1 -0
  182. package/dist/icon/svg/content/mutiImage.svg +1 -0
  183. package/dist/icon/svg/content/refresh.svg +1 -0
  184. package/dist/icon/svg/content/report.svg +1 -0
  185. package/dist/icon/svg/content/save.svg +1 -0
  186. package/dist/icon/svg/content/search-bold.svg +1 -0
  187. package/dist/icon/svg/content/search-filled.svg +1 -0
  188. package/dist/icon/svg/content/search.svg +1 -0
  189. package/dist/icon/svg/content/setting.svg +1 -0
  190. package/dist/icon/svg/content/share.svg +1 -0
  191. package/dist/icon/svg/content/sort.svg +1 -0
  192. package/dist/icon/svg/content/sound.svg +1 -0
  193. package/dist/icon/svg/content/sticker-filled.svg +1 -0
  194. package/dist/icon/svg/content/sticker.svg +1 -0
  195. package/dist/icon/svg/content/tag-filled.svg +1 -0
  196. package/dist/icon/svg/content/tag.svg +1 -0
  197. package/dist/icon/svg/content/thumbDown-filled.svg +1 -0
  198. package/dist/icon/svg/content/thumbDown.svg +1 -0
  199. package/dist/icon/svg/content/thumbUp-filled.svg +1 -0
  200. package/dist/icon/svg/content/thumbUp.svg +1 -0
  201. package/dist/icon/svg/content/time-bold.svg +1 -0
  202. package/dist/icon/svg/content/time.svg +1 -0
  203. package/dist/icon/svg/content/verify.svg +1 -0
  204. package/dist/icon/svg/content/video.svg +1 -0
  205. package/dist/icon/svg/content/videoScreenshot.svg +1 -0
  206. package/dist/icon/svg/content/zoomIn.svg +1 -0
  207. package/dist/icon/svg/content/zoomOut.svg +1 -0
  208. package/dist/icon/svg/data/compare.svg +1 -0
  209. package/dist/icon/svg/data/histogram.svg +1 -0
  210. package/dist/icon/svg/editor/cancel-circle-filled.svg +1 -0
  211. package/dist/icon/svg/editor/cancel-circle.svg +1 -0
  212. package/dist/icon/svg/editor/cancel.svg +1 -0
  213. package/dist/icon/svg/editor/check-circle-filled.svg +1 -0
  214. package/dist/icon/svg/editor/check-circle.svg +1 -0
  215. package/dist/icon/svg/editor/check.svg +1 -0
  216. package/dist/icon/svg/editor/copy.svg +1 -0
  217. package/dist/icon/svg/editor/custom-filled.svg +1 -0
  218. package/dist/icon/svg/editor/custom.svg +1 -0
  219. package/dist/icon/svg/editor/delete.svg +1 -0
  220. package/dist/icon/svg/editor/deleteAD-filled.svg +1 -0
  221. package/dist/icon/svg/editor/draggable.svg +1 -0
  222. package/dist/icon/svg/editor/edit.svg +1 -0
  223. package/dist/icon/svg/editor/import.svg +1 -0
  224. package/dist/icon/svg/editor/minus-circle-filled.svg +1 -0
  225. package/dist/icon/svg/editor/minus-circle.svg +1 -0
  226. package/dist/icon/svg/editor/minus.svg +1 -0
  227. package/dist/icon/svg/editor/modify-bold.svg +1 -0
  228. package/dist/icon/svg/editor/modify.svg +1 -0
  229. package/dist/icon/svg/editor/multiCreate.svg +1 -0
  230. package/dist/icon/svg/editor/mutiSelect-filled.svg +1 -0
  231. package/dist/icon/svg/editor/mutiSelect.svg +1 -0
  232. package/dist/icon/svg/editor/pause-filled.svg +1 -0
  233. package/dist/icon/svg/editor/play-filled.svg +1 -0
  234. package/dist/icon/svg/editor/plus-circle-filled.svg +1 -0
  235. package/dist/icon/svg/editor/plus-circle.svg +1 -0
  236. package/dist/icon/svg/editor/plus.svg +1 -0
  237. package/dist/icon/svg/editor/send.svg +1 -0
  238. package/dist/icon/svg/editor/subdivide.svg +1 -0
  239. package/dist/icon/svg/navigation/arrowDown-filled.svg +1 -0
  240. package/dist/icon/svg/navigation/arrowDown.svg +1 -0
  241. package/dist/icon/svg/navigation/arrowLeft-filled.svg +1 -0
  242. package/dist/icon/svg/navigation/arrowLeft.svg +1 -0
  243. package/dist/icon/svg/navigation/arrowRight-filled.svg +1 -0
  244. package/dist/icon/svg/navigation/arrowRight.svg +1 -0
  245. package/dist/icon/svg/navigation/arrowUp-filled.svg +1 -0
  246. package/dist/icon/svg/navigation/arrowUp.svg +1 -0
  247. package/dist/icon/svg/navigation/bottom-filled.svg +1 -0
  248. package/dist/icon/svg/navigation/bottom.svg +1 -0
  249. package/dist/icon/svg/navigation/doubleLeft-filled.svg +1 -0
  250. package/dist/icon/svg/navigation/doubleLeft.svg +1 -0
  251. package/dist/icon/svg/navigation/doubleRight-filled.svg +1 -0
  252. package/dist/icon/svg/navigation/doubleRight.svg +1 -0
  253. package/dist/icon/svg/navigation/down-bold.svg +1 -0
  254. package/dist/icon/svg/navigation/down-filled.svg +1 -0
  255. package/dist/icon/svg/navigation/down.svg +1 -0
  256. package/dist/icon/svg/navigation/fall-filled.svg +1 -0
  257. package/dist/icon/svg/navigation/fold.svg +1 -0
  258. package/dist/icon/svg/navigation/fullScreen.svg +1 -0
  259. package/dist/icon/svg/navigation/left-bold.svg +1 -0
  260. package/dist/icon/svg/navigation/left-filled.svg +1 -0
  261. package/dist/icon/svg/navigation/left.svg +1 -0
  262. package/dist/icon/svg/navigation/leftFirst-filled.svg +1 -0
  263. package/dist/icon/svg/navigation/leftFirst.svg +1 -0
  264. package/dist/icon/svg/navigation/logout.svg +1 -0
  265. package/dist/icon/svg/navigation/menu.svg +1 -0
  266. package/dist/icon/svg/navigation/menuLeft-bold.svg +1 -0
  267. package/dist/icon/svg/navigation/menuLeft.svg +1 -0
  268. package/dist/icon/svg/navigation/menuRight-bold.svg +1 -0
  269. package/dist/icon/svg/navigation/menuRight.svg +1 -0
  270. package/dist/icon/svg/navigation/more-vertical.svg +1 -0
  271. package/dist/icon/svg/navigation/more.svg +1 -0
  272. package/dist/icon/svg/navigation/pointerLeft-filled.svg +1 -0
  273. package/dist/icon/svg/navigation/pointerRight-filled.svg +1 -0
  274. package/dist/icon/svg/navigation/right-bold.svg +1 -0
  275. package/dist/icon/svg/navigation/right-filled.svg +1 -0
  276. package/dist/icon/svg/navigation/right.svg +1 -0
  277. package/dist/icon/svg/navigation/rightLast-filled.svg +1 -0
  278. package/dist/icon/svg/navigation/rightLast.svg +1 -0
  279. package/dist/icon/svg/navigation/rise-filled.svg +1 -0
  280. package/dist/icon/svg/navigation/top-filled.svg +1 -0
  281. package/dist/icon/svg/navigation/top.svg +1 -0
  282. package/dist/icon/svg/navigation/unfold-filled.svg +1 -0
  283. package/dist/icon/svg/navigation/unfold.svg +1 -0
  284. package/dist/icon/svg/navigation/up-bold.svg +1 -0
  285. package/dist/icon/svg/navigation/up-filled.svg +1 -0
  286. package/dist/icon/svg/navigation/up.svg +1 -0
  287. package/dist/icon/svg/product/AIFile.svg +1 -0
  288. package/dist/icon/svg/product/LandingPage.svg +1 -0
  289. package/dist/icon/svg/product/addressBook.svg +1 -0
  290. package/dist/icon/svg/product/alarmClock.svg +1 -0
  291. package/dist/icon/svg/product/asset-square.svg +1 -0
  292. package/dist/icon/svg/product/assetProtecting.svg +1 -0
  293. package/dist/icon/svg/product/autoAD-square-filled.svg +1 -0
  294. package/dist/icon/svg/product/card-distribute.svg +1 -0
  295. package/dist/icon/svg/product/channels-square-filled.svg +1 -0
  296. package/dist/icon/svg/product/channels.svg +1 -0
  297. package/dist/icon/svg/product/chart.svg +3 -0
  298. package/dist/icon/svg/product/chatBubble-filled.svg +1 -0
  299. package/dist/icon/svg/product/checkBadge.svg +1 -0
  300. package/dist/icon/svg/product/comments.svg +1 -0
  301. package/dist/icon/svg/product/container.svg +1 -0
  302. package/dist/icon/svg/product/dataAuth.svg +1 -0
  303. package/dist/icon/svg/product/dataBoard.svg +1 -0
  304. package/dist/icon/svg/product/dataBox.svg +1 -0
  305. package/dist/icon/svg/product/dataFolder.svg +1 -0
  306. package/dist/icon/svg/product/dataRising.svg +1 -0
  307. package/dist/icon/svg/product/detect.svg +1 -0
  308. package/dist/icon/svg/product/exposure-filled.svg +1 -0
  309. package/dist/icon/svg/product/extendedConfig.svg +1 -0
  310. package/dist/icon/svg/product/file-filled.svg +1 -0
  311. package/dist/icon/svg/product/flag.svg +1 -0
  312. package/dist/icon/svg/product/flame.svg +1 -0
  313. package/dist/icon/svg/product/folderZip.svg +1 -0
  314. package/dist/icon/svg/product/folderzip-bold.svg +1 -0
  315. package/dist/icon/svg/product/guideBook.svg +1 -0
  316. package/dist/icon/svg/product/hosting.svg +1 -0
  317. package/dist/icon/svg/product/icon-outlined.svg +1 -0
  318. package/dist/icon/svg/product/idea-bold.svg +1 -0
  319. package/dist/icon/svg/product/idea.svg +1 -0
  320. package/dist/icon/svg/product/image-bold.svg +1 -0
  321. package/dist/icon/svg/product/image-filled.svg +1 -0
  322. package/dist/icon/svg/product/image.svg +1 -0
  323. package/dist/icon/svg/product/images.svg +1 -0
  324. package/dist/icon/svg/product/keyword.svg +1 -0
  325. package/dist/icon/svg/product/linkSquare.svg +1 -0
  326. package/dist/icon/svg/product/lock.svg +1 -0
  327. package/dist/icon/svg/product/magic-filled.svg +1 -0
  328. package/dist/icon/svg/product/magic.svg +1 -0
  329. package/dist/icon/svg/product/miniProgram.svg +1 -0
  330. package/dist/icon/svg/product/minigame-filled.svg +1 -0
  331. package/dist/icon/svg/product/mobilePage.svg +1 -0
  332. package/dist/icon/svg/product/moments-filled.svg +1 -0
  333. package/dist/icon/svg/product/notepad-bold.svg +1 -0
  334. package/dist/icon/svg/product/notepad.svg +1 -0
  335. package/dist/icon/svg/product/offiaccount-filled.svg +1 -0
  336. package/dist/icon/svg/product/playing.svg +1 -0
  337. package/dist/icon/svg/product/qualification.svg +1 -0
  338. package/dist/icon/svg/product/quickFile.svg +1 -0
  339. package/dist/icon/svg/product/ringStruckture.svg +1 -0
  340. package/dist/icon/svg/product/searchAD-filled.svg +1 -0
  341. package/dist/icon/svg/product/searchAD.svg +1 -0
  342. package/dist/icon/svg/product/shield-filled.svg +1 -0
  343. package/dist/icon/svg/product/shield.svg +1 -0
  344. package/dist/icon/svg/product/shop.svg +1 -0
  345. package/dist/icon/svg/product/shopping.svg +1 -0
  346. package/dist/icon/svg/product/star-filled.svg +1 -0
  347. package/dist/icon/svg/product/star.svg +1 -0
  348. package/dist/icon/svg/product/support-bold.svg +1 -0
  349. package/dist/icon/svg/product/target.svg +1 -0
  350. package/dist/icon/svg/product/targeting.svg +1 -0
  351. package/dist/icon/svg/product/task-filled.svg +1 -0
  352. package/dist/icon/svg/product/task.svg +1 -0
  353. package/dist/icon/svg/product/template.svg +1 -0
  354. package/dist/icon/svg/product/templateBag.svg +1 -0
  355. package/dist/icon/svg/product/text.svg +1 -0
  356. package/dist/icon/svg/product/treeStructure.svg +1 -0
  357. package/dist/icon/svg/product/user-add.svg +3 -0
  358. package/dist/icon/svg/product/user-circle.svg +1 -0
  359. package/dist/icon/svg/product/user-edit.svg +1 -0
  360. package/dist/icon/svg/product/user-pack.svg +1 -0
  361. package/dist/icon/svg/product/userList.svg +1 -0
  362. package/dist/icon/svg/product/userPack.svg +1 -0
  363. package/dist/icon/svg/product/users-bold.svg +1 -0
  364. package/dist/icon/svg/product/users.svg +1 -0
  365. package/dist/icon/svg/product/videoBag-filled.svg +1 -0
  366. package/dist/icon/svg/product/viewMask.svg +1 -0
  367. package/dist/icon/svg/product/wallet.svg +1 -0
  368. package/dist/icon/svg/product/wechatBubble-filled.svg +1 -0
  369. package/dist/icon/svg/product/wechatBubble.svg +1 -0
  370. package/dist/icon/svg/product/wechatSearch.svg +1 -0
  371. package/dist/icon/svg/product/writing.svg +1 -0
  372. package/dist/icon/svg-data.d.ts +479 -0
  373. package/dist/icon/svg-data.js +481 -0
  374. package/dist/icon/test-icons.html +122 -0
  375. package/dist/icon/types.d.ts +3 -0
  376. package/dist/icon/types.js +5 -0
  377. package/dist/index.d.ts +52 -0
  378. package/dist/index.js +57 -0
  379. package/dist/input/index.d.ts +82 -0
  380. package/dist/input/index.js +451 -0
  381. package/dist/input/style/index.css +244 -0
  382. package/dist/input/style/index.d.ts +2 -0
  383. package/dist/input/style/index.js +2 -0
  384. package/dist/input-number/index.d.ts +41 -0
  385. package/dist/input-number/index.js +431 -0
  386. package/dist/input-number/style/index.css +65 -0
  387. package/dist/input-number/style/index.d.ts +2 -0
  388. package/dist/input-number/style/index.js +2 -0
  389. package/dist/input-otp/index.d.ts +71 -0
  390. package/dist/input-otp/index.js +87 -0
  391. package/dist/input-otp/style/index.css +110 -0
  392. package/dist/input-otp/style/index.d.ts +2 -0
  393. package/dist/input-otp/style/index.js +2 -0
  394. package/dist/layout/index.d.ts +3 -0
  395. package/dist/layout/index.js +3 -0
  396. package/dist/layout/layout.d.ts +32 -0
  397. package/dist/layout/layout.js +203 -0
  398. package/dist/layout/mp-layout.d.ts +68 -0
  399. package/dist/layout/mp-layout.js +204 -0
  400. package/dist/layout/style/index.css +464 -0
  401. package/dist/layout/style/index.d.ts +2 -0
  402. package/dist/layout/style/index.js +2 -0
  403. package/dist/link/index.d.ts +37 -0
  404. package/dist/link/index.js +46 -0
  405. package/dist/link/style/index.css +39 -0
  406. package/dist/link/style/index.d.ts +2 -0
  407. package/dist/link/style/index.js +2 -0
  408. package/dist/loading/index.d.ts +11 -0
  409. package/dist/loading/index.js +46 -0
  410. package/dist/loading/style/index.css +84 -0
  411. package/dist/loading/style/index.d.ts +2 -0
  412. package/dist/loading/style/index.js +2 -0
  413. package/dist/message/MessageBase.d.ts +86 -0
  414. package/dist/message/MessageBase.js +395 -0
  415. package/dist/message/MessageReact16.d.ts +2 -0
  416. package/dist/message/MessageReact16.js +86 -0
  417. package/dist/message/MessageReact18.d.ts +2 -0
  418. package/dist/message/MessageReact18.js +98 -0
  419. package/dist/message/index.d.ts +3 -0
  420. package/dist/message/index.js +7 -0
  421. package/dist/message/style/index.css +121 -0
  422. package/dist/message/style/index.d.ts +2 -0
  423. package/dist/message/style/index.js +2 -0
  424. package/dist/modal-base/gap.d.ts +14 -0
  425. package/dist/modal-base/gap.js +31 -0
  426. package/dist/modal-base/index.d.ts +26 -0
  427. package/dist/modal-base/index.js +114 -0
  428. package/dist/number-flow/index.d.ts +13 -0
  429. package/dist/number-flow/index.js +25 -0
  430. package/dist/number-flow/style/index.css +1 -0
  431. package/dist/number-flow/style/index.d.ts +2 -0
  432. package/dist/number-flow/style/index.js +2 -0
  433. package/dist/pagination/index.d.ts +63 -0
  434. package/dist/pagination/index.js +424 -0
  435. package/dist/pagination/style/index.css +135 -0
  436. package/dist/pagination/style/index.d.ts +2 -0
  437. package/dist/pagination/style/index.js +2 -0
  438. package/dist/pop-base/index.d.ts +143 -0
  439. package/dist/pop-base/index.js +381 -0
  440. package/dist/pop-base/mergeProps.d.ts +37 -0
  441. package/dist/pop-base/mergeProps.js +144 -0
  442. package/dist/pop-base/style/index.css +123 -0
  443. package/dist/pop-base/style/index.d.ts +2 -0
  444. package/dist/pop-base/style/index.js +2 -0
  445. package/dist/pop-base/useForkRef.d.ts +5 -0
  446. package/dist/pop-base/useForkRef.js +52 -0
  447. package/dist/popover/index.d.ts +4 -0
  448. package/dist/popover/index.js +9 -0
  449. package/dist/radio/index.d.ts +35 -0
  450. package/dist/radio/index.js +77 -0
  451. package/dist/radio/primitive.d.ts +5 -0
  452. package/dist/radio/primitive.js +28 -0
  453. package/dist/radio/style/index.css +224 -0
  454. package/dist/radio/style/index.d.ts +2 -0
  455. package/dist/radio/style/index.js +2 -0
  456. package/dist/scroll-area/index.d.ts +29 -0
  457. package/dist/scroll-area/index.js +118 -0
  458. package/dist/scroll-area/style/index.css +107 -0
  459. package/dist/scroll-area/style/index.d.ts +2 -0
  460. package/dist/scroll-area/style/index.js +2 -0
  461. package/dist/select/index.d.ts +86 -0
  462. package/dist/select/index.js +275 -0
  463. package/dist/select/style/index.css +1473 -0
  464. package/dist/select/style/index.d.ts +2 -0
  465. package/dist/select/style/index.js +2 -0
  466. package/dist/select/useIcons.d.ts +25 -0
  467. package/dist/select/useIcons.js +80 -0
  468. package/dist/select/utils.d.ts +9 -0
  469. package/dist/select/utils.js +40 -0
  470. package/dist/slider/index.d.ts +69 -0
  471. package/dist/slider/index.js +264 -0
  472. package/dist/slider/style/index.css +210 -0
  473. package/dist/slider/style/index.d.ts +2 -0
  474. package/dist/slider/style/index.js +2 -0
  475. package/dist/style/base.css +296 -0
  476. package/dist/style/index.d.ts +7 -0
  477. package/dist/style/index.js +18 -0
  478. package/dist/style/theme-adui.css +352 -0
  479. package/dist/switch/index.d.ts +12 -0
  480. package/dist/switch/index.js +55 -0
  481. package/dist/switch/style/index.css +149 -0
  482. package/dist/switch/style/index.d.ts +2 -0
  483. package/dist/switch/style/index.js +2 -0
  484. package/dist/table/TableCellContent.d.ts +20 -0
  485. package/dist/table/TableCellContent.js +82 -0
  486. package/dist/table/index.d.ts +97 -0
  487. package/dist/table/index.js +796 -0
  488. package/dist/table/style/index.css +301 -0
  489. package/dist/table/style/index.d.ts +2 -0
  490. package/dist/table/style/index.js +2 -0
  491. package/dist/table/useSelection.d.ts +13 -0
  492. package/dist/table/useSelection.js +268 -0
  493. package/dist/tabs/index.d.ts +51 -0
  494. package/dist/tabs/index.js +697 -0
  495. package/dist/tabs/style/index.css +305 -0
  496. package/dist/tabs/style/index.d.ts +2 -0
  497. package/dist/tabs/style/index.js +2 -0
  498. package/dist/text-swap/index.d.ts +58 -0
  499. package/dist/text-swap/index.js +280 -0
  500. package/dist/text-swap/style/index.css +29 -0
  501. package/dist/text-swap/style/index.d.ts +2 -0
  502. package/dist/text-swap/style/index.js +2 -0
  503. package/dist/time-picker/index.d.ts +67 -0
  504. package/dist/time-picker/index.js +945 -0
  505. package/dist/time-picker/style/index.css +153 -0
  506. package/dist/time-picker/style/index.d.ts +2 -0
  507. package/dist/time-picker/style/index.js +2 -0
  508. package/dist/tooltip/index.d.ts +10 -0
  509. package/dist/tooltip/index.js +178 -0
  510. package/dist/tree-select/index.d.ts +25 -0
  511. package/dist/tree-select/index.js +140 -0
  512. package/dist/tree-select/style/index.css +180 -0
  513. package/dist/tree-select/style/index.d.ts +1 -0
  514. package/dist/tree-select/style/index.js +1 -0
  515. package/dist/virtual-list/index.d.ts +98 -0
  516. package/dist/virtual-list/index.js +56 -0
  517. package/dist/virtual-list/style/index.css +9 -0
  518. package/dist/virtual-list/style/index.d.ts +2 -0
  519. package/dist/virtual-list/style/index.js +2 -0
  520. package/package.json +132 -0
@@ -0,0 +1,143 @@
1
+ import { OpenChangeReason } from '@floating-ui/react';
2
+ import React from 'react';
3
+ import './style';
4
+ export interface PopoverProps {
5
+ /**
6
+ * @description 配置允许的适配位置
7
+ * @default []
8
+ */
9
+ autoPlacements?: ('top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom')[];
10
+ /**
11
+ * @description 是否显示箭头
12
+ * @default true
13
+ */
14
+ arrowed?: boolean;
15
+ /**
16
+ * @description 箭头偏移量,单位:px
17
+ * @default { x: 0, y: 0 }
18
+ */
19
+ arrowOffset?: {
20
+ x?: number;
21
+ y?: number;
22
+ };
23
+ /**
24
+ * @description 子元素
25
+ */
26
+ children?: React.ReactNode;
27
+ /**
28
+ * @description 是否翻转
29
+ * @default true
30
+ */
31
+ flip?: boolean;
32
+ /**
33
+ * @description 是否匹配宽度
34
+ * @default false
35
+ */
36
+ matchWidth?: boolean;
37
+ /**
38
+ * @description 鼠标进入延迟时间,单位:s,仅在 trigger="hover" 时有效
39
+ * @default 0
40
+ */
41
+ mouseEnterDelay?: number;
42
+ /**
43
+ * @description 鼠标离开延迟时间,单位:s,仅在 trigger="hover" 时有效
44
+ * @default 0
45
+ */
46
+ mouseLeaveDelay?: number;
47
+ /**
48
+ * @description 偏移量
49
+ */
50
+ offset?: number | {
51
+ mainAxis?: number;
52
+ crossAxis?: number;
53
+ alignmentAxis?: number | null;
54
+ };
55
+ /**
56
+ * @description 显示变化时触发
57
+ */
58
+ onVisibleChange?: (visible: boolean, e?: Event, reason?: OpenChangeReason) => void;
59
+ /**
60
+ * @description 位置
61
+ * @default 'top'
62
+ */
63
+ placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
64
+ /**
65
+ * @description 弹窗内容
66
+ */
67
+ popup: React.ReactNode;
68
+ /**
69
+ * @description 弹窗内容类名
70
+ */
71
+ popupClassName?: string;
72
+ /**
73
+ * @description 弹窗内容样式
74
+ */
75
+ popupStyle?: React.CSSProperties;
76
+ /**
77
+ * @description 弹窗根节点类名
78
+ */
79
+ popupRootClassName?: string;
80
+ /**
81
+ * @description 弹窗根节点样式
82
+ */
83
+ popupRootStyle?: React.CSSProperties;
84
+ /**
85
+ * @description 是否使用 portal 渲染
86
+ * @default true
87
+ */
88
+ portal?: boolean;
89
+ /**
90
+ * @description 是否 shift
91
+ * @default true
92
+ */
93
+ shift?: boolean;
94
+ /**
95
+ * @description 弹窗内容大小,组件会吐出可用空间,业务方需要自行使用
96
+ */
97
+ size?: (params: {
98
+ availableWidth: number;
99
+ availableHeight: number;
100
+ }) => void;
101
+ /**
102
+ * @description 触发方式
103
+ * @default 'hover'
104
+ */
105
+ trigger?: 'hover' | 'focus' | 'click';
106
+ /**
107
+ * @description 外部控制
108
+ * @default null
109
+ */
110
+ visible?: boolean;
111
+ /**
112
+ * @description 关闭后是否销毁 dom
113
+ * @default true
114
+ */
115
+ destroyOnHidden?: boolean;
116
+ /**
117
+ * description 是否在祖先滚动时隐藏
118
+ */
119
+ hideOnAncestorScroll?: boolean;
120
+ /**
121
+ * @description 指定弹窗挂载的容器
122
+ */
123
+ getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
124
+ /**
125
+ * @description z-index
126
+ */
127
+ zIndex?: number | string;
128
+ /**
129
+ * @description 鼠标进入事件
130
+ */
131
+ onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
132
+ /**
133
+ * @description 鼠标离开事件
134
+ */
135
+ onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
136
+ }
137
+ export declare const defaultProps: PopoverProps;
138
+ declare const PopBase: React.ForwardRefExoticComponent<PopoverProps & {
139
+ type: 'popover' | 'tooltip';
140
+ } & React.RefAttributes<{
141
+ refs: any;
142
+ }>>;
143
+ export default PopBase;
@@ -0,0 +1,381 @@
1
+ 'use client';
2
+
3
+ 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); }
4
+ var _excluded = ["className"];
5
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
7
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ 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."); }
15
+ 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); }
16
+ 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; }
17
+ 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; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ import { FloatingPortal, arrow, autoPlacement, autoUpdate, flip, limitShift, offset, shift, size, useClick, useDismiss, useFloating, useFocus, useHover, useInteractions, useMergeRefs, useTransitionStatus } from '@floating-ui/react';
20
+ import clsx from 'clsx';
21
+ import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
22
+ import ReactDOM from 'react-dom';
23
+ import "./style";
24
+
25
+ // 检测 React 版本
26
+ var getReactVersion = function getReactVersion() {
27
+ var version = React.version;
28
+ var majorVersion = parseInt(version.split('.')[0], 10);
29
+ return majorVersion;
30
+ };
31
+ var isReact16OrLower = function isReact16OrLower() {
32
+ return getReactVersion() <= 16;
33
+ };
34
+ var ARROW_OFFSET = 10;
35
+ var placementMap = {
36
+ top: 'top',
37
+ topLeft: 'top-start',
38
+ topRight: 'top-end',
39
+ bottom: 'bottom',
40
+ bottomLeft: 'bottom-start',
41
+ bottomRight: 'bottom-end',
42
+ left: 'left',
43
+ leftTop: 'left-start',
44
+ leftBottom: 'left-end',
45
+ right: 'right',
46
+ rightTop: 'right-start',
47
+ rightBottom: 'right-end'
48
+ };
49
+ export var defaultProps = {
50
+ autoPlacements: [],
51
+ arrowed: true,
52
+ arrowOffset: {
53
+ x: 0,
54
+ y: 0
55
+ },
56
+ children: undefined,
57
+ flip: true,
58
+ matchWidth: false,
59
+ mouseEnterDelay: 0,
60
+ mouseLeaveDelay: 0,
61
+ offset: undefined,
62
+ onVisibleChange: undefined,
63
+ placement: 'top',
64
+ popup: undefined,
65
+ popupRootClassName: '',
66
+ popupRootStyle: {},
67
+ popupClassName: '',
68
+ popupStyle: {},
69
+ portal: true,
70
+ shift: true,
71
+ size: undefined,
72
+ trigger: 'hover',
73
+ visible: undefined,
74
+ getPopupContainer: undefined,
75
+ zIndex: undefined,
76
+ destroyOnHidden: true,
77
+ hideOnAncestorScroll: false
78
+ };
79
+ var getTransformOrigin = function getTransformOrigin(_ref) {
80
+ var placement = _ref.placement,
81
+ x = _ref.x,
82
+ y = _ref.y;
83
+ var xOrigin = '50%';
84
+ var yOrigin = '50%';
85
+ if (placement.includes('top')) {
86
+ xOrigin = x === undefined ? '50%' : "".concat(x + ARROW_OFFSET, "px");
87
+ yOrigin = 'calc(100% + 8px)';
88
+ } else if (placement.includes('bottom')) {
89
+ xOrigin = x === undefined ? '50%' : "".concat(x + ARROW_OFFSET, "px");
90
+ yOrigin = '-8px';
91
+ } else if (placement.includes('left')) {
92
+ xOrigin = 'calc(100% + 8px)';
93
+ yOrigin = y === undefined ? '50%' : "".concat(y + ARROW_OFFSET, "px");
94
+ } else if (placement.includes('right')) {
95
+ xOrigin = '-8px';
96
+ yOrigin = y === undefined ? '50%' : "".concat(y + ARROW_OFFSET, "px");
97
+ }
98
+ return "".concat(xOrigin, " ").concat(yOrigin);
99
+ };
100
+ var PopBase = /*#__PURE__*/React.forwardRef(function (_ref2, refProp) {
101
+ var _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _arrowOffset$x, _arrowOffset$y;
102
+ var _ref2$autoPlacements = _ref2.autoPlacements,
103
+ autoPlacements = _ref2$autoPlacements === void 0 ? defaultProps.autoPlacements : _ref2$autoPlacements,
104
+ _ref2$arrowed = _ref2.arrowed,
105
+ arrowed = _ref2$arrowed === void 0 ? defaultProps.arrowed : _ref2$arrowed,
106
+ _ref2$arrowOffset = _ref2.arrowOffset,
107
+ arrowOffset = _ref2$arrowOffset === void 0 ? defaultProps.arrowOffset : _ref2$arrowOffset,
108
+ _ref2$children = _ref2.children,
109
+ children = _ref2$children === void 0 ? defaultProps.children : _ref2$children,
110
+ _ref2$flip = _ref2.flip,
111
+ flipProp = _ref2$flip === void 0 ? defaultProps.flip : _ref2$flip,
112
+ _ref2$matchWidth = _ref2.matchWidth,
113
+ matchWidth = _ref2$matchWidth === void 0 ? defaultProps.matchWidth : _ref2$matchWidth,
114
+ _ref2$mouseEnterDelay = _ref2.mouseEnterDelay,
115
+ mouseEnterDelay = _ref2$mouseEnterDelay === void 0 ? defaultProps.mouseEnterDelay : _ref2$mouseEnterDelay,
116
+ _ref2$mouseLeaveDelay = _ref2.mouseLeaveDelay,
117
+ mouseLeaveDelay = _ref2$mouseLeaveDelay === void 0 ? defaultProps.mouseLeaveDelay : _ref2$mouseLeaveDelay,
118
+ _ref2$offset = _ref2.offset,
119
+ offsetProp = _ref2$offset === void 0 ? defaultProps.offset : _ref2$offset,
120
+ _ref2$onVisibleChange = _ref2.onVisibleChange,
121
+ onVisibleChange = _ref2$onVisibleChange === void 0 ? defaultProps.onVisibleChange : _ref2$onVisibleChange,
122
+ _ref2$placement = _ref2.placement,
123
+ placementProp = _ref2$placement === void 0 ? defaultProps.placement : _ref2$placement,
124
+ _ref2$popup = _ref2.popup,
125
+ popup = _ref2$popup === void 0 ? defaultProps.popup : _ref2$popup,
126
+ _ref2$popupClassName = _ref2.popupClassName,
127
+ popupClassName = _ref2$popupClassName === void 0 ? defaultProps.popupClassName : _ref2$popupClassName,
128
+ _ref2$popupRootClassN = _ref2.popupRootClassName,
129
+ popupRootClassName = _ref2$popupRootClassN === void 0 ? defaultProps.popupRootClassName : _ref2$popupRootClassN,
130
+ _ref2$popupRootStyle = _ref2.popupRootStyle,
131
+ popupRootStyle = _ref2$popupRootStyle === void 0 ? defaultProps.popupRootStyle : _ref2$popupRootStyle,
132
+ _ref2$popupStyle = _ref2.popupStyle,
133
+ popupStyle = _ref2$popupStyle === void 0 ? defaultProps.popupStyle : _ref2$popupStyle,
134
+ _ref2$portal = _ref2.portal,
135
+ portal = _ref2$portal === void 0 ? defaultProps.portal : _ref2$portal,
136
+ _ref2$shift = _ref2.shift,
137
+ shiftProp = _ref2$shift === void 0 ? defaultProps.shift : _ref2$shift,
138
+ _ref2$size = _ref2.size,
139
+ sizeProp = _ref2$size === void 0 ? defaultProps.size : _ref2$size,
140
+ _ref2$trigger = _ref2.trigger,
141
+ trigger = _ref2$trigger === void 0 ? defaultProps.trigger : _ref2$trigger,
142
+ type = _ref2.type,
143
+ _ref2$visible = _ref2.visible,
144
+ visible = _ref2$visible === void 0 ? defaultProps.visible : _ref2$visible,
145
+ _ref2$getPopupContain = _ref2.getPopupContainer,
146
+ getPopupContainer = _ref2$getPopupContain === void 0 ? defaultProps.getPopupContainer : _ref2$getPopupContain,
147
+ _ref2$zIndex = _ref2.zIndex,
148
+ zIndex = _ref2$zIndex === void 0 ? defaultProps.zIndex : _ref2$zIndex,
149
+ _ref2$destroyOnHidden = _ref2.destroyOnHidden,
150
+ destroyOnHidden = _ref2$destroyOnHidden === void 0 ? defaultProps.destroyOnHidden : _ref2$destroyOnHidden,
151
+ _ref2$hideOnAncestorS = _ref2.hideOnAncestorScroll,
152
+ hideOnAncestorScroll = _ref2$hideOnAncestorS === void 0 ? defaultProps.hideOnAncestorScroll : _ref2$hideOnAncestorS,
153
+ onMouseEnter = _ref2.onMouseEnter,
154
+ onMouseLeave = _ref2.onMouseLeave;
155
+ var _useState = useState(visible),
156
+ _useState2 = _slicedToArray(_useState, 2),
157
+ isOpen = _useState2[0],
158
+ setIsOpen = _useState2[1];
159
+ var arrowRef = useRef(null);
160
+ var _useState3 = useState(null),
161
+ _useState4 = _slicedToArray(_useState3, 2),
162
+ portalContainer = _useState4[0],
163
+ setPortalContainer = _useState4[1];
164
+ var _useFloating = useFloating({
165
+ placement: placementMap[placementProp || 'top'],
166
+ open: isOpen,
167
+ onOpenChange: function onOpenChange(bool, e, reason) {
168
+ if (onVisibleChange) {
169
+ onVisibleChange(bool, e, reason);
170
+ }
171
+ if (visible === undefined) {
172
+ setIsOpen(bool);
173
+ }
174
+ },
175
+ whileElementsMounted: autoUpdate,
176
+ middleware: [!!offsetProp && offset(offsetProp), autoPlacements !== null && autoPlacements !== void 0 && autoPlacements.length ? autoPlacement({
177
+ allowedPlacements: autoPlacements.map(function (placement) {
178
+ return placementMap[placement];
179
+ })
180
+ }) : flipProp ? flip() : undefined, shiftProp ? shift({
181
+ limiter: limitShift({
182
+ offset: 4
183
+ }),
184
+ padding: 16
185
+ }) : undefined, (!!sizeProp || matchWidth) && size({
186
+ apply: function apply(_ref3) {
187
+ var availableWidth = _ref3.availableWidth,
188
+ availableHeight = _ref3.availableHeight,
189
+ rects = _ref3.rects,
190
+ elements = _ref3.elements;
191
+ if (sizeProp) {
192
+ sizeProp({
193
+ availableWidth: availableWidth,
194
+ availableHeight: availableHeight
195
+ });
196
+ }
197
+ if (matchWidth) {
198
+ var _child = elements.floating.querySelector('[data-odn-popup-content]');
199
+ if (_child) {
200
+ Object.assign(_child.style, {
201
+ minWidth: "".concat(rects.reference.width, "px")
202
+ });
203
+ }
204
+ }
205
+ }
206
+ }), arrow({
207
+ element: arrowRef,
208
+ padding: 12
209
+ })]
210
+ }),
211
+ refs = _useFloating.refs,
212
+ floatingStyles = _useFloating.floatingStyles,
213
+ context = _useFloating.context,
214
+ middlewareData = _useFloating.middlewareData,
215
+ placement = _useFloating.placement;
216
+ var _useTransitionStatus = useTransitionStatus(context),
217
+ isMounted = _useTransitionStatus.isMounted,
218
+ status = _useTransitionStatus.status;
219
+ var hover = useHover(context, {
220
+ move: false,
221
+ enabled: trigger === 'hover',
222
+ delay: {
223
+ open: (mouseEnterDelay || 0) * 1000,
224
+ close: ((mouseLeaveDelay || 0) + 0.1) * 1000
225
+ }
226
+ });
227
+ var focus = useFocus(context, {
228
+ enabled: trigger === 'focus'
229
+ });
230
+ var click = useClick(context, {
231
+ enabled: trigger === 'click'
232
+ });
233
+ var dismiss = useDismiss(context, {
234
+ enabled: trigger !== 'click' || !isReact16OrLower(),
235
+ ancestorScroll: hideOnAncestorScroll
236
+ });
237
+ var _useInteractions = useInteractions([hover, focus, click, dismiss]),
238
+ getReferenceProps = _useInteractions.getReferenceProps,
239
+ getFloatingProps = _useInteractions.getFloatingProps;
240
+ var childrenRef = children === null || children === void 0 ? void 0 : children.ref;
241
+ var referenceCallbackRef = React.useCallback(function (node) {
242
+ if (node && getPopupContainer) {
243
+ setPortalContainer(getPopupContainer(node));
244
+ }
245
+ }, [getPopupContainer]);
246
+ var ref = useMergeRefs([context.refs.setReference, childrenRef, referenceCallbackRef]);
247
+ var child = null;
248
+ if ( /*#__PURE__*/React.isValidElement(children) && children.type !== React.Fragment) {
249
+ child = /*#__PURE__*/React.cloneElement(children, getReferenceProps(_objectSpread(_objectSpread({
250
+ ref: ref
251
+ }, children.props), {}, {
252
+ 'data-odn-open': context.open ? true : undefined
253
+ })));
254
+ }
255
+ useEffect(function () {
256
+ if (visible !== undefined) {
257
+ setIsOpen(visible);
258
+ }
259
+ }, [visible]);
260
+
261
+ // 自定义 clickoutside 处理,仅在 React 16 或更低版本且 trigger='click' 时启用
262
+ useEffect(function () {
263
+ if (trigger !== 'click' || !isReact16OrLower()) {
264
+ return;
265
+ }
266
+ var handleClickOutside = function handleClickOutside(event) {
267
+ var _refs$floating$curren;
268
+ var target = event.target;
269
+
270
+ // 如果弹窗没有显示,不需要处理
271
+ if (!isOpen) {
272
+ return;
273
+ }
274
+
275
+ // 检查点击是否在 reference 或 floating 内部
276
+ var isInsideReference = refs.reference.current && 'contains' in refs.reference.current && refs.reference.current.contains(target);
277
+ var isInsideFloating = (_refs$floating$curren = refs.floating.current) === null || _refs$floating$curren === void 0 ? void 0 : _refs$floating$curren.contains(target);
278
+
279
+ // 检查点击是否在任何其他 popup 内部(通过检查祖先是否有 data-floating-ui-portal,或有类名 odn-select-dropdown)
280
+ var isInsideAnyPopup = function () {
281
+ var element = target;
282
+ while (element && element !== document.body) {
283
+ if (element.hasAttribute('data-floating-ui-portal') || element.classList.contains('odn-select-dropdown')) {
284
+ return true;
285
+ }
286
+ element = element.parentElement;
287
+ }
288
+ return false;
289
+ }();
290
+
291
+ // 如果点击在两者之外且不在任何其他 popup 内部,则关闭弹窗
292
+ if (!isInsideReference && !isInsideFloating && !isInsideAnyPopup) {
293
+ if (onVisibleChange) {
294
+ onVisibleChange(false, event);
295
+ }
296
+ if (visible === undefined) {
297
+ setIsOpen(false);
298
+ }
299
+ }
300
+ };
301
+
302
+ // 添加点击事件监听器
303
+ document.addEventListener('pointerdown', handleClickOutside);
304
+
305
+ // 清理函数
306
+ return function () {
307
+ document.removeEventListener('pointerdown', handleClickOutside);
308
+ };
309
+ }, [trigger, isOpen, refs.reference, refs.floating, onVisibleChange, visible]);
310
+ var transformOrigin = getTransformOrigin({
311
+ placement: placement,
312
+ x: (_middlewareData$arrow = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.x) !== null && _middlewareData$arrow !== void 0 ? _middlewareData$arrow : 0,
313
+ y: (_middlewareData$arrow3 = (_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.y) !== null && _middlewareData$arrow3 !== void 0 ? _middlewareData$arrow3 : 0
314
+ });
315
+ var floatingProps = getFloatingProps();
316
+ var floatingClassName = floatingProps.className,
317
+ restFloatingProps = _objectWithoutProperties(floatingProps, _excluded);
318
+ var mergedClassName = clsx(popupRootClassName, typeof floatingClassName === 'string' ? floatingClassName : undefined);
319
+ var popupEl = /*#__PURE__*/React.createElement(React.Fragment, null, (!destroyOnHidden || isMounted) && /*#__PURE__*/React.createElement("div", _extends({
320
+ "data-odn-popup": true,
321
+ "data-status": status,
322
+ "data-placement": placement,
323
+ "data-arrowed": arrowed,
324
+ "data-type": type,
325
+ ref: refs.setFloating,
326
+ style: _objectSpread(_objectSpread(_objectSpread({
327
+ zIndex: zIndex
328
+ }, floatingStyles || {}), popupRootStyle), {}, {
329
+ opacity: !isMounted && !destroyOnHidden ? 0 : 1,
330
+ visibility: !isMounted && !destroyOnHidden ? 'hidden' : 'visible'
331
+ }),
332
+ className: mergedClassName,
333
+ onMouseEnter: onMouseEnter,
334
+ onMouseLeave: onMouseLeave
335
+ }, restFloatingProps), /*#__PURE__*/React.createElement("div", {
336
+ className: popupClassName,
337
+ "data-odn-popup-content": true,
338
+ "data-placement": placement,
339
+ "data-status": status,
340
+ "data-arrowed": arrowed,
341
+ style: _objectSpread({
342
+ transformOrigin: transformOrigin
343
+ }, popupStyle)
344
+ }, arrowed && /*#__PURE__*/React.createElement("span", {
345
+ style: {
346
+ top: (_middlewareData$arrow5 = middlewareData.arrow) === null || _middlewareData$arrow5 === void 0 ? void 0 : _middlewareData$arrow5.y,
347
+ left: (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x
348
+ },
349
+ "data-odn-popup-arrow": true,
350
+ "data-placement": placement,
351
+ ref: arrowRef
352
+ }, /*#__PURE__*/React.createElement("svg", {
353
+ width: "20",
354
+ height: "10",
355
+ viewBox: "0 0 20 10",
356
+ fill: "none",
357
+ style: {
358
+ transform: "translate3d(".concat((_arrowOffset$x = arrowOffset === null || arrowOffset === void 0 ? void 0 : arrowOffset.x) !== null && _arrowOffset$x !== void 0 ? _arrowOffset$x : 0, "px, ").concat((_arrowOffset$y = arrowOffset === null || arrowOffset === void 0 ? void 0 : arrowOffset.y) !== null && _arrowOffset$y !== void 0 ? _arrowOffset$y : 0, "px, 0)")
359
+ }
360
+ }, /*#__PURE__*/React.createElement("path", {
361
+ d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",
362
+ "data-odn-popup-arrow-fill": true
363
+ }), /*#__PURE__*/React.createElement("path", {
364
+ d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",
365
+ "data-odn-popup-arrow-outer-stroke": true
366
+ }), /*#__PURE__*/React.createElement("path", {
367
+ d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",
368
+ "data-odn-popup-arrow-inner-stroke": true
369
+ }))), popup)));
370
+ useImperativeHandle(refProp, function () {
371
+ return {
372
+ refs: refs,
373
+ floatingStyles: floatingStyles
374
+ };
375
+ });
376
+ return /*#__PURE__*/React.createElement(React.Fragment, null, child || /*#__PURE__*/React.createElement("div", _extends({
377
+ "data-odn-reference": true,
378
+ ref: refs.setReference
379
+ }, getReferenceProps()), children), portal ? getPopupContainer && portalContainer ? ( /*#__PURE__*/ReactDOM.createPortal(popupEl, portalContainer)) : /*#__PURE__*/React.createElement(FloatingPortal, null, popupEl) : popupEl);
380
+ });
381
+ export default PopBase;
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ export type BaseUIEvent<E extends React.SyntheticEvent<Element, Event>> = E & {
3
+ preventBaseUIHandler: () => void;
4
+ readonly baseUIHandlerPrevented?: boolean;
5
+ };
6
+ type WithPreventBaseUIHandler<T> = T extends (event: infer E) => any ? E extends React.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
7
+ /**
8
+ * Adds a `preventBaseUIHandler` method to all event handlers.
9
+ */
10
+ export type WithBaseUIEvent<T> = {
11
+ [K in keyof T]: WithPreventBaseUIHandler<T[K]>;
12
+ };
13
+ type MergableProps<T extends React.ElementType> = WithBaseUIEvent<React.ComponentPropsWithRef<T>> | ((otherProps: WithBaseUIEvent<React.ComponentPropsWithRef<T>>) => WithBaseUIEvent<React.ComponentPropsWithRef<T>>) | undefined;
14
+ /**
15
+ * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite
16
+ * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.
17
+ * Event handlers are merged such that they are called in sequence (the rightmost one being called first),
18
+ * and allows the user to prevent the subsequent event handlers from being
19
+ * executed by attaching a `preventBaseUIHandler` method.
20
+ * It also merges the `className` and `style` props, whereby the classes are concatenated
21
+ * and the rightmost styles overwrite the subsequent ones.
22
+ *
23
+ * Props can either be provided as objects or as functions that take the previous props as an argument.
24
+ * The function will receive the merged props up to that point (going from left to right):
25
+ * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.
26
+ * The function is responsible for chaining event handlers if needed (i.e. we don't run the merge logic).
27
+ *
28
+ * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.
29
+ * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.
30
+ *
31
+ * @important **`ref` is not merged.**
32
+ * @param props props to merge.
33
+ * @returns the merged props.
34
+ */
35
+ export declare function mergeProps<Tag extends React.ElementType>(...props: MergableProps<Tag>[]): WithBaseUIEvent<React.ComponentPropsWithRef<Tag>>;
36
+ export declare function makeEventPreventable<T extends React.SyntheticEvent>(event: BaseUIEvent<T>): BaseUIEvent<T>;
37
+ export {};