one-design-next 0.0.4-alpha.57

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 (459) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/dist/_util/color.d.ts +103 -0
  4. package/dist/_util/color.js +250 -0
  5. package/dist/_util/date.d.ts +53 -0
  6. package/dist/_util/date.js +656 -0
  7. package/dist/_util/focusManager.d.ts +12 -0
  8. package/dist/_util/focusManager.js +56 -0
  9. package/dist/_util/queueMtPolyfill.d.ts +5 -0
  10. package/dist/_util/queueMtPolyfill.js +19 -0
  11. package/dist/_util/time.d.ts +44 -0
  12. package/dist/_util/time.js +150 -0
  13. package/dist/_util/useActive.d.ts +6 -0
  14. package/dist/_util/useActive.js +25 -0
  15. package/dist/alert/index.d.ts +63 -0
  16. package/dist/alert/index.js +137 -0
  17. package/dist/alert/style/index.css +199 -0
  18. package/dist/alert/style/index.d.ts +2 -0
  19. package/dist/alert/style/index.js +2 -0
  20. package/dist/auto-complete/index.d.ts +51 -0
  21. package/dist/auto-complete/index.js +104 -0
  22. package/dist/avatar/index.d.ts +68 -0
  23. package/dist/avatar/index.js +177 -0
  24. package/dist/avatar/primitive.d.ts +6 -0
  25. package/dist/avatar/primitive.js +23 -0
  26. package/dist/avatar/style/index.css +79 -0
  27. package/dist/avatar/style/index.d.ts +2 -0
  28. package/dist/avatar/style/index.js +2 -0
  29. package/dist/button/index.d.ts +15 -0
  30. package/dist/button/index.js +64 -0
  31. package/dist/button/style/index.css +347 -0
  32. package/dist/button/style/index.d.ts +2 -0
  33. package/dist/button/style/index.js +2 -0
  34. package/dist/calendar/index.d.ts +25 -0
  35. package/dist/calendar/index.js +379 -0
  36. package/dist/calendar/style/index.css +3 -0
  37. package/dist/calendar/style/index.d.ts +2 -0
  38. package/dist/calendar/style/index.js +2 -0
  39. package/dist/cascader/CascaderOptionContent.d.ts +20 -0
  40. package/dist/cascader/CascaderOptionContent.js +75 -0
  41. package/dist/cascader/Panel.d.ts +53 -0
  42. package/dist/cascader/Panel.js +116 -0
  43. package/dist/cascader/index.d.ts +54 -0
  44. package/dist/cascader/index.js +314 -0
  45. package/dist/cascader/style/index.css +458 -0
  46. package/dist/cascader/style/index.d.ts +2 -0
  47. package/dist/cascader/style/index.js +2 -0
  48. package/dist/cascader/utils.d.ts +12 -0
  49. package/dist/cascader/utils.js +85 -0
  50. package/dist/chart/index.d.ts +14 -0
  51. package/dist/chart/index.js +11 -0
  52. package/dist/chart/style/index.css +0 -0
  53. package/dist/chart/style/index.d.ts +2 -0
  54. package/dist/chart/style/index.js +2 -0
  55. package/dist/checkbox/Checkbox.d.ts +69 -0
  56. package/dist/checkbox/Checkbox.js +148 -0
  57. package/dist/checkbox/Context.d.ts +21 -0
  58. package/dist/checkbox/Context.js +2 -0
  59. package/dist/checkbox/Group.d.ts +49 -0
  60. package/dist/checkbox/Group.js +125 -0
  61. package/dist/checkbox/index.d.ts +5 -0
  62. package/dist/checkbox/index.js +3 -0
  63. package/dist/checkbox/style/index.css +306 -0
  64. package/dist/checkbox/style/index.d.ts +2 -0
  65. package/dist/checkbox/style/index.js +2 -0
  66. package/dist/collapse/index.d.ts +43 -0
  67. package/dist/collapse/index.js +111 -0
  68. package/dist/collapse/primitive.d.ts +21 -0
  69. package/dist/collapse/primitive.js +107 -0
  70. package/dist/collapse/style/index.css +63 -0
  71. package/dist/collapse/style/index.d.ts +2 -0
  72. package/dist/collapse/style/index.js +2 -0
  73. package/dist/color-picker/index.d.ts +55 -0
  74. package/dist/color-picker/index.js +588 -0
  75. package/dist/color-picker/style/index.css +153 -0
  76. package/dist/color-picker/style/index.d.ts +2 -0
  77. package/dist/color-picker/style/index.js +2 -0
  78. package/dist/config-provider/index.d.ts +46 -0
  79. package/dist/config-provider/index.js +37 -0
  80. package/dist/date-picker/MonthPicker.d.ts +15 -0
  81. package/dist/date-picker/MonthPicker.js +134 -0
  82. package/dist/date-picker/QuarterPicker.d.ts +15 -0
  83. package/dist/date-picker/QuarterPicker.js +135 -0
  84. package/dist/date-picker/YearPicker.d.ts +13 -0
  85. package/dist/date-picker/YearPicker.js +81 -0
  86. package/dist/date-picker/index.d.ts +172 -0
  87. package/dist/date-picker/index.js +1138 -0
  88. package/dist/date-picker/style/index.css +548 -0
  89. package/dist/date-picker/style/index.d.ts +2 -0
  90. package/dist/date-picker/style/index.js +2 -0
  91. package/dist/date-range-picker/index.d.ts +46 -0
  92. package/dist/date-range-picker/index.js +1034 -0
  93. package/dist/dialog/index.d.ts +132 -0
  94. package/dist/dialog/index.js +282 -0
  95. package/dist/dialog/style/index.css +252 -0
  96. package/dist/dialog/style/index.d.ts +2 -0
  97. package/dist/dialog/style/index.js +2 -0
  98. package/dist/dialog/useModalPosition.d.ts +6 -0
  99. package/dist/dialog/useModalPosition.js +34 -0
  100. package/dist/drawer/index.d.ts +76 -0
  101. package/dist/drawer/index.js +186 -0
  102. package/dist/drawer/style/index.css +235 -0
  103. package/dist/drawer/style/index.d.ts +2 -0
  104. package/dist/drawer/style/index.js +2 -0
  105. package/dist/dropdown/index.d.ts +86 -0
  106. package/dist/dropdown/index.js +836 -0
  107. package/dist/dropdown/style/index.css +236 -0
  108. package/dist/dropdown/style/index.d.ts +2 -0
  109. package/dist/dropdown/style/index.js +2 -0
  110. package/dist/hover-fill/index.d.ts +43 -0
  111. package/dist/hover-fill/index.js +222 -0
  112. package/dist/hover-fill/style/index.css +38 -0
  113. package/dist/hover-fill/style/index.d.ts +2 -0
  114. package/dist/hover-fill/style/index.js +2 -0
  115. package/dist/icon/index.d.ts +11 -0
  116. package/dist/icon/index.js +95 -0
  117. package/dist/icon/style/index.css +15 -0
  118. package/dist/icon/style/index.d.ts +2 -0
  119. package/dist/icon/style/index.js +2 -0
  120. package/dist/icon/svg/alert/alert-circle-filled.svg +1 -0
  121. package/dist/icon/svg/alert/alert-circle.svg +1 -0
  122. package/dist/icon/svg/alert/help-circle-filled.svg +1 -0
  123. package/dist/icon/svg/alert/help-circle.svg +1 -0
  124. package/dist/icon/svg/alert/info-circle-filled.svg +1 -0
  125. package/dist/icon/svg/alert/info-circle.svg +1 -0
  126. package/dist/icon/svg/alert/stop.svg +1 -0
  127. package/dist/icon/svg/alert/warning-filled.svg +1 -0
  128. package/dist/icon/svg/alert/warning.svg +1 -0
  129. package/dist/icon/svg/content/QRcode.svg +1 -0
  130. package/dist/icon/svg/content/bell-filled.svg +1 -0
  131. package/dist/icon/svg/content/bell.svg +1 -0
  132. package/dist/icon/svg/content/bidding.svg +1 -0
  133. package/dist/icon/svg/content/calendar.svg +1 -0
  134. package/dist/icon/svg/content/code.svg +1 -0
  135. package/dist/icon/svg/content/customColumn.svg +1 -0
  136. package/dist/icon/svg/content/data.svg +1 -0
  137. package/dist/icon/svg/content/dataReport-filled.svg +1 -0
  138. package/dist/icon/svg/content/dataReport.svg +1 -0
  139. package/dist/icon/svg/content/download-1.svg +1 -0
  140. package/dist/icon/svg/content/download-filled.svg +1 -0
  141. package/dist/icon/svg/content/download.svg +1 -0
  142. package/dist/icon/svg/content/exchange.svg +1 -0
  143. package/dist/icon/svg/content/filter-filled.svg +1 -0
  144. package/dist/icon/svg/content/filter.svg +1 -0
  145. package/dist/icon/svg/content/hot-filled.svg +1 -0
  146. package/dist/icon/svg/content/hot.svg +1 -0
  147. package/dist/icon/svg/content/link.svg +1 -0
  148. package/dist/icon/svg/content/location.svg +1 -0
  149. package/dist/icon/svg/content/maxSize.svg +1 -0
  150. package/dist/icon/svg/content/mobile-filled.svg +1 -0
  151. package/dist/icon/svg/content/mobile.svg +1 -0
  152. package/dist/icon/svg/content/mute.svg +1 -0
  153. package/dist/icon/svg/content/mutiImage-filled.svg +1 -0
  154. package/dist/icon/svg/content/mutiImage.svg +1 -0
  155. package/dist/icon/svg/content/refresh.svg +1 -0
  156. package/dist/icon/svg/content/report.svg +1 -0
  157. package/dist/icon/svg/content/save.svg +1 -0
  158. package/dist/icon/svg/content/search-bold.svg +1 -0
  159. package/dist/icon/svg/content/search-filled.svg +1 -0
  160. package/dist/icon/svg/content/search.svg +1 -0
  161. package/dist/icon/svg/content/setting.svg +1 -0
  162. package/dist/icon/svg/content/share.svg +1 -0
  163. package/dist/icon/svg/content/sort.svg +1 -0
  164. package/dist/icon/svg/content/sound.svg +1 -0
  165. package/dist/icon/svg/content/sticker-filled.svg +1 -0
  166. package/dist/icon/svg/content/sticker.svg +1 -0
  167. package/dist/icon/svg/content/tag-filled.svg +1 -0
  168. package/dist/icon/svg/content/tag.svg +1 -0
  169. package/dist/icon/svg/content/thumbDown-filled.svg +1 -0
  170. package/dist/icon/svg/content/thumbDown.svg +1 -0
  171. package/dist/icon/svg/content/thumbUp-filled.svg +1 -0
  172. package/dist/icon/svg/content/thumbUp.svg +1 -0
  173. package/dist/icon/svg/content/time-bold.svg +1 -0
  174. package/dist/icon/svg/content/time.svg +1 -0
  175. package/dist/icon/svg/content/verify.svg +1 -0
  176. package/dist/icon/svg/content/video.svg +1 -0
  177. package/dist/icon/svg/content/videoScreenshot.svg +1 -0
  178. package/dist/icon/svg/content/zoomIn.svg +1 -0
  179. package/dist/icon/svg/content/zoomOut.svg +1 -0
  180. package/dist/icon/svg/data/compare.svg +1 -0
  181. package/dist/icon/svg/data/histogram.svg +1 -0
  182. package/dist/icon/svg/editor/cancel-circle-filled.svg +1 -0
  183. package/dist/icon/svg/editor/cancel-circle.svg +1 -0
  184. package/dist/icon/svg/editor/cancel.svg +1 -0
  185. package/dist/icon/svg/editor/check-circle-filled.svg +1 -0
  186. package/dist/icon/svg/editor/check-circle.svg +1 -0
  187. package/dist/icon/svg/editor/check.svg +1 -0
  188. package/dist/icon/svg/editor/copy.svg +1 -0
  189. package/dist/icon/svg/editor/custom-filled.svg +1 -0
  190. package/dist/icon/svg/editor/custom.svg +1 -0
  191. package/dist/icon/svg/editor/delete.svg +1 -0
  192. package/dist/icon/svg/editor/deleteAD-filled.svg +1 -0
  193. package/dist/icon/svg/editor/draggable.svg +1 -0
  194. package/dist/icon/svg/editor/edit.svg +1 -0
  195. package/dist/icon/svg/editor/import.svg +1 -0
  196. package/dist/icon/svg/editor/minus-circle-filled.svg +1 -0
  197. package/dist/icon/svg/editor/minus-circle.svg +1 -0
  198. package/dist/icon/svg/editor/minus.svg +1 -0
  199. package/dist/icon/svg/editor/modify-bold.svg +1 -0
  200. package/dist/icon/svg/editor/modify.svg +1 -0
  201. package/dist/icon/svg/editor/multiCreate.svg +1 -0
  202. package/dist/icon/svg/editor/mutiSelect-filled.svg +1 -0
  203. package/dist/icon/svg/editor/mutiSelect.svg +1 -0
  204. package/dist/icon/svg/editor/pause-filled.svg +1 -0
  205. package/dist/icon/svg/editor/play-filled.svg +1 -0
  206. package/dist/icon/svg/editor/plus-circle-filled.svg +1 -0
  207. package/dist/icon/svg/editor/plus-circle.svg +1 -0
  208. package/dist/icon/svg/editor/plus.svg +1 -0
  209. package/dist/icon/svg/editor/send.svg +1 -0
  210. package/dist/icon/svg/editor/subdivide.svg +1 -0
  211. package/dist/icon/svg/navigation/arrowDown-filled.svg +1 -0
  212. package/dist/icon/svg/navigation/arrowDown.svg +1 -0
  213. package/dist/icon/svg/navigation/arrowLeft-filled.svg +1 -0
  214. package/dist/icon/svg/navigation/arrowLeft.svg +1 -0
  215. package/dist/icon/svg/navigation/arrowRight-filled.svg +1 -0
  216. package/dist/icon/svg/navigation/arrowRight.svg +1 -0
  217. package/dist/icon/svg/navigation/arrowUp-filled.svg +1 -0
  218. package/dist/icon/svg/navigation/arrowUp.svg +1 -0
  219. package/dist/icon/svg/navigation/bottom-filled.svg +1 -0
  220. package/dist/icon/svg/navigation/bottom.svg +1 -0
  221. package/dist/icon/svg/navigation/doubleLeft-filled.svg +1 -0
  222. package/dist/icon/svg/navigation/doubleLeft.svg +1 -0
  223. package/dist/icon/svg/navigation/doubleRight-filled.svg +1 -0
  224. package/dist/icon/svg/navigation/doubleRight.svg +1 -0
  225. package/dist/icon/svg/navigation/down-bold.svg +1 -0
  226. package/dist/icon/svg/navigation/down-filled.svg +1 -0
  227. package/dist/icon/svg/navigation/down.svg +1 -0
  228. package/dist/icon/svg/navigation/fall-filled.svg +1 -0
  229. package/dist/icon/svg/navigation/fold.svg +1 -0
  230. package/dist/icon/svg/navigation/fullScreen.svg +1 -0
  231. package/dist/icon/svg/navigation/left-bold.svg +1 -0
  232. package/dist/icon/svg/navigation/left-filled.svg +1 -0
  233. package/dist/icon/svg/navigation/left.svg +1 -0
  234. package/dist/icon/svg/navigation/leftFirst-filled.svg +1 -0
  235. package/dist/icon/svg/navigation/leftFirst.svg +1 -0
  236. package/dist/icon/svg/navigation/logout.svg +1 -0
  237. package/dist/icon/svg/navigation/menu.svg +1 -0
  238. package/dist/icon/svg/navigation/menuLeft-bold.svg +1 -0
  239. package/dist/icon/svg/navigation/menuLeft.svg +1 -0
  240. package/dist/icon/svg/navigation/menuRight-bold.svg +1 -0
  241. package/dist/icon/svg/navigation/menuRight.svg +1 -0
  242. package/dist/icon/svg/navigation/more-vertical.svg +1 -0
  243. package/dist/icon/svg/navigation/more.svg +1 -0
  244. package/dist/icon/svg/navigation/pointerLeft-filled.svg +1 -0
  245. package/dist/icon/svg/navigation/pointerRight-filled.svg +1 -0
  246. package/dist/icon/svg/navigation/right-bold.svg +1 -0
  247. package/dist/icon/svg/navigation/right-filled.svg +1 -0
  248. package/dist/icon/svg/navigation/right.svg +1 -0
  249. package/dist/icon/svg/navigation/rightLast-filled.svg +1 -0
  250. package/dist/icon/svg/navigation/rightLast.svg +1 -0
  251. package/dist/icon/svg/navigation/rise-filled.svg +1 -0
  252. package/dist/icon/svg/navigation/top-filled.svg +1 -0
  253. package/dist/icon/svg/navigation/top.svg +1 -0
  254. package/dist/icon/svg/navigation/unfold-filled.svg +1 -0
  255. package/dist/icon/svg/navigation/unfold.svg +1 -0
  256. package/dist/icon/svg/navigation/up-bold.svg +1 -0
  257. package/dist/icon/svg/navigation/up-filled.svg +1 -0
  258. package/dist/icon/svg/navigation/up.svg +1 -0
  259. package/dist/icon/svg/product/AIFile.svg +1 -0
  260. package/dist/icon/svg/product/LandingPage.svg +1 -0
  261. package/dist/icon/svg/product/addressBook.svg +1 -0
  262. package/dist/icon/svg/product/alarmClock.svg +1 -0
  263. package/dist/icon/svg/product/asset-square.svg +1 -0
  264. package/dist/icon/svg/product/assetProtecting.svg +1 -0
  265. package/dist/icon/svg/product/autoAD-square-filled.svg +1 -0
  266. package/dist/icon/svg/product/channels-square-filled.svg +1 -0
  267. package/dist/icon/svg/product/channels.svg +1 -0
  268. package/dist/icon/svg/product/chatBubble-filled.svg +1 -0
  269. package/dist/icon/svg/product/checkBadge.svg +1 -0
  270. package/dist/icon/svg/product/comments.svg +1 -0
  271. package/dist/icon/svg/product/container.svg +1 -0
  272. package/dist/icon/svg/product/dataAuth.svg +1 -0
  273. package/dist/icon/svg/product/dataBoard.svg +1 -0
  274. package/dist/icon/svg/product/dataBox.svg +1 -0
  275. package/dist/icon/svg/product/dataFolder.svg +1 -0
  276. package/dist/icon/svg/product/dataRising.svg +1 -0
  277. package/dist/icon/svg/product/detect.svg +1 -0
  278. package/dist/icon/svg/product/exposure-filled.svg +1 -0
  279. package/dist/icon/svg/product/extendedConfig.svg +1 -0
  280. package/dist/icon/svg/product/file-filled.svg +1 -0
  281. package/dist/icon/svg/product/flag.svg +1 -0
  282. package/dist/icon/svg/product/folderZip.svg +1 -0
  283. package/dist/icon/svg/product/folderzip-bold.svg +1 -0
  284. package/dist/icon/svg/product/guideBook.svg +1 -0
  285. package/dist/icon/svg/product/hosting.svg +1 -0
  286. package/dist/icon/svg/product/icon-outlined.svg +1 -0
  287. package/dist/icon/svg/product/idea-bold.svg +1 -0
  288. package/dist/icon/svg/product/idea.svg +1 -0
  289. package/dist/icon/svg/product/image-bold.svg +1 -0
  290. package/dist/icon/svg/product/image-filled.svg +1 -0
  291. package/dist/icon/svg/product/image.svg +1 -0
  292. package/dist/icon/svg/product/images.svg +1 -0
  293. package/dist/icon/svg/product/keyword.svg +1 -0
  294. package/dist/icon/svg/product/linkSquare.svg +1 -0
  295. package/dist/icon/svg/product/lock.svg +1 -0
  296. package/dist/icon/svg/product/magic-filled.svg +1 -0
  297. package/dist/icon/svg/product/magic.svg +1 -0
  298. package/dist/icon/svg/product/miniProgram.svg +1 -0
  299. package/dist/icon/svg/product/minigame-filled.svg +1 -0
  300. package/dist/icon/svg/product/mobilePage.svg +1 -0
  301. package/dist/icon/svg/product/moments-filled.svg +1 -0
  302. package/dist/icon/svg/product/notepad-bold.svg +1 -0
  303. package/dist/icon/svg/product/notepad.svg +1 -0
  304. package/dist/icon/svg/product/offiaccount-filled.svg +1 -0
  305. package/dist/icon/svg/product/playing.svg +1 -0
  306. package/dist/icon/svg/product/qualification.svg +1 -0
  307. package/dist/icon/svg/product/quickFile.svg +1 -0
  308. package/dist/icon/svg/product/ringStruckture.svg +1 -0
  309. package/dist/icon/svg/product/searchAD-filled.svg +1 -0
  310. package/dist/icon/svg/product/searchAD.svg +1 -0
  311. package/dist/icon/svg/product/shield-filled.svg +1 -0
  312. package/dist/icon/svg/product/shield.svg +1 -0
  313. package/dist/icon/svg/product/shop.svg +1 -0
  314. package/dist/icon/svg/product/shopping.svg +1 -0
  315. package/dist/icon/svg/product/star-filled.svg +1 -0
  316. package/dist/icon/svg/product/star.svg +1 -0
  317. package/dist/icon/svg/product/support-bold.svg +1 -0
  318. package/dist/icon/svg/product/target.svg +1 -0
  319. package/dist/icon/svg/product/targeting.svg +1 -0
  320. package/dist/icon/svg/product/task-filled.svg +1 -0
  321. package/dist/icon/svg/product/task.svg +1 -0
  322. package/dist/icon/svg/product/template.svg +1 -0
  323. package/dist/icon/svg/product/templateBag.svg +1 -0
  324. package/dist/icon/svg/product/text.svg +1 -0
  325. package/dist/icon/svg/product/treeStructure.svg +1 -0
  326. package/dist/icon/svg/product/user-circle.svg +1 -0
  327. package/dist/icon/svg/product/userList.svg +1 -0
  328. package/dist/icon/svg/product/userPack.svg +1 -0
  329. package/dist/icon/svg/product/users-bold.svg +1 -0
  330. package/dist/icon/svg/product/users.svg +1 -0
  331. package/dist/icon/svg/product/videoBag-filled.svg +1 -0
  332. package/dist/icon/svg/product/viewMask.svg +1 -0
  333. package/dist/icon/svg/product/wallet.svg +1 -0
  334. package/dist/icon/svg/product/wechatBubble-filled.svg +1 -0
  335. package/dist/icon/svg/product/wechatBubble.svg +1 -0
  336. package/dist/icon/svg/product/wechatSearch.svg +1 -0
  337. package/dist/icon/svg/product/writing.svg +1 -0
  338. package/dist/icon/svg-data.d.ts +221 -0
  339. package/dist/icon/svg-data.js +224 -0
  340. package/dist/icon/test-icons.html +122 -0
  341. package/dist/icon/types.d.ts +3 -0
  342. package/dist/icon/types.js +10 -0
  343. package/dist/index.d.ts +43 -0
  344. package/dist/index.js +46 -0
  345. package/dist/input/index.d.ts +80 -0
  346. package/dist/input/index.js +437 -0
  347. package/dist/input/style/index.css +256 -0
  348. package/dist/input/style/index.d.ts +2 -0
  349. package/dist/input/style/index.js +2 -0
  350. package/dist/input-number/index.d.ts +36 -0
  351. package/dist/input-number/index.js +429 -0
  352. package/dist/input-number/style/index.css +70 -0
  353. package/dist/input-number/style/index.d.ts +2 -0
  354. package/dist/input-number/style/index.js +2 -0
  355. package/dist/input-otp/index.d.ts +71 -0
  356. package/dist/input-otp/index.js +87 -0
  357. package/dist/input-otp/style/index.css +114 -0
  358. package/dist/input-otp/style/index.d.ts +2 -0
  359. package/dist/input-otp/style/index.js +2 -0
  360. package/dist/message/MessageBase.d.ts +86 -0
  361. package/dist/message/MessageBase.js +395 -0
  362. package/dist/message/MessageReact16.d.ts +2 -0
  363. package/dist/message/MessageReact16.js +86 -0
  364. package/dist/message/MessageReact18.d.ts +2 -0
  365. package/dist/message/MessageReact18.js +98 -0
  366. package/dist/message/index.d.ts +3 -0
  367. package/dist/message/index.js +7 -0
  368. package/dist/message/style/index.css +133 -0
  369. package/dist/message/style/index.d.ts +2 -0
  370. package/dist/message/style/index.js +2 -0
  371. package/dist/modal-base/gap.d.ts +14 -0
  372. package/dist/modal-base/gap.js +31 -0
  373. package/dist/modal-base/index.d.ts +26 -0
  374. package/dist/modal-base/index.js +110 -0
  375. package/dist/number-flow/index.d.ts +13 -0
  376. package/dist/number-flow/index.js +25 -0
  377. package/dist/number-flow/style/index.css +0 -0
  378. package/dist/number-flow/style/index.d.ts +2 -0
  379. package/dist/number-flow/style/index.js +2 -0
  380. package/dist/pagination/index.d.ts +38 -0
  381. package/dist/pagination/index.js +349 -0
  382. package/dist/pagination/style/index.css +128 -0
  383. package/dist/pagination/style/index.d.ts +2 -0
  384. package/dist/pagination/style/index.js +2 -0
  385. package/dist/pop-base/index.d.ts +123 -0
  386. package/dist/pop-base/index.js +349 -0
  387. package/dist/pop-base/mergeProps.d.ts +37 -0
  388. package/dist/pop-base/mergeProps.js +144 -0
  389. package/dist/pop-base/style/index.css +150 -0
  390. package/dist/pop-base/style/index.d.ts +2 -0
  391. package/dist/pop-base/style/index.js +2 -0
  392. package/dist/pop-base/useForkRef.d.ts +5 -0
  393. package/dist/pop-base/useForkRef.js +52 -0
  394. package/dist/popover/index.d.ts +4 -0
  395. package/dist/popover/index.js +9 -0
  396. package/dist/radio/index.d.ts +21 -0
  397. package/dist/radio/index.js +45 -0
  398. package/dist/radio/primitive.d.ts +5 -0
  399. package/dist/radio/primitive.js +28 -0
  400. package/dist/radio/style/index.css +219 -0
  401. package/dist/radio/style/index.d.ts +2 -0
  402. package/dist/radio/style/index.js +2 -0
  403. package/dist/scroll-area/index.d.ts +24 -0
  404. package/dist/scroll-area/index.js +96 -0
  405. package/dist/scroll-area/style/index.css +77 -0
  406. package/dist/scroll-area/style/index.d.ts +2 -0
  407. package/dist/scroll-area/style/index.js +2 -0
  408. package/dist/select/index.d.ts +85 -0
  409. package/dist/select/index.js +262 -0
  410. package/dist/select/style/index.css +1736 -0
  411. package/dist/select/style/index.d.ts +2 -0
  412. package/dist/select/style/index.js +2 -0
  413. package/dist/select/useIcons.d.ts +25 -0
  414. package/dist/select/useIcons.js +80 -0
  415. package/dist/slider/index.d.ts +69 -0
  416. package/dist/slider/index.js +264 -0
  417. package/dist/slider/style/index.css +237 -0
  418. package/dist/slider/style/index.d.ts +2 -0
  419. package/dist/slider/style/index.js +2 -0
  420. package/dist/style/base.css +298 -0
  421. package/dist/style/index.d.ts +6 -0
  422. package/dist/style/index.js +17 -0
  423. package/dist/switch/index.d.ts +12 -0
  424. package/dist/switch/index.js +55 -0
  425. package/dist/switch/style/index.css +152 -0
  426. package/dist/switch/style/index.d.ts +2 -0
  427. package/dist/switch/style/index.js +2 -0
  428. package/dist/table/TableCellContent.d.ts +20 -0
  429. package/dist/table/TableCellContent.js +77 -0
  430. package/dist/table/index.d.ts +97 -0
  431. package/dist/table/index.js +791 -0
  432. package/dist/table/style/index.css +320 -0
  433. package/dist/table/style/index.d.ts +2 -0
  434. package/dist/table/style/index.js +2 -0
  435. package/dist/table/useSelection.d.ts +13 -0
  436. package/dist/table/useSelection.js +259 -0
  437. package/dist/tabs/index.d.ts +51 -0
  438. package/dist/tabs/index.js +617 -0
  439. package/dist/tabs/style/index.css +369 -0
  440. package/dist/tabs/style/index.d.ts +2 -0
  441. package/dist/tabs/style/index.js +2 -0
  442. package/dist/text-swap/index.d.ts +58 -0
  443. package/dist/text-swap/index.js +280 -0
  444. package/dist/text-swap/style/index.css +32 -0
  445. package/dist/text-swap/style/index.d.ts +2 -0
  446. package/dist/text-swap/style/index.js +2 -0
  447. package/dist/time-picker/index.d.ts +67 -0
  448. package/dist/time-picker/index.js +945 -0
  449. package/dist/time-picker/style/index.css +166 -0
  450. package/dist/time-picker/style/index.d.ts +2 -0
  451. package/dist/time-picker/style/index.js +2 -0
  452. package/dist/tooltip/index.d.ts +10 -0
  453. package/dist/tooltip/index.js +178 -0
  454. package/dist/tree-select/index.d.ts +25 -0
  455. package/dist/tree-select/index.js +140 -0
  456. package/dist/tree-select/style/index.css +204 -0
  457. package/dist/tree-select/style/index.d.ts +1 -0
  458. package/dist/tree-select/style/index.js +1 -0
  459. package/package.json +124 -0
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import './style';
3
+ export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ /**
5
+ * @description 当前页码
6
+ * @default 1
7
+ */
8
+ value?: number;
9
+ /**
10
+ * @description 总条数
11
+ */
12
+ totalSize: number;
13
+ /**
14
+ * @description 每页条数
15
+ * @default 10
16
+ */
17
+ pageSize?: number;
18
+ /**
19
+ * @description 页码变化时的回调
20
+ */
21
+ onChange?: (e: React.MouseEvent<HTMLDivElement>, value: number, pageSize: number) => void;
22
+ /**
23
+ * @description 每页条数变化时的回调
24
+ */
25
+ onPageSizeChange?: (newPageSize: number, pageSize: number) => void;
26
+ /**
27
+ * @description 是否显示上一页和下一页
28
+ * @default true
29
+ */
30
+ showPrevNext?: boolean;
31
+ /**
32
+ * @description 类型
33
+ * @default 'default'
34
+ */
35
+ type?: 'default' | 'simple';
36
+ }
37
+ declare const Pagination: React.FC<PaginationProps>;
38
+ export default Pagination;
@@ -0,0 +1,349 @@
1
+ var _excluded = ["value", "totalSize", "pageSize", "onChange", "onPageSizeChange", "onMouseEnter", "onMouseLeave", "showPrevNext", "type"];
2
+ 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); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ 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); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ import React, { useEffect, useRef } from 'react';
12
+ import "./style";
13
+ var range = function range(start, end) {
14
+ var length = end - start + 1;
15
+ return Array.from({
16
+ length: length
17
+ }, function (_, i) {
18
+ return start + i;
19
+ });
20
+ };
21
+ var Pagination = function Pagination(_ref) {
22
+ var _ref$value = _ref.value,
23
+ value = _ref$value === void 0 ? 1 : _ref$value,
24
+ totalSize = _ref.totalSize,
25
+ _ref$pageSize = _ref.pageSize,
26
+ pageSize = _ref$pageSize === void 0 ? 10 : _ref$pageSize,
27
+ onChange = _ref.onChange,
28
+ onPageSizeChange = _ref.onPageSizeChange,
29
+ onMouseEnter = _ref.onMouseEnter,
30
+ onMouseLeave = _ref.onMouseLeave,
31
+ _ref$showPrevNext = _ref.showPrevNext,
32
+ showPrevNext = _ref$showPrevNext === void 0 ? true : _ref$showPrevNext,
33
+ _ref$type = _ref.type,
34
+ type = _ref$type === void 0 ? 'default' : _ref$type,
35
+ props = _objectWithoutProperties(_ref, _excluded);
36
+ var hoverFillRef = useRef(null);
37
+ var hoverFillBgRef = useRef(null);
38
+ var activeIndicatorRef = useRef(null);
39
+ var containerRef = useRef(null);
40
+ var hoverFillVisibleRef = useRef(false);
41
+ var itemLeaveTimer = useRef(0);
42
+ var pageNumber = Math.ceil(totalSize / pageSize);
43
+ var isPrevDisabled = value === 1 && type === 'default';
44
+ var isNextDisabled = value === pageNumber && type === 'default';
45
+ var handleItemMouseEnter = function handleItemMouseEnter(e) {
46
+ e.persist();
47
+ clearTimeout(itemLeaveTimer.current);
48
+ if (!hoverFillBgRef.current || !hoverFillRef.current) {
49
+ return;
50
+ }
51
+ hoverFillRef.current.style.left = "".concat(e.currentTarget.offsetLeft, "px");
52
+ hoverFillBgRef.current.style.transform = 'scale(1)';
53
+ hoverFillBgRef.current.style.background = 'rgba(33, 34, 38, 0.05)';
54
+ if (!hoverFillVisibleRef.current) {
55
+ hoverFillVisibleRef.current = true;
56
+ hoverFillRef.current.style.transitionDuration = '0s';
57
+ var clientX = e.clientX,
58
+ clientY = e.clientY;
59
+ var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
60
+ x = _e$currentTarget$getB.x,
61
+ y = _e$currentTarget$getB.y;
62
+ hoverFillBgRef.current.style.transformOrigin = "".concat(clientX - x, "px ").concat(clientY - y, "px");
63
+ } else {
64
+ hoverFillRef.current.style.transitionDuration = 'var(--odn-hoverfill-duration)';
65
+ }
66
+ };
67
+ var handleItemMouseLeave = function handleItemMouseLeave(e) {
68
+ e.persist();
69
+ clearTimeout(itemLeaveTimer.current);
70
+ if (!hoverFillBgRef.current || !hoverFillRef.current) {
71
+ return;
72
+ }
73
+ var clientX = e.clientX,
74
+ clientY = e.clientY;
75
+ var _e$currentTarget$getB2 = e.currentTarget.getBoundingClientRect(),
76
+ x = _e$currentTarget$getB2.x,
77
+ y = _e$currentTarget$getB2.y;
78
+ itemLeaveTimer.current = window.setTimeout(function () {
79
+ hoverFillVisibleRef.current = false;
80
+ if (hoverFillBgRef.current) {
81
+ hoverFillBgRef.current.style.transformOrigin = "".concat(clientX - x, "px ").concat(clientY - y, "px");
82
+ hoverFillBgRef.current.style.transform = 'scale(0.92)';
83
+ hoverFillBgRef.current.style.background = 'rgba(33, 34, 38, 0)';
84
+ }
85
+ }, 100);
86
+ };
87
+ var rePosition = function rePosition() {
88
+ setTimeout(function () {
89
+ if (!activeIndicatorRef.current || !containerRef.current || !hoverFillRef.current) {
90
+ return;
91
+ }
92
+ var currentEl = containerRef.current.querySelector("[data-odn-pagination-item-page='".concat(value, "']"));
93
+ if (!currentEl) {
94
+ // 可能改变了 pageSize 后导致 value 超出范围,这时隐藏 activeIndicator
95
+ activeIndicatorRef.current.style.opacity = '0';
96
+ } else {
97
+ activeIndicatorRef.current.style.transform = "translate3d(".concat(currentEl.offsetLeft, "px, 0, 0)");
98
+ activeIndicatorRef.current.style.opacity = '1';
99
+
100
+ // 当 value 为 1 时,hoverFill 这时可能处于 0 的位置,但按钮已 disabled,这时需将 hoverFill 隐藏;尾页同理
101
+ if (hoverFillBgRef.current && (value === 1 && hoverFillRef.current.offsetLeft === 0 || value === pageNumber && hoverFillRef.current.offsetLeft + hoverFillRef.current.offsetWidth >= containerRef.current.offsetWidth)) {
102
+ hoverFillBgRef.current.style.background = 'rgba(33, 34, 38, 0)';
103
+ }
104
+ }
105
+ }, 0);
106
+ };
107
+ useEffect(function () {
108
+ rePosition();
109
+ }, [value, pageNumber, showPrevNext]);
110
+ useEffect(function () {
111
+ var resizeObserver = new ResizeObserver(function () {
112
+ rePosition();
113
+ });
114
+ if (containerRef.current) {
115
+ resizeObserver.observe(containerRef.current);
116
+ }
117
+ return function () {
118
+ resizeObserver.disconnect();
119
+ };
120
+ }, []);
121
+ var boundaryCount = 1;
122
+ var siblingCount = 1;
123
+ var startPages = range(1, Math.min(boundaryCount, pageNumber));
124
+ var endPages = range(Math.max(pageNumber - boundaryCount + 1, boundaryCount + 1), pageNumber);
125
+ var siblingsStart = Math.max(Math.min(
126
+ // Natural start
127
+ value - siblingCount,
128
+ // Lower boundary when page is high
129
+ pageNumber - boundaryCount - siblingCount * 2 - 1),
130
+ // Greater than startPages
131
+ boundaryCount + 2);
132
+ var siblingsEnd = Math.min(Math.max(
133
+ // Natural end
134
+ value + siblingCount,
135
+ // Upper boundary when page is low
136
+ boundaryCount + siblingCount * 2 + 2),
137
+ // Less than endPages
138
+ pageNumber - boundaryCount - 1);
139
+ var itemList = [].concat(_toConsumableArray(showPrevNext && pageNumber > 1 ? ['previous'] : []), _toConsumableArray(startPages), _toConsumableArray(siblingsStart > boundaryCount + 2 ? ['start-ellipsis'] : boundaryCount + 1 < pageNumber - boundaryCount ? [boundaryCount + 1] : []), _toConsumableArray(range(siblingsStart, siblingsEnd)), _toConsumableArray(siblingsEnd < pageNumber - boundaryCount - 1 ? ['end-ellipsis'] : pageNumber - boundaryCount > boundaryCount ? [pageNumber - boundaryCount] : []), _toConsumableArray(endPages), _toConsumableArray(showPrevNext && pageNumber > 1 ? ['next'] : []));
140
+ var firstButton = /*#__PURE__*/React.createElement("div", {
141
+ "data-odn-pagination-item": true,
142
+ "data-odn-pagination-item-first": true,
143
+ onMouseEnter: function onMouseEnter(e) {
144
+ handleItemMouseEnter(e);
145
+ },
146
+ onMouseLeave: function onMouseLeave(e) {
147
+ handleItemMouseLeave(e);
148
+ },
149
+ onClick: function onClick(e) {
150
+ if (!isPrevDisabled) {
151
+ onChange === null || onChange === void 0 || onChange(e, 1, pageSize);
152
+ }
153
+ }
154
+ }, /*#__PURE__*/React.createElement("svg", {
155
+ width: "16",
156
+ height: "16",
157
+ viewBox: "0 0 16 16"
158
+ }, /*#__PURE__*/React.createElement("path", {
159
+ d: "M11.0114 12.9829C11.1091 13.0805 11.2674 13.0805 11.365 12.9829L11.9307 12.4172C12.0283 12.3196 12.0283 12.1613 11.9307 12.0636L7.86481 7.99778L11.9307 3.93192C12.0283 3.83428 12.0283 3.67599 11.9307 3.57836L11.365 3.01268C11.2674 2.91505 11.1091 2.91505 11.0114 3.01268L6.20311 7.821C6.10547 7.91863 6.10548 8.07692 6.20311 8.17456L11.0114 12.9829Z",
160
+ fill: "currentColor"
161
+ }), /*#__PURE__*/React.createElement("path", {
162
+ d: "M4.25 2.99966C4.11193 2.99966 4 3.11159 4 3.24966V12.7497C4 12.8877 4.11193 12.9997 4.25 12.9997H4.95C5.08807 12.9997 5.2 12.8877 5.2 12.7497V3.24966C5.2 3.11159 5.08807 2.99966 4.95 2.99966H4.25Z",
163
+ fill: "currentColor"
164
+ })));
165
+ var prevButton = /*#__PURE__*/React.createElement("div", {
166
+ "data-odn-pagination-item": true,
167
+ "data-odn-pagination-item-prev": true,
168
+ "data-odn-pagination-item-disabled": isPrevDisabled,
169
+ onMouseEnter: function onMouseEnter(e) {
170
+ if (isPrevDisabled) {
171
+ return;
172
+ }
173
+ handleItemMouseEnter(e);
174
+ },
175
+ onMouseLeave: function onMouseLeave(e) {
176
+ if (isPrevDisabled) {
177
+ return;
178
+ }
179
+ handleItemMouseLeave(e);
180
+ },
181
+ onClick: function onClick(e) {
182
+ if (!isPrevDisabled) {
183
+ onChange === null || onChange === void 0 || onChange(e, Math.max(1, value - 1), pageSize);
184
+ }
185
+ }
186
+ }, /*#__PURE__*/React.createElement("svg", {
187
+ width: "16",
188
+ height: "16",
189
+ viewBox: "0 0 16 16"
190
+ }, /*#__PURE__*/React.createElement("path", {
191
+ fill: "currentColor",
192
+ fillRule: "evenodd",
193
+ clipRule: "evenodd",
194
+ d: "M9.677 12.9832C9.57937 13.0808 9.42107 13.0808 9.32344 12.9832L4.51512 8.17489C4.41749 8.07726 4.41749 7.91897 4.51512 7.82134L9.32344 3.01301C9.42107 2.91538 9.57937 2.91538 9.677 3.01301L10.2427 3.5787C10.3403 3.67633 10.3403 3.83462 10.2427 3.93225L6.17682 7.99812L10.2427 12.064C10.3403 12.1616 10.3403 12.3199 10.2427 12.4175L9.677 12.9832Z"
195
+ })));
196
+ var nextButton = /*#__PURE__*/React.createElement("div", {
197
+ "data-odn-pagination-item": true,
198
+ "data-odn-pagination-item-next": true,
199
+ "data-odn-pagination-item-disabled": isNextDisabled,
200
+ onMouseEnter: function onMouseEnter(e) {
201
+ if (isNextDisabled) {
202
+ return;
203
+ }
204
+ handleItemMouseEnter(e);
205
+ },
206
+ onMouseLeave: function onMouseLeave(e) {
207
+ if (isNextDisabled) {
208
+ return;
209
+ }
210
+ handleItemMouseLeave(e);
211
+ },
212
+ onClick: function onClick(e) {
213
+ if (!isNextDisabled) {
214
+ onChange === null || onChange === void 0 || onChange(e, Math.min(pageNumber, value + 1), pageSize);
215
+ }
216
+ }
217
+ }, /*#__PURE__*/React.createElement("svg", {
218
+ width: "16",
219
+ height: "16",
220
+ viewBox: "0 0 16 16"
221
+ }, /*#__PURE__*/React.createElement("path", {
222
+ fill: "currentColor",
223
+ fillRule: "evenodd",
224
+ clipRule: "evenodd",
225
+ d: "M6.32299 3.01677C6.42062 2.91913 6.57891 2.91913 6.67654 3.01677L11.4849 7.82509C11.5825 7.92272 11.5825 8.08101 11.4849 8.17865L6.67654 12.987C6.57891 13.0846 6.42062 13.0846 6.32299 12.987L5.75731 12.4213C5.65967 12.3237 5.65967 12.1654 5.75731 12.0677L9.82317 8.00187L5.75731 3.936C5.65968 3.83837 5.65968 3.68008 5.75731 3.58245L6.32299 3.01677Z"
226
+ })));
227
+ var lastButton = /*#__PURE__*/React.createElement("div", {
228
+ "data-odn-pagination-item": true,
229
+ "data-odn-pagination-item-last": true,
230
+ onMouseEnter: function onMouseEnter(e) {
231
+ handleItemMouseEnter(e);
232
+ },
233
+ onMouseLeave: function onMouseLeave(e) {
234
+ handleItemMouseLeave(e);
235
+ },
236
+ onClick: function onClick(e) {
237
+ if (!isNextDisabled) {
238
+ onChange === null || onChange === void 0 || onChange(e, pageNumber, pageSize);
239
+ }
240
+ }
241
+ }, /*#__PURE__*/React.createElement("svg", {
242
+ width: "16",
243
+ height: "16",
244
+ viewBox: "0 0 16 16"
245
+ }, /*#__PURE__*/React.createElement("path", {
246
+ d: "M4.99246 3.01268C4.89483 2.91505 4.73654 2.91505 4.63891 3.01268L4.07322 3.57836C3.97559 3.67599 3.97559 3.83428 4.07322 3.93192L8.13909 7.99778L4.07322 12.0636C3.97559 12.1613 3.97559 12.3196 4.07322 12.4172L4.63891 12.9829C4.73654 13.0805 4.89483 13.0805 4.99246 12.9829L9.80079 8.17456C9.89842 8.07693 9.89842 7.91863 9.80079 7.821L4.99246 3.01268Z",
247
+ fill: "currentColor"
248
+ }), /*#__PURE__*/React.createElement("path", {
249
+ d: "M11.7539 12.9959C11.892 12.9959 12.0039 12.884 12.0039 12.7459V3.24589C12.0039 3.10782 11.892 2.99589 11.7539 2.99589L11.0539 2.99589C10.9158 2.99589 10.8039 3.10782 10.8039 3.24589L10.8039 12.7459C10.8039 12.884 10.9158 12.9959 11.0539 12.9959H11.7539Z",
250
+ fill: "currentColor"
251
+ })));
252
+ return /*#__PURE__*/React.createElement("div", _extends({
253
+ ref: containerRef,
254
+ "data-odn-pagination": true,
255
+ "data-odn-pagination-simple": type === 'simple'
256
+ }, props), /*#__PURE__*/React.createElement("i", {
257
+ "data-odn-pagination-hover-fill": true,
258
+ ref: hoverFillRef
259
+ }, /*#__PURE__*/React.createElement("i", {
260
+ "data-odn-pagination-hover-fill-bg": true,
261
+ ref: hoverFillBgRef
262
+ })), /*#__PURE__*/React.createElement("i", {
263
+ "data-odn-pagination-active-indicator": true,
264
+ ref: activeIndicatorRef
265
+ }), type === 'default' ? /*#__PURE__*/React.createElement(React.Fragment, null, itemList.map(function (item) {
266
+ if (item === 'previous') {
267
+ return /*#__PURE__*/React.createElement(React.Fragment, {
268
+ key: item
269
+ }, prevButton);
270
+ }
271
+ if (item === 'next') {
272
+ return /*#__PURE__*/React.createElement(React.Fragment, {
273
+ key: item
274
+ }, nextButton);
275
+ }
276
+ if (item === 'start-ellipsis' || item === 'end-ellipsis') {
277
+ return /*#__PURE__*/React.createElement("div", {
278
+ key: item,
279
+ "data-odn-pagination-item": true,
280
+ "data-odn-pagination-item-ellipsis": true,
281
+ onMouseEnter: handleItemMouseEnter,
282
+ onMouseLeave: handleItemMouseLeave,
283
+ onClick: function onClick(e) {
284
+ onChange === null || onChange === void 0 || onChange(e, Math.min(Math.max(1, item === 'start-ellipsis' ? value - 5 : value + 5), pageNumber), pageSize);
285
+ }
286
+ }, /*#__PURE__*/React.createElement("svg", {
287
+ width: "16",
288
+ height: "16",
289
+ viewBox: "0 0 16 16",
290
+ fill: "currentColor",
291
+ "data-odn-pagination-item-ellipsis-icon": true
292
+ }, /*#__PURE__*/React.createElement("path", {
293
+ d: "M4.00312 8.0002C4.00312 8.55248 3.55541 9.0002 3.00313 9.0002C2.45084 9.0002 2.00313 8.55248 2.00313 8.0002C2.00313 7.44791 2.45084 7.0002 3.00313 7.0002C3.55541 7.0002 4.00312 7.44791 4.00312 8.0002Z"
294
+ }), /*#__PURE__*/React.createElement("path", {
295
+ fillRule: "evenodd",
296
+ clipRule: "evenodd",
297
+ d: "M4.30312 8.0002C4.30312 8.71817 3.7211 9.3002 3.00313 9.3002C2.28516 9.3002 1.70312 8.71817 1.70312 8.0002C1.70312 7.28223 2.28516 6.7002 3.00313 6.7002C3.7211 6.7002 4.30312 7.28223 4.30312 8.0002ZM3.00313 9.0002C3.55541 9.0002 4.00312 8.55248 4.00312 8.0002C4.00312 7.44791 3.55541 7.0002 3.00313 7.0002C2.45084 7.0002 2.00313 7.44791 2.00313 8.0002C2.00313 8.55248 2.45084 9.0002 3.00313 9.0002Z"
298
+ }), /*#__PURE__*/React.createElement("path", {
299
+ d: "M9.00313 8.0002C9.00313 8.55248 8.55541 9.0002 8.00313 9.0002C7.45084 9.0002 7.00312 8.55248 7.00312 8.0002C7.00312 7.44791 7.45084 7.0002 8.00313 7.0002C8.55541 7.0002 9.00313 7.44791 9.00313 8.0002Z"
300
+ }), /*#__PURE__*/React.createElement("path", {
301
+ fillRule: "evenodd",
302
+ clipRule: "evenodd",
303
+ d: "M9.30313 8.0002C9.30313 8.71817 8.7211 9.3002 8.00313 9.3002C7.28515 9.3002 6.70312 8.71817 6.70312 8.0002C6.70312 7.28223 7.28515 6.7002 8.00313 6.7002C8.7211 6.7002 9.30313 7.28223 9.30313 8.0002ZM8.00313 9.0002C8.55541 9.0002 9.00313 8.55248 9.00313 8.0002C9.00313 7.44791 8.55541 7.0002 8.00313 7.0002C7.45084 7.0002 7.00312 7.44791 7.00312 8.0002C7.00312 8.55248 7.45084 9.0002 8.00313 9.0002Z"
304
+ }), /*#__PURE__*/React.createElement("path", {
305
+ d: "M14.0031 8.0002C14.0031 8.55248 13.5554 9.0002 13.0031 9.0002C12.4508 9.0002 12.0031 8.55248 12.0031 8.0002C12.0031 7.44791 12.4508 7.0002 13.0031 7.0002C13.5554 7.0002 14.0031 7.44791 14.0031 8.0002Z"
306
+ }), /*#__PURE__*/React.createElement("path", {
307
+ fillRule: "evenodd",
308
+ clipRule: "evenodd",
309
+ d: "M14.3031 8.0002C14.3031 8.71817 13.7211 9.3002 13.0031 9.3002C12.2851 9.3002 11.7031 8.71817 11.7031 8.0002C11.7031 7.28223 12.2851 6.7002 13.0031 6.7002C13.7211 6.7002 14.3031 7.28223 14.3031 8.0002ZM13.0031 9.0002C13.5554 9.0002 14.0031 8.55248 14.0031 8.0002C14.0031 7.44791 13.5554 7.0002 13.0031 7.0002C12.4508 7.0002 12.0031 7.44791 12.0031 8.0002C12.0031 8.55248 12.4508 9.0002 13.0031 9.0002Z"
310
+ })), item === 'start-ellipsis' ? /*#__PURE__*/React.createElement("svg", {
311
+ width: "16",
312
+ height: "16",
313
+ viewBox: "0 0 16 16",
314
+ fill: "currentColor",
315
+ "data-odn-pagination-item-ellipsis-icon-hover": true
316
+ }, /*#__PURE__*/React.createElement("path", {
317
+ d: "M7.77293 11.7123C7.87056 11.6147 7.87056 11.4564 7.77293 11.3587L4.41418 7.99999L7.77293 4.64123C7.87056 4.5436 7.87056 4.38531 7.77293 4.28768L7.41938 3.93412C7.32175 3.83649 7.16346 3.83649 7.06583 3.93412L3.17674 7.82321C3.07911 7.92084 3.07911 8.07913 3.17674 8.17676L7.06583 12.0659C7.16346 12.1635 7.32175 12.1635 7.41938 12.0659L7.77293 11.7123Z"
318
+ }), /*#__PURE__*/React.createElement("path", {
319
+ d: "M12.2729 11.7123C12.3706 11.6147 12.3706 11.4564 12.2729 11.3587L8.91418 7.99999L12.2729 4.64123C12.3706 4.5436 12.3706 4.38531 12.2729 4.28768L11.9194 3.93412C11.8217 3.83649 11.6635 3.83649 11.5658 3.93412L7.67674 7.82321C7.57911 7.92084 7.57911 8.07913 7.67674 8.17676L11.5658 12.0659C11.6635 12.1635 11.8217 12.1635 11.9194 12.0659L12.2729 11.7123Z"
320
+ })) : /*#__PURE__*/React.createElement("svg", {
321
+ width: "16",
322
+ height: "16",
323
+ viewBox: "0 0 16 16",
324
+ fill: "currentColor",
325
+ "data-odn-pagination-item-ellipsis-icon-hover": true
326
+ }, /*#__PURE__*/React.createElement("path", {
327
+ d: "M8.21238 4.28769C8.11475 4.38532 8.11475 4.54362 8.21238 4.64125L11.5711 8L8.21238 11.3588C8.11475 11.4564 8.11475 11.6147 8.21238 11.7123L8.56594 12.0659C8.66357 12.1635 8.82186 12.1635 8.91949 12.0659L12.8086 8.17678C12.9062 8.07915 12.9062 7.92086 12.8086 7.82323L8.91949 3.93414C8.82186 3.83651 8.66357 3.83651 8.56594 3.93414L8.21238 4.28769Z"
328
+ }), /*#__PURE__*/React.createElement("path", {
329
+ d: "M3.71238 4.28769C3.61475 4.38532 3.61475 4.54362 3.71238 4.64125L7.07114 8L3.71238 11.3588C3.61475 11.4564 3.61475 11.6147 3.71238 11.7123L4.06594 12.0659C4.16357 12.1635 4.32186 12.1635 4.41949 12.0659L8.30858 8.17678C8.40621 8.07915 8.40621 7.92086 8.30858 7.82323L4.41949 3.93414C4.32186 3.83651 4.16357 3.83651 4.06594 3.93414L3.71238 4.28769Z"
330
+ })));
331
+ }
332
+ return /*#__PURE__*/React.createElement("div", {
333
+ key: item,
334
+ "data-odn-pagination-item": true,
335
+ "data-odn-pagination-item-page": item,
336
+ "data-odn-pagination-item-active": item === value,
337
+ onMouseEnter: handleItemMouseEnter,
338
+ onMouseLeave: handleItemMouseLeave,
339
+ onClick: function onClick(e) {
340
+ if (onChange) {
341
+ onChange(e, Number(item), pageSize);
342
+ }
343
+ }
344
+ }, item);
345
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, firstButton, prevButton, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
346
+ "data-odn-pagination-simple-page-value": true
347
+ }, value), " /", ' ', pageNumber), nextButton, lastButton));
348
+ };
349
+ export default Pagination;
@@ -0,0 +1,128 @@
1
+ @charset "UTF-8";
2
+ html {
3
+ /* 按钮的间距 */
4
+ --odn-pagination-gap: 0;
5
+ /* 按钮宽度 */
6
+ --odn-pagination-item-width: 32px;
7
+ /* 按钮高度 */
8
+ --odn-pagination-item-height: 32px;
9
+ /* 按钮字体大小 */
10
+ --odn-pagination-item-font-size: 14px;
11
+ /* 按钮字重 */
12
+ --odn-pagination-item-font-weight: 400;
13
+ /* 按钮字体颜色 */
14
+ --odn-pagination-item-color: rgba(0, 0, 0, 0.95);
15
+ /* hover 背景颜色 */
16
+ --odn-pagination-item-bg-hover: #f0f0f0;
17
+ /* active 背景颜色 */
18
+ --odn-pagination-item-bg-active: #f5f8ff;
19
+ /* active 字重 */
20
+ --odn-pagination-item-font-weight-active: 600;
21
+ /* active 字体颜色 */
22
+ --odn-pagination-item-color-active: var(--odn-color-primary);
23
+ /* active 边框样式 */
24
+ --odn-pagination-item-border-active: 1px solid var(--odn-color-primary);
25
+ /* 按钮的圆角 */
26
+ --odn-pagination-item-border-radius: 6px;
27
+ }
28
+
29
+ [data-odn-pagination] {
30
+ position: relative;
31
+ display: flex;
32
+ align-items: center;
33
+ user-select: none;
34
+ gap: var(--odn-pagination-gap);
35
+ font-size: var(--odn-pagination-item-font-size);
36
+ color: var(--odn-pagination-item-color);
37
+ }
38
+
39
+ [data-odn-pagination-simple=true] {
40
+ gap: 8px;
41
+ }
42
+
43
+ [data-odn-pagination-item] {
44
+ position: relative;
45
+ z-index: 1;
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ width: var(--odn-pagination-item-width);
50
+ height: var(--odn-pagination-item-height);
51
+ cursor: pointer;
52
+ transition: color 0.25s cubic-bezier(0.32, 0.72, 0, 1);
53
+ }
54
+
55
+ [data-odn-pagination-hover-fill] {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: var(--odn-pagination-item-width);
60
+ height: var(--odn-pagination-item-height);
61
+ pointer-events: none;
62
+ transition: left 0.25s cubic-bezier(0.32, 0.72, 0, 1);
63
+ }
64
+
65
+ [data-odn-pagination-hover-fill-bg] {
66
+ position: absolute;
67
+ top: 0;
68
+ left: 0;
69
+ width: 100%;
70
+ height: 100%;
71
+ background-color: transparent;
72
+ border-radius: var(--odn-pagination-item-border-radius);
73
+ transform: scale(0.8);
74
+ transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), background 0.25s cubic-bezier(0.32, 0.72, 0, 1);
75
+ }
76
+
77
+ [data-odn-pagination-active-indicator] {
78
+ position: absolute;
79
+ top: 0;
80
+ left: 0;
81
+ width: var(--odn-pagination-item-width);
82
+ height: var(--odn-pagination-item-height);
83
+ background-color: var(--odn-pagination-item-bg-active);
84
+ border: var(--odn-pagination-item-border-active);
85
+ border-radius: var(--odn-pagination-item-border-radius);
86
+ opacity: 0;
87
+ pointer-events: none;
88
+ transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
89
+ }
90
+
91
+ [data-odn-pagination-item-active=true] {
92
+ color: var(--odn-pagination-item-color-active);
93
+ font-weight: var(--odn-pagination-item-font-weight-active);
94
+ }
95
+
96
+ [data-odn-pagination-item-disabled=true] {
97
+ cursor: not-allowed;
98
+ color: rgba(69, 80, 102, 0.25);
99
+ }
100
+
101
+ [data-odn-pagination-item-ellipsis-icon] {
102
+ transition: opacity 0.1s cubic-bezier(0.32, 0.72, 0, 1);
103
+ }
104
+
105
+ [data-odn-pagination-item-ellipsis-icon-hover] {
106
+ position: absolute;
107
+ top: 50%;
108
+ left: 50%;
109
+ transform: translate3d(-50%, -50%, 0);
110
+ opacity: 0;
111
+ transition: opacity 0.1s cubic-bezier(0.32, 0.72, 0, 1);
112
+ }
113
+
114
+ [data-odn-pagination-item-ellipsis]:hover [data-odn-pagination-item-ellipsis-icon] {
115
+ opacity: 0;
116
+ }
117
+
118
+ [data-odn-pagination-item-ellipsis]:hover [data-odn-pagination-item-ellipsis-icon-hover] {
119
+ opacity: 1;
120
+ }
121
+
122
+ [data-odn-pagination-simple-page-value] {
123
+ display: inline-block;
124
+ margin-left: -5px;
125
+ width: 15px;
126
+ text-align: right;
127
+ white-space: nowrap;
128
+ }
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.scss';
@@ -0,0 +1,2 @@
1
+ import "../../style";
2
+ import "./index.css";
@@ -0,0 +1,123 @@
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 是否使用 portal 渲染
78
+ * @default true
79
+ */
80
+ portal?: boolean;
81
+ /**
82
+ * @description 是否 shift
83
+ * @default true
84
+ */
85
+ shift?: boolean;
86
+ /**
87
+ * @description 弹窗内容大小,组件会吐出可用空间,业务方需要自行使用
88
+ */
89
+ size?: (params: {
90
+ availableWidth: number;
91
+ availableHeight: number;
92
+ }) => void;
93
+ /**
94
+ * @description 触发方式
95
+ * @default 'hover'
96
+ */
97
+ trigger?: 'hover' | 'focus' | 'click';
98
+ /**
99
+ * @description 外部控制
100
+ * @default null
101
+ */
102
+ visible?: boolean;
103
+ /**
104
+ * @description 关闭后是否销毁 dom
105
+ * @default true
106
+ */
107
+ destroyOnHidden?: boolean;
108
+ /**
109
+ * description 是否在祖先滚动时隐藏
110
+ */
111
+ hideOnAncestorScroll?: boolean;
112
+ /**
113
+ * @description z-index
114
+ */
115
+ zIndex?: number | string;
116
+ }
117
+ export declare const defaultProps: PopoverProps;
118
+ declare const PopBase: React.ForwardRefExoticComponent<PopoverProps & {
119
+ type: 'popover' | 'tooltip';
120
+ } & React.RefAttributes<{
121
+ refs: any;
122
+ }>>;
123
+ export default PopBase;