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,2 @@
1
+ import '../../style';
2
+ import './index.scss';
@@ -0,0 +1,2 @@
1
+ import "../../style";
2
+ import "./index.css";
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { InputProps, InputRef } from '../input';
3
+ import './style';
4
+ export interface InputNumberProps extends Omit<InputProps, 'value' | 'onChange'> {
5
+ /**
6
+ * @description 值
7
+ * @default undefined
8
+ */
9
+ value?: number | null;
10
+ /**
11
+ * @description 默认值
12
+ * @default undefined
13
+ */
14
+ defaultValue?: number;
15
+ /**
16
+ * @description 最小值
17
+ * @default 0
18
+ */
19
+ min?: number;
20
+ /**
21
+ * @description 最大值
22
+ * @default undefined
23
+ */
24
+ max?: number;
25
+ /**
26
+ * @description 步长
27
+ * @default 1
28
+ */
29
+ step?: number;
30
+ /**
31
+ * @description 变化时回调
32
+ */
33
+ onChange?: (value: number | null) => void;
34
+ }
35
+ declare const InputNumber: React.ForwardRefExoticComponent<Omit<InputNumberProps, "ref"> & React.RefAttributes<InputRef>>;
36
+ export default InputNumber;
@@ -0,0 +1,429 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["value", "defaultValue", "min", "max", "step", "onChange", "onBlur", "disabled", "light"];
3
+ 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); }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ 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); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ 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."); }
11
+ 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); }
12
+ 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; }
13
+ 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; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+ 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; }
16
+ 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; }
17
+ import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
18
+ import Icon from "../icon";
19
+ import Input from "../input";
20
+ import "./style";
21
+ var InputNumber = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
22
+ var _ref$value = _ref.value,
23
+ valueProp = _ref$value === void 0 ? undefined : _ref$value,
24
+ defaultValue = _ref.defaultValue,
25
+ _ref$min = _ref.min,
26
+ min = _ref$min === void 0 ? 0 : _ref$min,
27
+ max = _ref.max,
28
+ _ref$step = _ref.step,
29
+ step = _ref$step === void 0 ? 1 : _ref$step,
30
+ onChange = _ref.onChange,
31
+ onBlur = _ref.onBlur,
32
+ disabled = _ref.disabled,
33
+ light = _ref.light,
34
+ props = _objectWithoutProperties(_ref, _excluded);
35
+ // 计算初始值:优先使用 valueProp,其次使用 defaultValue,最后使用 null
36
+ var getInitialValue = function getInitialValue() {
37
+ if (valueProp !== undefined) return valueProp;
38
+ if (defaultValue !== undefined) return defaultValue;
39
+ return null;
40
+ };
41
+ var _useState = useState(getInitialValue),
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ value = _useState2[0],
44
+ setValue = _useState2[1];
45
+ var _useState3 = useState(''),
46
+ _useState4 = _slicedToArray(_useState3, 2),
47
+ inputValue = _useState4[0],
48
+ setInputValue = _useState4[1];
49
+ var _useState5 = useState(getInitialValue),
50
+ _useState6 = _slicedToArray(_useState5, 2),
51
+ lastValidValue = _useState6[0],
52
+ setLastValidValue = _useState6[1];
53
+
54
+ // 添加内部输入框引用
55
+ var inputRef = useRef(null);
56
+
57
+ // 长按相关状态和引用
58
+ var longPressTimer = useRef(null);
59
+ var accelerationTimer = useRef(null);
60
+ var isLongPressing = useRef(false);
61
+ var longPressDirection = useRef(null);
62
+
63
+ // 清理所有定时器
64
+ var clearAllTimers = useCallback(function () {
65
+ if (longPressTimer.current) {
66
+ clearTimeout(longPressTimer.current);
67
+ longPressTimer.current = null;
68
+ }
69
+ if (accelerationTimer.current) {
70
+ clearTimeout(accelerationTimer.current);
71
+ accelerationTimer.current = null;
72
+ }
73
+ isLongPressing.current = false;
74
+ longPressDirection.current = null;
75
+ }, []);
76
+
77
+ // 暴露内部输入框引用给父组件
78
+ useImperativeHandle(ref, function () {
79
+ var _inputRef$current3;
80
+ return _objectSpread(_objectSpread({}, inputRef.current), {}, {
81
+ focus: function focus() {
82
+ var _inputRef$current;
83
+ return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
84
+ },
85
+ blur: function blur() {
86
+ var _inputRef$current2;
87
+ return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
88
+ },
89
+ input: ((_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.input) || null
90
+ });
91
+ }, []);
92
+
93
+ // 同步外部 value 变化
94
+ useEffect(function () {
95
+ if (valueProp !== undefined) {
96
+ setValue(valueProp);
97
+ setInputValue(valueProp !== null ? String(valueProp) : '');
98
+ setLastValidValue(valueProp);
99
+ }
100
+ }, [valueProp]);
101
+
102
+ // 组件卸载时清理定时器
103
+ useEffect(function () {
104
+ return function () {
105
+ clearAllTimers();
106
+ };
107
+ }, [clearAllTimers]);
108
+
109
+ // 添加全局事件监听器来处理鼠标释放
110
+ useEffect(function () {
111
+ var handleGlobalMouseUp = function handleGlobalMouseUp() {
112
+ // 只有在长按状态时才清理定时器
113
+ if (isLongPressing.current || longPressTimer.current) {
114
+ clearAllTimers();
115
+ }
116
+ };
117
+
118
+ // 监听全局鼠标释放事件
119
+ document.addEventListener('mouseup', handleGlobalMouseUp);
120
+ return function () {
121
+ document.removeEventListener('mouseup', handleGlobalMouseUp);
122
+ clearAllTimers();
123
+ };
124
+ }, [clearAllTimers]);
125
+
126
+ // 验证数值是否在范围内,并保持与步长一致的精度
127
+ var validateValue = useCallback(function (val) {
128
+ var _String$split$;
129
+ var result = val;
130
+ if (min !== undefined && result < min) {
131
+ result = min;
132
+ }
133
+ if (max !== undefined && result > max) {
134
+ result = max;
135
+ }
136
+
137
+ // 根据步长确定精度,确保验证后的值也保持一致的精度
138
+ var stepPrecision = ((_String$split$ = String(step).split('.')[1]) === null || _String$split$ === void 0 ? void 0 : _String$split$.length) || 0;
139
+ if (stepPrecision > 0) {
140
+ result = Number(result.toFixed(stepPrecision));
141
+ }
142
+ return result;
143
+ }, [min, max, step]);
144
+
145
+ // 检查数值是否符合步长要求
146
+ var isValueValidForStep = useCallback(function (val) {
147
+ // 检查值是否为步长的倍数
148
+ // 对于任何步长(整数或小数),值都应该是步长的倍数
149
+ var remainder = val % step;
150
+
151
+ // 使用很小的容差来处理浮点数精度问题
152
+ return Math.abs(remainder) < 0.000001;
153
+ }, [step]);
154
+
155
+ // 根据步长调整数值,并保持正确的精度
156
+ var adjustValueByStep = useCallback(function (val, direction) {
157
+ var _String$split$2, _String$split$3;
158
+ var multiplier = direction === 'up' ? 1 : -1;
159
+ var adjusted = val + step * multiplier;
160
+
161
+ // 处理浮点数精度问题,确保结果与步长精度一致
162
+ var stepPrecision = ((_String$split$2 = String(step).split('.')[1]) === null || _String$split$2 === void 0 ? void 0 : _String$split$2.length) || 0;
163
+ var valPrecision = ((_String$split$3 = String(val).split('.')[1]) === null || _String$split$3 === void 0 ? void 0 : _String$split$3.length) || 0;
164
+ var precision = Math.max(stepPrecision, valPrecision, 0);
165
+ return Number(adjusted.toFixed(precision));
166
+ }, [step]);
167
+
168
+ // 执行连续变化的核心逻辑
169
+ var performContinuousChange = useCallback(function (direction) {
170
+ if (disabled) return false;
171
+ var currentValue = value !== null ? value : min !== undefined ? min : 0;
172
+ var adjustedValue = adjustValueByStep(currentValue, direction);
173
+ var validatedValue = validateValue(adjustedValue);
174
+
175
+ // 检查是否超出范围
176
+ if (direction === 'up' && max !== undefined && validatedValue > max) {
177
+ return false;
178
+ }
179
+ if (direction === 'down' && min !== undefined && validatedValue < min) {
180
+ return false;
181
+ }
182
+ setValue(validatedValue);
183
+ setInputValue(String(validatedValue));
184
+ setLastValidValue(validatedValue);
185
+ onChange === null || onChange === void 0 || onChange(validatedValue);
186
+ return true;
187
+ }, [value, min, max, step, onChange, validateValue, adjustValueByStep, disabled]);
188
+
189
+ // 启动长按逻辑
190
+ var startLongPress = useCallback(function (direction) {
191
+ if (disabled) return;
192
+ clearAllTimers();
193
+ longPressDirection.current = direction;
194
+
195
+ // 1秒后开始连续变化
196
+ longPressTimer.current = setTimeout(function () {
197
+ if (longPressDirection.current === direction && !disabled) {
198
+ isLongPressing.current = true;
199
+
200
+ // 开始连续变化,初始间隔200ms
201
+ var interval = 200;
202
+ var accelerate = function accelerate() {
203
+ if (!isLongPressing.current || longPressDirection.current !== direction) {
204
+ return;
205
+ }
206
+
207
+ // 使用最新的状态值
208
+ setValue(function (currentValue) {
209
+ var actualValue = currentValue !== null ? currentValue : min !== undefined ? min : 0;
210
+ var adjustedValue = adjustValueByStep(actualValue, direction);
211
+ var validatedValue = validateValue(adjustedValue);
212
+
213
+ // 检查是否超出范围
214
+ if (direction === 'up' && max !== undefined && validatedValue > max) {
215
+ // 在下一个事件循环中清理定时器,避免在状态更新中调用
216
+ setTimeout(function () {
217
+ return clearAllTimers();
218
+ }, 0);
219
+ return currentValue;
220
+ }
221
+ if (direction === 'down' && min !== undefined && validatedValue < min) {
222
+ // 在下一个事件循环中清理定时器,避免在状态更新中调用
223
+ setTimeout(function () {
224
+ return clearAllTimers();
225
+ }, 0);
226
+ return currentValue;
227
+ }
228
+ setInputValue(String(validatedValue));
229
+ setLastValidValue(validatedValue);
230
+ onChange === null || onChange === void 0 || onChange(validatedValue);
231
+ return validatedValue;
232
+ });
233
+
234
+ // 递减间隔时间实现加速效果,最小间隔50ms
235
+ interval = Math.max(50, interval * 0.9);
236
+ accelerationTimer.current = setTimeout(accelerate, interval);
237
+ };
238
+
239
+ // 立即执行第一次,然后开始定时循环
240
+ accelerate();
241
+ }
242
+ }, 500); // 500ms 延迟
243
+ }, [disabled, clearAllTimers, min, max, step, onChange, validateValue, adjustValueByStep]);
244
+
245
+ // 处理上下按钮点击
246
+ var handleClick = useCallback(function (e, type) {
247
+ e.stopPropagation();
248
+ e.preventDefault();
249
+ if (disabled) {
250
+ return;
251
+ }
252
+ if (value === null) {
253
+ // 当值为空时,up 按钮设置为 min,down 按钮也设置为 min(因为不能小于 min)
254
+ var newValue = min !== undefined ? min : 0;
255
+ var _validatedValue = validateValue(newValue);
256
+ setValue(_validatedValue);
257
+ setInputValue(String(_validatedValue));
258
+ setLastValidValue(_validatedValue);
259
+ onChange === null || onChange === void 0 || onChange(_validatedValue);
260
+
261
+ // 设置焦点到输入框,光标在最后
262
+ setTimeout(function () {
263
+ var _inputRef$current4;
264
+ if ((_inputRef$current4 = inputRef.current) !== null && _inputRef$current4 !== void 0 && _inputRef$current4.input) {
265
+ inputRef.current.input.focus();
266
+ // 将光标移动到末尾
267
+ var input = inputRef.current.input;
268
+ input.setSelectionRange(input.value.length, input.value.length);
269
+ }
270
+ }, 0);
271
+ return;
272
+ }
273
+ var adjustedValue = adjustValueByStep(value, type);
274
+ var validatedValue = validateValue(adjustedValue);
275
+
276
+ // 检查是否超出范围
277
+ if (type === 'up' && max !== undefined && validatedValue > max) {
278
+ return;
279
+ }
280
+ if (type === 'down' && min !== undefined && validatedValue < min) {
281
+ return;
282
+ }
283
+ setValue(validatedValue);
284
+ setInputValue(String(validatedValue));
285
+ setLastValidValue(validatedValue);
286
+ onChange === null || onChange === void 0 || onChange(validatedValue);
287
+
288
+ // 设置焦点到输入框,光标在最后
289
+ setTimeout(function () {
290
+ var _inputRef$current5;
291
+ if ((_inputRef$current5 = inputRef.current) !== null && _inputRef$current5 !== void 0 && _inputRef$current5.input) {
292
+ inputRef.current.input.focus();
293
+ // 将光标移动到末尾
294
+ var input = inputRef.current.input;
295
+ input.setSelectionRange(input.value.length, input.value.length);
296
+ }
297
+ }, 0);
298
+ }, [value, min, max, step, onChange, validateValue, adjustValueByStep, disabled]);
299
+
300
+ // 处理鼠标按下事件
301
+ var handleMouseDown = useCallback(function (e, type) {
302
+ e.preventDefault();
303
+ e.stopPropagation();
304
+ if (disabled) return;
305
+
306
+ // 首先执行一次点击操作
307
+ handleClick(e, type);
308
+
309
+ // 启动长按逻辑
310
+ startLongPress(type);
311
+ }, [disabled, handleClick, startLongPress]);
312
+
313
+ // 处理输入框变化
314
+ var handleChange = useCallback(function (e) {
315
+ var val = e.target.value;
316
+
317
+ // 在输入过程中,完全自由,不做任何限制
318
+ setInputValue(val);
319
+ if (val === '') {
320
+ setValue(null);
321
+ onChange === null || onChange === void 0 || onChange(null);
322
+ } else {
323
+ // 允许用户输入任何内容,包括非数字字符
324
+ // 只有在失焦时才进行验证和格式化
325
+ // 这里不更新 value,保持输入框的原始内容
326
+ }
327
+ }, [onChange]);
328
+
329
+ // 处理失焦,验证并格式化数值
330
+ var handleBlur = useCallback(function (e) {
331
+ var val = e.target.value;
332
+ if (val === '') {
333
+ setValue(null);
334
+ setInputValue('');
335
+ onChange === null || onChange === void 0 || onChange(null);
336
+ onBlur === null || onBlur === void 0 || onBlur(e);
337
+ return;
338
+ }
339
+ var numVal = Number(val);
340
+ if (isNaN(numVal)) {
341
+ // 如果输入的不是有效数字,恢复为上一个有效值
342
+ setValue(lastValidValue);
343
+ setInputValue(lastValidValue !== null ? String(lastValidValue) : '');
344
+ onChange === null || onChange === void 0 || onChange(lastValidValue);
345
+ onBlur === null || onBlur === void 0 || onBlur(e);
346
+ return;
347
+ }
348
+
349
+ // 验证并格式化数值
350
+ var validatedValue = validateValue(numVal);
351
+
352
+ // 检查值是否符合步长要求
353
+ if (!isValueValidForStep(validatedValue)) {
354
+ // 如果值不符合步长要求,恢复为上一个有效值
355
+ setValue(lastValidValue);
356
+ setInputValue(lastValidValue !== null ? String(lastValidValue) : '');
357
+ onChange === null || onChange === void 0 || onChange(lastValidValue);
358
+ onBlur === null || onBlur === void 0 || onBlur(e);
359
+ return;
360
+ }
361
+ setValue(validatedValue);
362
+ setInputValue(String(validatedValue));
363
+ setLastValidValue(validatedValue);
364
+ onChange === null || onChange === void 0 || onChange(validatedValue);
365
+ onBlur === null || onBlur === void 0 || onBlur(e);
366
+ }, [lastValidValue, onChange, onBlur, validateValue, isValueValidForStep]);
367
+
368
+ // 计算显示值
369
+ var getDisplayValue = function getDisplayValue() {
370
+ // 如果正在输入中(inputValue 不为空且与 value 不同),显示用户输入的内容
371
+ if (inputValue !== '' && (value === null || inputValue !== String(value))) {
372
+ return inputValue;
373
+ }
374
+
375
+ // 如果不在输入中,根据步长格式化显示
376
+ if (value !== null) {
377
+ var _String$split$4;
378
+ var stepPrecision = ((_String$split$4 = String(step).split('.')[1]) === null || _String$split$4 === void 0 ? void 0 : _String$split$4.length) || 0;
379
+ if (stepPrecision > 0) {
380
+ return value.toFixed(stepPrecision);
381
+ }
382
+ return String(value);
383
+ }
384
+ return '';
385
+ };
386
+ var displayValue = getDisplayValue();
387
+ return /*#__PURE__*/React.createElement(Input, _extends({
388
+ "data-odn-input-number": true,
389
+ "data-odn-input-number-light": light,
390
+ ref: inputRef,
391
+ type: "text",
392
+ value: displayValue,
393
+ onChange: handleChange,
394
+ onBlur: handleBlur,
395
+ disabled: disabled,
396
+ light: light,
397
+ rightElement: /*#__PURE__*/React.createElement("div", {
398
+ "data-odn-input-number-right": true
399
+ }, /*#__PURE__*/React.createElement("div", {
400
+ "data-odn-input-number-right-button": true,
401
+ "data-odn-input-number-right-button-up": true,
402
+ "data-odn-input-number-right-button-disabled": max !== undefined && value !== null && value >= max,
403
+ onMouseDown: function onMouseDown(e) {
404
+ handleMouseDown(e, 'up');
405
+ },
406
+ style: {
407
+ userSelect: 'none'
408
+ }
409
+ }, /*#__PURE__*/React.createElement(Icon, {
410
+ name: "up",
411
+ size: 14
412
+ })), /*#__PURE__*/React.createElement("div", {
413
+ "data-odn-input-number-right-button": true,
414
+ "data-odn-input-number-right-button-down": true,
415
+ "data-odn-input-number-right-button-disabled": min !== undefined && value !== null && value <= min,
416
+ onMouseDown: function onMouseDown(e) {
417
+ handleMouseDown(e, 'down');
418
+ },
419
+ style: {
420
+ userSelect: 'none'
421
+ }
422
+ }, /*#__PURE__*/React.createElement(Icon, {
423
+ name: "down",
424
+ size: 14
425
+ })))
426
+ }, props));
427
+ });
428
+ InputNumber.displayName = 'InputNumber';
429
+ export default InputNumber;
@@ -0,0 +1,70 @@
1
+ html {
2
+ --odn-input-number-width: 120px;
3
+ --odn-input-number-right-width: 32px;
4
+ }
5
+
6
+ [data-odn-input-number] {
7
+ width: var(--odn-input-number-width);
8
+ }
9
+
10
+ [data-odn-input-number][data-odn-input-size=small] [data-odn-input-right-element] {
11
+ margin-top: calc(var(--odn-input-padding-block-small) * -1);
12
+ margin-bottom: calc(var(--odn-input-padding-block-small) * -1);
13
+ margin-right: calc(var(--odn-input-padding-inline-small) * -1);
14
+ height: calc(var(--odn-input-line-height-small) * var(--odn-input-font-size-small) + var(--odn-input-padding-block-small) * 2);
15
+ }
16
+
17
+ [data-odn-input-number][data-odn-input-size=medium] [data-odn-input-right-element] {
18
+ margin-top: calc(var(--odn-input-padding-block-medium) * -1);
19
+ margin-bottom: calc(var(--odn-input-padding-block-medium) * -1);
20
+ margin-right: calc(var(--odn-input-padding-inline-medium) * -1);
21
+ height: calc(var(--odn-input-line-height-medium) * var(--odn-input-font-size-medium) + var(--odn-input-padding-block-medium) * 2);
22
+ }
23
+
24
+ [data-odn-input-number][data-odn-input-size=large] [data-odn-input-right-element] {
25
+ margin-top: calc(var(--odn-input-padding-block-large) * -1);
26
+ margin-bottom: calc(var(--odn-input-padding-block-large) * -1);
27
+ margin-right: calc(var(--odn-input-padding-inline-large) * -1);
28
+ height: calc(var(--odn-input-line-height-large) * var(--odn-input-font-size-large) + var(--odn-input-padding-block-large) * 2);
29
+ }
30
+
31
+ [data-odn-input-number-right] {
32
+ display: flex;
33
+ flex-direction: column;
34
+ width: var(--odn-input-number-right-width);
35
+ height: 100%;
36
+ border-left: var(--odn-input-border-width) var(--odn-input-border-style) var(--odn-input-border-normal);
37
+ user-select: none;
38
+ }
39
+
40
+ [data-odn-input-number-right-button] {
41
+ flex: 1;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ color: var(--odn-color-black-9);
46
+ cursor: pointer;
47
+ transition: all 0.2s ease;
48
+ }
49
+ [data-odn-input-number-right-button][data-odn-input-number-right-button-disabled=true] {
50
+ color: var(--odn-color-black-6);
51
+ cursor: not-allowed;
52
+ }
53
+ [data-odn-input-number-right-button][data-odn-input-number-right-button-disabled=false]:hover {
54
+ flex: 1.75;
55
+ background-color: var(--odn-color-black-1);
56
+ }
57
+ [data-odn-input-number-right-button][data-odn-input-number-right-button-disabled=false]:active {
58
+ background-color: var(--odn-color-black-2);
59
+ }
60
+
61
+ [data-odn-input-number-right-button-up] {
62
+ border-bottom: var(--odn-input-border-width) var(--odn-input-border-style) var(--odn-input-border-normal);
63
+ }
64
+
65
+ [data-odn-input-number-light=true][data-odn-input-focused=false] [data-odn-input-right-element] {
66
+ opacity: 0;
67
+ }
68
+ [data-odn-input-number-light=true]:hover [data-odn-input-right-element] {
69
+ opacity: 1;
70
+ }
@@ -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,71 @@
1
+ import React from 'react';
2
+ import './style';
3
+ export interface InputOtpProps extends Omit<React.ComponentProps<'input'>, 'size' | 'onChange' | 'onFocus' | 'onBlur'> {
4
+ /**
5
+ * @description 长度
6
+ * @default 6
7
+ */
8
+ length?: number;
9
+ /**
10
+ * @description 大小
11
+ * @default "medium"
12
+ */
13
+ size?: 'small' | 'medium' | 'large';
14
+ /**
15
+ * @description 是否禁用
16
+ * @default false
17
+ */
18
+ disabled?: boolean;
19
+ /**
20
+ * @description 是否自动聚焦
21
+ * @default false
22
+ */
23
+ autoFocus?: boolean;
24
+ /**
25
+ * @description 外部控制值
26
+ * @default ''
27
+ */
28
+ value?: string;
29
+ /**
30
+ * @description 值改变时的 handler
31
+ */
32
+ onChange?: (value: string) => void;
33
+ /**
34
+ * @description 默认值
35
+ * @default ''
36
+ */
37
+ defaultValue?: string;
38
+ /**
39
+ * @description 是否自动提交,自动提交时,输入完成会自动触发 form 的 requestSubmit
40
+ * @default false
41
+ */
42
+ autoSubmit?: boolean;
43
+ /**
44
+ * @description 自动提交时的 handler
45
+ */
46
+ onAutoSubmit?: (value: string) => void;
47
+ /**
48
+ * @description placeholder
49
+ * @default ''
50
+ */
51
+ placeholder?: string;
52
+ /**
53
+ * @description autoComplete
54
+ * @default 'one-time-code'
55
+ */
56
+ autoComplete?: 'off' | 'one-time-code';
57
+ /**
58
+ * @description 聚焦时的 handler
59
+ */
60
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>, index: number) => void;
61
+ /**
62
+ * @description 失焦时的 handler
63
+ */
64
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>, index: number) => void;
65
+ }
66
+ export interface InputOtpRef extends HTMLDivElement {
67
+ focus: () => void;
68
+ inputs: HTMLInputElement[];
69
+ }
70
+ declare const InputOtp: React.ForwardRefExoticComponent<Omit<InputOtpProps, "ref"> & React.RefAttributes<InputOtpRef>>;
71
+ export default InputOtp;