@douyinfe/semi-ui 2.9.0-beta.0 → 2.9.1

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 (376) hide show
  1. package/_base/baseComponent.tsx +2 -1
  2. package/_portal/index.tsx +2 -1
  3. package/anchor/__test__/anchor.test.js +1 -0
  4. package/anchor/_story/anchor.stories.js +23 -1
  5. package/anchor/index.tsx +2 -1
  6. package/anchor/link.tsx +2 -1
  7. package/autoComplete/index.tsx +2 -2
  8. package/avatar/interface.ts +2 -2
  9. package/backtop/index.tsx +1 -0
  10. package/badge/_story/badge.stories.js +34 -2
  11. package/badge/index.tsx +4 -2
  12. package/banner/index.tsx +1 -0
  13. package/breadcrumb/bread-context.tsx +2 -2
  14. package/breadcrumb/index.tsx +2 -2
  15. package/breadcrumb/item.tsx +11 -3
  16. package/button/Button.tsx +2 -1
  17. package/button/buttonGroup.tsx +2 -1
  18. package/calendar/_story/Demo.tsx +3 -3
  19. package/card/cardGroup.tsx +1 -0
  20. package/card/index.tsx +1 -0
  21. package/cascader/_story/cascader.stories.js +17 -2
  22. package/cascader/index.tsx +4 -3
  23. package/cascader/item.tsx +3 -1
  24. package/checkbox/_story/checkbox.stories.js +1 -1
  25. package/checkbox/checkbox.tsx +4 -2
  26. package/checkbox/checkboxGroup.tsx +1 -1
  27. package/checkbox/context.ts +3 -3
  28. package/collapse/index.tsx +1 -0
  29. package/collapse/item.tsx +5 -0
  30. package/collapsible/index.tsx +2 -2
  31. package/configProvider/context.tsx +1 -1
  32. package/datePicker/_story/datePicker.stories.js +37 -0
  33. package/datePicker/datePicker.tsx +2 -1
  34. package/descriptions/index.tsx +2 -1
  35. package/descriptions/item.tsx +4 -1
  36. package/dist/css/semi.css +2 -2
  37. package/dist/css/semi.min.css +1 -1
  38. package/dist/umd/semi-ui.js +7560 -3681
  39. package/dist/umd/semi-ui.js.map +1 -1
  40. package/dist/umd/semi-ui.min.js +1 -1
  41. package/dist/umd/semi-ui.min.js.map +1 -1
  42. package/dropdown/context.ts +6 -1
  43. package/dropdown/dropdownItem.tsx +2 -1
  44. package/dropdown/dropdownTitle.tsx +2 -1
  45. package/dropdown/index.tsx +3 -1
  46. package/empty/index.tsx +1 -1
  47. package/form/arrayField.tsx +1 -0
  48. package/form/baseForm.tsx +3 -2
  49. package/form/group.tsx +2 -0
  50. package/form/hoc/withField.tsx +9 -6
  51. package/form/label.tsx +1 -0
  52. package/form/section.tsx +1 -1
  53. package/form/slot.tsx +2 -0
  54. package/grid/col.tsx +3 -1
  55. package/grid/row.tsx +5 -1
  56. package/input/__test__/input.test.js +12 -3
  57. package/input/__test__/textArea.test.js +53 -0
  58. package/layout/Sider.tsx +3 -1
  59. package/layout/index.tsx +2 -0
  60. package/layout/layout-context.ts +1 -1
  61. package/lib/cjs/_base/baseComponent.d.ts +2 -1
  62. package/lib/cjs/_portal/index.d.ts +3 -1
  63. package/lib/cjs/anchor/index.d.ts +2 -1
  64. package/lib/cjs/anchor/link.d.ts +3 -2
  65. package/lib/cjs/autoComplete/index.d.ts +2 -2
  66. package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
  67. package/lib/cjs/avatar/interface.d.ts +2 -2
  68. package/lib/cjs/backtop/index.d.ts +1 -0
  69. package/lib/cjs/badge/index.d.ts +4 -2
  70. package/lib/cjs/banner/index.d.ts +2 -1
  71. package/lib/cjs/breadcrumb/bread-context.d.ts +2 -2
  72. package/lib/cjs/breadcrumb/index.d.ts +2 -2
  73. package/lib/cjs/breadcrumb/item.d.ts +15 -3
  74. package/lib/cjs/button/Button.d.ts +2 -1
  75. package/lib/cjs/button/buttonGroup.d.ts +1 -0
  76. package/lib/cjs/button/index.d.ts +1 -1
  77. package/lib/cjs/calendar/timeCol.d.ts +1 -1
  78. package/lib/cjs/card/cardGroup.d.ts +1 -0
  79. package/lib/cjs/card/index.d.ts +2 -1
  80. package/lib/cjs/cascader/index.d.ts +5 -3
  81. package/lib/cjs/cascader/index.js +1 -1
  82. package/lib/cjs/cascader/item.d.ts +3 -1
  83. package/lib/cjs/checkbox/checkbox.d.ts +5 -11
  84. package/lib/cjs/checkbox/checkbox.js +1 -1
  85. package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -1
  86. package/lib/cjs/checkbox/checkboxInner.d.ts +1 -10
  87. package/lib/cjs/checkbox/context.d.ts +3 -3
  88. package/lib/cjs/collapse/index.d.ts +1 -0
  89. package/lib/cjs/collapse/item.d.ts +2 -0
  90. package/lib/cjs/collapse/item.js +4 -2
  91. package/lib/cjs/collapsible/index.d.ts +1 -1
  92. package/lib/cjs/configProvider/index.d.ts +1 -1
  93. package/lib/cjs/datePicker/datePicker.d.ts +3 -1
  94. package/lib/cjs/datePicker/insetInput.d.ts +1 -0
  95. package/lib/cjs/descriptions/index.d.ts +4 -3
  96. package/lib/cjs/descriptions/item.d.ts +4 -1
  97. package/lib/cjs/dropdown/context.d.ts +5 -3
  98. package/lib/cjs/dropdown/dropdownItem.d.ts +3 -3
  99. package/lib/cjs/dropdown/dropdownMenu.d.ts +1 -0
  100. package/lib/cjs/dropdown/dropdownTitle.d.ts +3 -3
  101. package/lib/cjs/dropdown/index.d.ts +3 -3
  102. package/lib/cjs/empty/index.d.ts +1 -1
  103. package/lib/cjs/form/arrayField.d.ts +1 -0
  104. package/lib/cjs/form/baseForm.d.ts +2 -2
  105. package/lib/cjs/form/baseForm.js +1 -1
  106. package/lib/cjs/form/errorMessage.d.ts +1 -1
  107. package/lib/cjs/form/group.d.ts +3 -1
  108. package/lib/cjs/form/hoc/withField.js +6 -4
  109. package/lib/cjs/form/label.d.ts +1 -0
  110. package/lib/cjs/form/section.d.ts +1 -1
  111. package/lib/cjs/form/slot.js +2 -0
  112. package/lib/cjs/grid/col.d.ts +3 -3
  113. package/lib/cjs/grid/row.d.ts +4 -3
  114. package/lib/cjs/iconButton/index.d.ts +1 -1
  115. package/lib/cjs/inputNumber/index.d.ts +1 -1
  116. package/lib/cjs/layout/Sider.d.ts +4 -1
  117. package/lib/cjs/layout/index.d.ts +2 -0
  118. package/lib/cjs/list/index.d.ts +1 -0
  119. package/lib/cjs/list/item.d.ts +5 -1
  120. package/lib/cjs/list/item.js +5 -1
  121. package/lib/cjs/modal/Modal.d.ts +1 -0
  122. package/lib/cjs/modal/Modal.js +3 -0
  123. package/lib/cjs/modal/ModalContent.d.ts +7 -2
  124. package/lib/cjs/modal/confirm.d.ts +10 -5
  125. package/lib/cjs/modal/useModal/index.d.ts +1 -0
  126. package/lib/cjs/navigation/Footer.d.ts +3 -5
  127. package/lib/cjs/navigation/Header.d.ts +4 -6
  128. package/lib/cjs/navigation/Item.d.ts +4 -6
  129. package/lib/cjs/navigation/OpenIconTransition.d.ts +2 -1
  130. package/lib/cjs/navigation/SubNav.d.ts +3 -5
  131. package/lib/cjs/navigation/SubNav.js +2 -2
  132. package/lib/cjs/navigation/SubNavTransition.d.ts +1 -1
  133. package/lib/cjs/navigation/index.d.ts +2 -2
  134. package/lib/cjs/navigation/nav-context.d.ts +21 -5
  135. package/lib/cjs/notification/NoticeTransition.d.ts +2 -2
  136. package/lib/cjs/notification/index.d.ts +3 -1
  137. package/lib/cjs/notification/notice.d.ts +3 -1
  138. package/lib/cjs/notification/useNotification/index.d.ts +1 -0
  139. package/lib/cjs/overflowList/intersectionObserver.d.ts +3 -2
  140. package/lib/cjs/pagination/index.d.ts +3 -1
  141. package/lib/cjs/pagination/index.js +15 -11
  142. package/lib/cjs/popconfirm/index.d.ts +4 -2
  143. package/lib/cjs/popover/index.d.ts +4 -2
  144. package/lib/cjs/progress/index.d.ts +1 -1
  145. package/lib/cjs/radio/radio.d.ts +1 -0
  146. package/lib/cjs/radio/radioGroup.d.ts +1 -0
  147. package/lib/cjs/scrollList/scrollItem.js +5 -1
  148. package/lib/cjs/select/index.d.ts +3 -1
  149. package/lib/cjs/select/optionGroup.d.ts +1 -1
  150. package/lib/cjs/sideSheet/SideSheetContent.d.ts +1 -0
  151. package/lib/cjs/sideSheet/SideSheetTransition.d.ts +1 -1
  152. package/lib/cjs/sideSheet/index.d.ts +3 -1
  153. package/lib/cjs/table/Body/BaseRow.d.ts +1 -1
  154. package/lib/cjs/table/Body/ExpandedRow.d.ts +4 -2
  155. package/lib/cjs/table/Body/SectionRow.d.ts +3 -1
  156. package/lib/cjs/table/Column.d.ts +1 -1
  157. package/lib/cjs/table/ColumnShape.d.ts +1 -1
  158. package/lib/cjs/table/CustomExpandIcon.d.ts +1 -1
  159. package/lib/cjs/table/Table.d.ts +10 -8
  160. package/lib/cjs/table/TableCell.d.ts +5 -3
  161. package/lib/cjs/table/TableHeaderRow.d.ts +3 -1
  162. package/lib/cjs/table/index.d.ts +4 -4
  163. package/lib/cjs/table/table-context.d.ts +7 -6
  164. package/lib/cjs/tabs/TabPane.d.ts +3 -1
  165. package/lib/cjs/tabs/TabPane.js +4 -0
  166. package/lib/cjs/tabs/index.js +2 -0
  167. package/lib/cjs/tabs/interface.d.ts +2 -1
  168. package/lib/cjs/tag/group.d.ts +1 -1
  169. package/lib/cjs/timePicker/Combobox.d.ts +1 -0
  170. package/lib/cjs/timeline/index.d.ts +2 -1
  171. package/lib/cjs/timeline/item.d.ts +1 -0
  172. package/lib/cjs/toast/ToastTransition.d.ts +1 -1
  173. package/lib/cjs/toast/index.d.ts +8 -16
  174. package/lib/cjs/toast/toast.d.ts +4 -2
  175. package/lib/cjs/toast/useToast/index.d.ts +1 -0
  176. package/lib/cjs/tooltip/index.d.ts +4 -2
  177. package/lib/cjs/tooltip/index.js +1 -1
  178. package/lib/cjs/transfer/index.d.ts +4 -3
  179. package/lib/cjs/transfer/index.js +5 -2
  180. package/lib/cjs/tree/index.d.ts +13 -11
  181. package/lib/cjs/tree/nodeList.d.ts +1 -1
  182. package/lib/cjs/tree/treeContext.d.ts +10 -10
  183. package/lib/cjs/tree/treeNode.d.ts +11 -9
  184. package/lib/cjs/tree/treeNode.js +2 -0
  185. package/lib/cjs/treeSelect/index.d.ts +7 -5
  186. package/lib/cjs/typography/copyable.d.ts +1 -1
  187. package/lib/cjs/upload/index.d.ts +2 -2
  188. package/lib/es/_base/baseComponent.d.ts +2 -1
  189. package/lib/es/_portal/index.d.ts +3 -1
  190. package/lib/es/anchor/index.d.ts +2 -1
  191. package/lib/es/anchor/link.d.ts +3 -2
  192. package/lib/es/autoComplete/index.d.ts +2 -2
  193. package/lib/es/avatar/avatarGroup.d.ts +1 -1
  194. package/lib/es/avatar/interface.d.ts +2 -2
  195. package/lib/es/backtop/index.d.ts +1 -0
  196. package/lib/es/badge/index.d.ts +4 -2
  197. package/lib/es/banner/index.d.ts +2 -1
  198. package/lib/es/breadcrumb/bread-context.d.ts +2 -2
  199. package/lib/es/breadcrumb/index.d.ts +2 -2
  200. package/lib/es/breadcrumb/item.d.ts +15 -3
  201. package/lib/es/button/Button.d.ts +2 -1
  202. package/lib/es/button/buttonGroup.d.ts +1 -0
  203. package/lib/es/button/index.d.ts +1 -1
  204. package/lib/es/calendar/timeCol.d.ts +1 -1
  205. package/lib/es/card/cardGroup.d.ts +1 -0
  206. package/lib/es/card/index.d.ts +2 -1
  207. package/lib/es/cascader/index.d.ts +5 -3
  208. package/lib/es/cascader/index.js +1 -1
  209. package/lib/es/cascader/item.d.ts +3 -1
  210. package/lib/es/checkbox/checkbox.d.ts +5 -11
  211. package/lib/es/checkbox/checkbox.js +1 -1
  212. package/lib/es/checkbox/checkboxGroup.d.ts +1 -1
  213. package/lib/es/checkbox/checkboxInner.d.ts +1 -10
  214. package/lib/es/checkbox/context.d.ts +3 -3
  215. package/lib/es/collapse/index.d.ts +1 -0
  216. package/lib/es/collapse/item.d.ts +2 -0
  217. package/lib/es/collapse/item.js +4 -2
  218. package/lib/es/collapsible/index.d.ts +1 -1
  219. package/lib/es/configProvider/index.d.ts +1 -1
  220. package/lib/es/datePicker/datePicker.d.ts +3 -1
  221. package/lib/es/datePicker/insetInput.d.ts +1 -0
  222. package/lib/es/descriptions/index.d.ts +4 -3
  223. package/lib/es/descriptions/item.d.ts +4 -1
  224. package/lib/es/dropdown/context.d.ts +5 -3
  225. package/lib/es/dropdown/dropdownItem.d.ts +3 -3
  226. package/lib/es/dropdown/dropdownMenu.d.ts +1 -0
  227. package/lib/es/dropdown/dropdownTitle.d.ts +3 -3
  228. package/lib/es/dropdown/index.d.ts +3 -3
  229. package/lib/es/empty/index.d.ts +1 -1
  230. package/lib/es/form/arrayField.d.ts +1 -0
  231. package/lib/es/form/baseForm.d.ts +2 -2
  232. package/lib/es/form/baseForm.js +1 -1
  233. package/lib/es/form/errorMessage.d.ts +1 -1
  234. package/lib/es/form/group.d.ts +3 -1
  235. package/lib/es/form/hoc/withField.js +6 -4
  236. package/lib/es/form/label.d.ts +1 -0
  237. package/lib/es/form/section.d.ts +1 -1
  238. package/lib/es/form/slot.js +2 -0
  239. package/lib/es/grid/col.d.ts +3 -3
  240. package/lib/es/grid/row.d.ts +4 -3
  241. package/lib/es/iconButton/index.d.ts +1 -1
  242. package/lib/es/inputNumber/index.d.ts +1 -1
  243. package/lib/es/layout/Sider.d.ts +4 -1
  244. package/lib/es/layout/index.d.ts +2 -0
  245. package/lib/es/list/index.d.ts +1 -0
  246. package/lib/es/list/item.d.ts +5 -1
  247. package/lib/es/list/item.js +5 -1
  248. package/lib/es/modal/Modal.d.ts +1 -0
  249. package/lib/es/modal/Modal.js +3 -0
  250. package/lib/es/modal/ModalContent.d.ts +7 -2
  251. package/lib/es/modal/confirm.d.ts +10 -5
  252. package/lib/es/modal/useModal/index.d.ts +1 -0
  253. package/lib/es/navigation/Footer.d.ts +3 -5
  254. package/lib/es/navigation/Header.d.ts +4 -6
  255. package/lib/es/navigation/Item.d.ts +4 -6
  256. package/lib/es/navigation/OpenIconTransition.d.ts +2 -1
  257. package/lib/es/navigation/SubNav.d.ts +3 -5
  258. package/lib/es/navigation/SubNav.js +2 -2
  259. package/lib/es/navigation/SubNavTransition.d.ts +1 -1
  260. package/lib/es/navigation/index.d.ts +2 -2
  261. package/lib/es/navigation/nav-context.d.ts +21 -5
  262. package/lib/es/notification/NoticeTransition.d.ts +2 -2
  263. package/lib/es/notification/index.d.ts +3 -1
  264. package/lib/es/notification/notice.d.ts +3 -1
  265. package/lib/es/notification/useNotification/index.d.ts +1 -0
  266. package/lib/es/overflowList/intersectionObserver.d.ts +3 -2
  267. package/lib/es/pagination/index.d.ts +3 -1
  268. package/lib/es/pagination/index.js +15 -11
  269. package/lib/es/popconfirm/index.d.ts +4 -2
  270. package/lib/es/popover/index.d.ts +4 -2
  271. package/lib/es/progress/index.d.ts +1 -1
  272. package/lib/es/radio/radio.d.ts +1 -0
  273. package/lib/es/radio/radioGroup.d.ts +1 -0
  274. package/lib/es/scrollList/scrollItem.js +5 -1
  275. package/lib/es/select/index.d.ts +3 -1
  276. package/lib/es/select/optionGroup.d.ts +1 -1
  277. package/lib/es/sideSheet/SideSheetContent.d.ts +1 -0
  278. package/lib/es/sideSheet/SideSheetTransition.d.ts +1 -1
  279. package/lib/es/sideSheet/index.d.ts +3 -1
  280. package/lib/es/table/Body/BaseRow.d.ts +1 -1
  281. package/lib/es/table/Body/ExpandedRow.d.ts +4 -2
  282. package/lib/es/table/Body/SectionRow.d.ts +3 -1
  283. package/lib/es/table/Column.d.ts +1 -1
  284. package/lib/es/table/ColumnShape.d.ts +1 -1
  285. package/lib/es/table/CustomExpandIcon.d.ts +1 -1
  286. package/lib/es/table/Table.d.ts +10 -8
  287. package/lib/es/table/TableCell.d.ts +5 -3
  288. package/lib/es/table/TableHeaderRow.d.ts +3 -1
  289. package/lib/es/table/index.d.ts +4 -4
  290. package/lib/es/table/table-context.d.ts +7 -6
  291. package/lib/es/tabs/TabPane.d.ts +3 -1
  292. package/lib/es/tabs/TabPane.js +4 -0
  293. package/lib/es/tabs/index.js +2 -0
  294. package/lib/es/tabs/interface.d.ts +2 -1
  295. package/lib/es/tag/group.d.ts +1 -1
  296. package/lib/es/timePicker/Combobox.d.ts +1 -0
  297. package/lib/es/timeline/index.d.ts +2 -1
  298. package/lib/es/timeline/item.d.ts +1 -0
  299. package/lib/es/toast/ToastTransition.d.ts +1 -1
  300. package/lib/es/toast/index.d.ts +8 -16
  301. package/lib/es/toast/toast.d.ts +4 -2
  302. package/lib/es/toast/useToast/index.d.ts +1 -0
  303. package/lib/es/tooltip/index.d.ts +4 -2
  304. package/lib/es/tooltip/index.js +1 -1
  305. package/lib/es/transfer/index.d.ts +4 -3
  306. package/lib/es/transfer/index.js +6 -2
  307. package/lib/es/tree/index.d.ts +13 -11
  308. package/lib/es/tree/nodeList.d.ts +1 -1
  309. package/lib/es/tree/treeContext.d.ts +10 -10
  310. package/lib/es/tree/treeNode.d.ts +11 -9
  311. package/lib/es/tree/treeNode.js +2 -0
  312. package/lib/es/treeSelect/index.d.ts +7 -5
  313. package/lib/es/typography/copyable.d.ts +1 -1
  314. package/lib/es/upload/index.d.ts +2 -2
  315. package/list/index.tsx +1 -0
  316. package/list/item.tsx +6 -1
  317. package/modal/Modal.tsx +3 -0
  318. package/modal/ModalContent.tsx +9 -3
  319. package/modal/confirm.tsx +1 -1
  320. package/navigation/Footer.tsx +3 -1
  321. package/navigation/Header.tsx +3 -1
  322. package/navigation/Item.tsx +4 -3
  323. package/navigation/OpenIconTransition.tsx +2 -1
  324. package/navigation/SubNav.tsx +4 -3
  325. package/navigation/SubNavTransition.tsx +1 -1
  326. package/navigation/nav-context.ts +22 -1
  327. package/notification/NoticeTransition.tsx +1 -1
  328. package/notification/index.tsx +3 -1
  329. package/notification/notice.tsx +3 -1
  330. package/overflowList/_story/overflowList.stories.js +44 -0
  331. package/overflowList/intersectionObserver.tsx +2 -1
  332. package/package.json +9 -9
  333. package/pagination/index.tsx +4 -1
  334. package/popconfirm/index.tsx +3 -1
  335. package/popover/index.tsx +3 -1
  336. package/radio/radio.tsx +1 -0
  337. package/radio/radioGroup.tsx +1 -0
  338. package/scrollList/_story/SingleWheelList/index.js +72 -0
  339. package/scrollList/_story/scrolllist.stories.js +7 -0
  340. package/scrollList/scrollItem.tsx +4 -1
  341. package/select/index.tsx +2 -1
  342. package/select/utils.tsx +1 -1
  343. package/sideSheet/SideSheetContent.tsx +1 -0
  344. package/sideSheet/SideSheetTransition.tsx +1 -1
  345. package/sideSheet/index.tsx +3 -2
  346. package/table/Body/ExpandedRow.tsx +3 -1
  347. package/table/Body/SectionRow.tsx +3 -1
  348. package/table/Body/index.tsx +3 -2
  349. package/table/Table.tsx +4 -3
  350. package/table/TableCell.tsx +6 -4
  351. package/table/TableHeaderRow.tsx +3 -1
  352. package/table/__test__/table.test.js +1 -0
  353. package/table/table-context.ts +10 -6
  354. package/tabs/TabPane.tsx +4 -0
  355. package/tabs/_story/tabs.stories.js +72 -0
  356. package/tabs/index.tsx +3 -2
  357. package/tabs/interface.ts +2 -1
  358. package/tag/group.tsx +5 -5
  359. package/tagInput/_story/tagInput.stories.js +14 -1
  360. package/timePicker/TimePicker.tsx +2 -2
  361. package/timePicker/_story/timepicker.stories.js +20 -1
  362. package/timeline/index.tsx +1 -0
  363. package/timeline/item.tsx +1 -0
  364. package/toast/ToastTransition.tsx +1 -1
  365. package/toast/toast.tsx +3 -1
  366. package/tooltip/_story/tooltip.stories.js +127 -15
  367. package/tooltip/index.tsx +3 -2
  368. package/transfer/index.tsx +7 -2
  369. package/tree/index.tsx +12 -11
  370. package/tree/treeContext.tsx +10 -10
  371. package/tree/treeNode.tsx +10 -7
  372. package/treeSelect/index.tsx +5 -4
  373. package/typography/__test__/typography.test.js +1 -0
  374. package/upload/__test__/upload.test.js +2 -0
  375. package/upload/_story/upload.stories.js +2 -2
  376. package/upload/index.tsx +1 -1
@@ -1,8 +1,9 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  export interface ReactIntersectionObserverProps {
4
4
  onIntersect?: IntersectionObserverCallback;
5
5
  option?: IntersectionObserverInit;
6
+ children?: React.ReactNode;
6
7
  root?: IntersectionObserverInit['root'];
7
8
  threshold?: IntersectionObserverInit['threshold'];
8
9
  rootMargin?: IntersectionObserverInit['rootMargin'];
@@ -30,5 +31,5 @@ export default class ReactIntersectionObserver extends React.PureComponent<React
30
31
  componentDidUpdate(): void;
31
32
  componentWillUnmount(): void;
32
33
  observeElement(force?: boolean): void;
33
- render(): ReactNode;
34
+ render(): React.ReactNode;
34
35
  }
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { PageList, PaginationAdapter } from '@douyinfe/semi-foundation/lib/es/pagination/foundation';
4
4
  import '@douyinfe/semi-foundation/lib/es/pagination/pagination.css';
5
+ import { ContextValue } from '../configProvider/context';
5
6
  import { Locale } from '../locale/interface';
6
7
  import BaseComponent from '../_base/baseComponent';
7
8
  import { Position } from '../tooltip';
@@ -43,7 +44,7 @@ export declare type PaginationLocale = Locale['Pagination'];
43
44
  export declare type PopoverPosition = Position;
44
45
  export { PageList };
45
46
  export default class Pagination extends BaseComponent<PaginationProps, PaginationState> {
46
- static contextType: React.Context<import("../configProvider/context").ContextValue>;
47
+ static contextType: React.Context<ContextValue>;
47
48
  static propTypes: {
48
49
  total: PropTypes.Requireable<number>;
49
50
  showTotal: PropTypes.Requireable<boolean>;
@@ -83,6 +84,7 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
83
84
  showQuickJumper: boolean;
84
85
  };
85
86
  constructor(props: PaginationProps);
87
+ context: ContextValue;
86
88
  get adapter(): PaginationAdapter<PaginationProps, PaginationState>;
87
89
  componentDidMount(): void;
88
90
  componentWillUnmount(): void;
@@ -330,17 +330,21 @@ export default class Pagination extends BaseComponent {
330
330
 
331
331
  const itemHeight = 32;
332
332
  const listHeight = count >= 5 ? itemHeight * 5 : itemHeight * count;
333
- return /*#__PURE__*/React.createElement(List, {
334
- className: "".concat(prefixCls, "-rest-list"),
335
- itemData: restList,
336
- itemSize: itemHeight,
337
- width: 78,
338
- itemCount: count,
339
- height: listHeight,
340
- style: {
341
- direction
342
- }
343
- }, row);
333
+ return (
334
+ /*#__PURE__*/
335
+ // @ts-ignore skip type check cause react-window not update with @types/react 18
336
+ React.createElement(List, {
337
+ className: "".concat(prefixCls, "-rest-list"),
338
+ itemData: restList,
339
+ itemSize: itemHeight,
340
+ width: 78,
341
+ itemCount: count,
342
+ height: listHeight,
343
+ style: {
344
+ direction
345
+ }
346
+ }, row)
347
+ );
344
348
  }
345
349
 
346
350
  renderSmallPage(locale) {
@@ -6,6 +6,7 @@ import { PopoverProps } from '../popover';
6
6
  import { Position, Trigger } from '../tooltip';
7
7
  import { ButtonProps } from '../button';
8
8
  import { Type as ButtonType } from '../button/Button';
9
+ import { ContextValue } from '../configProvider/context';
9
10
  import '@douyinfe/semi-foundation/lib/es/popconfirm/popconfirm.css';
10
11
  import { Motion } from '../_base/base';
11
12
  export interface PopconfirmProps extends PopoverProps {
@@ -35,7 +36,7 @@ export interface PopconfirmState {
35
36
  visible: boolean;
36
37
  }
37
38
  export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
38
- static contextType: React.Context<import("../configProvider/context").ContextValue>;
39
+ static contextType: React.Context<ContextValue>;
39
40
  static propTypes: {
40
41
  motion: PropTypes.Requireable<boolean | object>;
41
42
  disabled: PropTypes.Requireable<boolean>;
@@ -77,6 +78,7 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
77
78
  onClickOutSide: (...args: any[]) => void;
78
79
  };
79
80
  constructor(props: PopconfirmProps);
81
+ context: ContextValue;
80
82
  static getDerivedStateFromProps(props: PopconfirmProps, state: PopconfirmState): Partial<PopconfirmState>;
81
83
  get adapter(): PopconfirmAdapter<PopconfirmProps, PopconfirmState>;
82
84
  handleCancel: (e: React.MouseEvent) => void;
@@ -86,5 +88,5 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
86
88
  stopImmediatePropagation: (e: React.SyntheticEvent) => void;
87
89
  renderControls(): JSX.Element;
88
90
  renderConfirmPopCard(): JSX.Element;
89
- render(): React.ReactNode;
91
+ render(): string | number | boolean | React.ReactFragment | JSX.Element;
90
92
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { ContextValue } from '../configProvider/context';
3
4
  import { ArrowBounding, Position, TooltipProps, Trigger, RenderContentProps } from '../tooltip/index';
4
5
  import '@douyinfe/semi-foundation/lib/es/popover/popover.css';
5
6
  import { BaseProps } from '../_base/baseComponent';
@@ -42,10 +43,10 @@ export interface PopoverState {
42
43
  popConfirmVisible: boolean;
43
44
  }
44
45
  declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
45
- static contextType: React.Context<import("../configProvider/context").ContextValue>;
46
+ static contextType: React.Context<ContextValue>;
46
47
  static propTypes: {
47
48
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
48
- content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
49
+ content: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
49
50
  visible: PropTypes.Requireable<boolean>;
50
51
  autoAdjustOverflow: PropTypes.Requireable<boolean>;
51
52
  motion: PropTypes.Requireable<boolean | object>;
@@ -92,6 +93,7 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
92
93
  returnFocusOnClose: boolean;
93
94
  guardFocus: boolean;
94
95
  };
96
+ context: ContextValue;
95
97
  renderPopCard: ({ initialFocusRef }: {
96
98
  initialFocusRef: RenderContentProps['initialFocusRef'];
97
99
  }) => JSX.Element;
@@ -33,7 +33,7 @@ declare class Progress extends Component<ProgressProps, ProgressState> {
33
33
  'aria-valuetext': PropTypes.Requireable<string>;
34
34
  className: PropTypes.Requireable<string>;
35
35
  direction: PropTypes.Requireable<string>;
36
- format: PropTypes.Requireable<PropTypes.ReactNodeLike>;
36
+ format: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
37
37
  id: PropTypes.Requireable<string>;
38
38
  motion: PropTypes.Requireable<boolean | object>;
39
39
  orbitStroke: PropTypes.Requireable<string>;
@@ -12,6 +12,7 @@ export declare type RadioType = typeof strings.TYPE_DEFAULT | typeof strings.TYP
12
12
  export declare type RadioProps = {
13
13
  autoFocus?: boolean;
14
14
  checked?: boolean;
15
+ children?: React.ReactNode | undefined;
15
16
  defaultChecked?: boolean;
16
17
  value?: string | number;
17
18
  disabled?: boolean;
@@ -24,6 +24,7 @@ export declare type RadioGroupProps = {
24
24
  value?: string | number;
25
25
  onChange?: (event: RadioChangeEvent) => void;
26
26
  className?: string;
27
+ children?: React.ReactNode | undefined;
27
28
  style?: React.CSSProperties;
28
29
  direction?: ArrayElement<typeof strings.DIRECTION_SET>;
29
30
  mode?: RadioMode;
@@ -39,6 +39,8 @@ export default class ScrollItem extends BaseComponent {
39
39
  this._cacheSelectorNode = selector => this._cacheNode('selector', selector);
40
40
 
41
41
  this._cacheWrapperNode = wrapper => this._cacheNode('wrapper', wrapper);
42
+ /* istanbul ignore next */
43
+
42
44
 
43
45
  this._isFirst = node => {
44
46
  const {
@@ -55,6 +57,8 @@ export default class ScrollItem extends BaseComponent {
55
57
 
56
58
  return false;
57
59
  };
60
+ /* istanbul ignore next */
61
+
58
62
 
59
63
  this._isLast = node => {
60
64
  const {
@@ -172,7 +176,7 @@ export default class ScrollItem extends BaseComponent {
172
176
  } = this;
173
177
  const wrapperHeight = wrapper.offsetHeight;
174
178
  const itemHeight = this.getItmHeight(node);
175
- const targetTop = node.offsetTop - (wrapperHeight - itemHeight) / 2;
179
+ const targetTop = (node.offsetTop || this.list.children.length * itemHeight / 2) - (wrapperHeight - itemHeight) / 2;
176
180
  this.scrollToPos(targetTop, duration);
177
181
  };
178
182
 
@@ -1,5 +1,6 @@
1
1
  import React, { MouseEvent } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { ContextValue } from '../configProvider/context';
3
4
  import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/lib/es/select/foundation';
4
5
  import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
5
6
  import { InputProps } from '../input/index';
@@ -137,7 +138,7 @@ export interface SelectState {
137
138
  isHovering: boolean;
138
139
  }
139
140
  declare class Select extends BaseComponent<SelectProps, SelectState> {
140
- static contextType: React.Context<import("../configProvider/context").ContextValue>;
141
+ static contextType: React.Context<ContextValue>;
141
142
  static Option: typeof Option;
142
143
  static OptGroup: typeof OptionGroup;
143
144
  static propTypes: {
@@ -222,6 +223,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
222
223
  selectOptionListID: string;
223
224
  clickOutsideHandler: (e: MouseEvent) => void;
224
225
  foundation: SelectFoundation;
226
+ context: ContextValue;
225
227
  constructor(props: SelectProps);
226
228
  get adapter(): SelectAdapter<SelectProps, SelectState>;
227
229
  componentDidMount(): void;
@@ -10,7 +10,7 @@ export interface OptionGroupProps {
10
10
  declare class OptionGroup extends BaseComponent<OptionGroupProps> {
11
11
  static isSelectOptionGroup: boolean;
12
12
  static propTypes: {
13
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
13
+ children: PropTypes.Requireable<any[] | PropTypes.ReactNodeLike>;
14
14
  label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
15
15
  className: PropTypes.Requireable<string>;
16
16
  style: PropTypes.Requireable<object>;
@@ -13,6 +13,7 @@ export interface SideSheetContentProps {
13
13
  style: CSSProperties;
14
14
  bodyStyle?: CSSProperties;
15
15
  className: string;
16
+ children?: React.ReactNode | undefined;
16
17
  footer?: React.ReactNode;
17
18
  'aria-label'?: string;
18
19
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Motion } from '../_base/base';
3
3
  export interface SideSheetTransitionProps {
4
- children?: React.ReactChildren | React.JSXElementConstructor<any>;
4
+ children?: React.ReactNode | ((TransitionProps: any) => React.ReactNode);
5
5
  motion?: Motion<SideSheetTransitionProps>;
6
6
  controlled?: boolean;
7
7
  visible?: boolean;
@@ -1,6 +1,7 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import BaseComponent from '../_base/baseComponent';
3
3
  import PropTypes from 'prop-types';
4
+ import { ContextValue } from '../configProvider/context';
4
5
  import { SideSheetAdapter, SideSheetProps, SideSheetState } from '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheetFoundation';
5
6
  import '@douyinfe/semi-foundation/lib/es/sideSheet/sideSheet.css';
6
7
  export { SideSheetContentProps } from './SideSheetContent';
@@ -17,7 +18,7 @@ export interface SideSheetReactProps extends SideSheetProps {
17
18
  }
18
19
  export { SideSheetState };
19
20
  export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSheetState> {
20
- static contextType: React.Context<import("../configProvider/context").ContextValue>;
21
+ static contextType: React.Context<ContextValue>;
21
22
  static propTypes: {
22
23
  bodyStyle: PropTypes.Requireable<object>;
23
24
  headerStyle: PropTypes.Requireable<object>;
@@ -48,6 +49,7 @@ export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSh
48
49
  static defaultProps: SideSheetReactProps;
49
50
  private _active;
50
51
  constructor(props: SideSheetReactProps);
52
+ context: ContextValue;
51
53
  get adapter(): SideSheetAdapter;
52
54
  static getDerivedStateFromProps(props: SideSheetReactProps, prevState: SideSheetState): Partial<SideSheetState>;
53
55
  componentDidMount(): void;
@@ -52,7 +52,7 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
52
52
  columns: PropTypes.Validator<any[]>;
53
53
  components: PropTypes.Validator<object>;
54
54
  disabled: PropTypes.Requireable<boolean>;
55
- expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
55
+ expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
56
56
  expandableRow: PropTypes.Requireable<boolean>;
57
57
  expanded: PropTypes.Requireable<boolean>;
58
58
  expandedRow: PropTypes.Requireable<boolean>;
@@ -1,6 +1,7 @@
1
1
  import React, { PureComponent, ReactNode } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Store from '@douyinfe/semi-foundation/lib/es/utils/Store';
4
+ import { TableContextProps } from '../table-context';
4
5
  import { ColumnProps, ExpandIcon, TableComponents, Virtualized, Fixed } from '../interface';
5
6
  export interface TableExpandedRowProps {
6
7
  cellWidths: number[];
@@ -27,7 +28,7 @@ export interface TableExpandedRowProps {
27
28
  * Render expanded row
28
29
  */
29
30
  export default class TableExpandedRow extends PureComponent<TableExpandedRowProps> {
30
- static contextType: React.Context<import("../table-context").TableContextProps>;
31
+ static contextType: React.Context<TableContextProps>;
31
32
  static propTypes: {
32
33
  cellWidths: PropTypes.Validator<any[]>;
33
34
  className: PropTypes.Requireable<string>;
@@ -35,7 +36,7 @@ export default class TableExpandedRow extends PureComponent<TableExpandedRowProp
35
36
  components: PropTypes.Requireable<object>;
36
37
  defaultExpandAllRows: PropTypes.Requireable<boolean>;
37
38
  defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
38
- expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
39
+ expandIcon: PropTypes.Requireable<object | PropTypes.ReactNodeLike>;
39
40
  expandRowByClick: PropTypes.Requireable<boolean>;
40
41
  expanded: PropTypes.Requireable<boolean>;
41
42
  expandedRowKeys: PropTypes.Requireable<any[]>;
@@ -55,6 +56,7 @@ export default class TableExpandedRow extends PureComponent<TableExpandedRowProp
55
56
  record: {};
56
57
  prefixCls: "semi-table";
57
58
  };
59
+ context: TableContextProps;
58
60
  render(): JSX.Element;
59
61
  }
60
62
  export declare type ExpandedRowRenderReturnType = React.ReactNode | {
@@ -1,6 +1,7 @@
1
1
  import React, { PureComponent, ReactNode } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Store from '@douyinfe/semi-foundation/lib/es/utils/Store';
4
+ import { TableContextProps } from '../table-context';
4
5
  import { ColumnProps, RenderGroupSection, OnGroupedRow, TableComponents, Virtualized, RowKey, OnRowReturnObject } from '../interface';
5
6
  export interface SectionRowProps {
6
7
  record?: Record<string, any>;
@@ -27,7 +28,7 @@ export interface SectionRowProps {
27
28
  * Grouping component title row
28
29
  */
29
30
  declare class SectionRow extends PureComponent<SectionRowProps> {
30
- static contextType: React.Context<import("../table-context").TableContextProps>;
31
+ static contextType: React.Context<TableContextProps>;
31
32
  static propTypes: {
32
33
  record: PropTypes.Requireable<object>;
33
34
  index: PropTypes.Requireable<number>;
@@ -58,6 +59,7 @@ declare class SectionRow extends PureComponent<SectionRowProps> {
58
59
  };
59
60
  };
60
61
  };
62
+ context: TableContextProps;
61
63
  onRow: (...args: any[]) => OnRowReturnObject;
62
64
  collectGroupedData: () => Record<string, any>[];
63
65
  renderExpandIcon: (record: any) => React.ReactNode;
@@ -27,7 +27,7 @@ export default class Column extends React.PureComponent<ColumnProps> {
27
27
  sortDirections: import("prop-types").Requireable<string[]>;
28
28
  sortOrder: import("prop-types").Requireable<string | boolean>;
29
29
  sorter: import("prop-types").Requireable<boolean | ((...args: any[]) => any)>;
30
- title: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
30
+ title: import("prop-types").Requireable<import("prop-types").ReactNodeLike | ((...args: any[]) => any)>;
31
31
  useFullRender: import("prop-types").Requireable<boolean>;
32
32
  width: import("prop-types").Requireable<string | number>;
33
33
  };
@@ -25,7 +25,7 @@ declare const _default: {
25
25
  sortDirections: PropTypes.Requireable<string[]>;
26
26
  sortOrder: PropTypes.Requireable<string | boolean>;
27
27
  sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
28
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
28
+ title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
29
29
  useFullRender: PropTypes.Requireable<boolean>;
30
30
  width: PropTypes.Requireable<string | number>;
31
31
  };
@@ -21,7 +21,7 @@ declare namespace CustomExpandIcon {
21
21
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
22
22
  onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
23
23
  onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
24
- expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
24
+ expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
25
25
  prefixCls: PropTypes.Requireable<string>;
26
26
  motion: PropTypes.Requireable<boolean>;
27
27
  };
@@ -80,15 +80,15 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
80
80
  sortDirections: PropTypes.Requireable<string[]>;
81
81
  sortOrder: PropTypes.Requireable<string | boolean>;
82
82
  sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
83
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
83
+ title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
84
84
  useFullRender: PropTypes.Requireable<boolean>;
85
85
  width: PropTypes.Requireable<string | number>;
86
86
  }>[]>;
87
87
  hideExpandedColumn: PropTypes.Requireable<boolean>;
88
88
  id: PropTypes.Requireable<string>;
89
- expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
89
+ expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
90
90
  expandCellFixed: PropTypes.Requireable<boolean | "left" | "right">;
91
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
91
+ title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
92
92
  onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
93
93
  showHeader: PropTypes.Requireable<boolean>;
94
94
  indentSize: PropTypes.Requireable<number>;
@@ -106,7 +106,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
106
106
  defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
107
107
  pagination: PropTypes.Requireable<boolean | object>;
108
108
  renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
109
- footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
109
+ footer: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
110
110
  empty: PropTypes.Requireable<PropTypes.ReactNodeLike>;
111
111
  dataSource: PropTypes.Requireable<any[]>;
112
112
  childrenRecordName: PropTypes.Requireable<string>;
@@ -167,6 +167,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
167
167
  scrollPosition: BodyScrollPosition;
168
168
  position: BodyScrollPosition;
169
169
  foundation: TableFoundation<RecordType>;
170
+ context: TableContextProps;
170
171
  constructor(props: NormalTableProps<RecordType>, context: TableContextProps);
171
172
  static getDerivedStateFromProps(props: NormalTableProps, state: NormalTableState): Partial<NormalTableState<Data>>;
172
173
  componentDidMount(): void;
@@ -191,7 +192,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
191
192
  setScrollPosition: (position: BodyScrollPosition) => void;
192
193
  setScrollPositionClassName: () => void;
193
194
  syncTableWidth: () => void;
194
- renderSelection: (record?: RecordType, inHeader?: boolean) => React.ReactNode;
195
+ renderSelection: (record?: any, inHeader?: boolean) => React.ReactNode;
195
196
  renderRowSelectionCallback: (text: string, record?: RecordType) => React.ReactNode;
196
197
  renderTitleSelectionCallback: () => React.ReactNode;
197
198
  normalizeSelectionColumn: (props?: {
@@ -234,7 +235,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
234
235
  */
235
236
  renderPagination: (pagination: TablePaginationProps, propRenderPagination: RenderPagination) => JSX.Element;
236
237
  renderTitle: (props?: {
237
- title?: ReactNode;
238
+ title?: React.ReactNode | ((dataSource?: RecordType[]) => ReactNode);
238
239
  prefixCls?: string;
239
240
  dataSource?: any[];
240
241
  }) => JSX.Element;
@@ -244,7 +245,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
244
245
  dataSource?: RecordType[];
245
246
  }) => JSX.Element;
246
247
  renderFooter: (props?: {
247
- footer?: ReactNode;
248
+ footer?: React.ReactNode | ((dataSource?: RecordType[]) => ReactNode);
248
249
  prefixCls?: string;
249
250
  dataSource?: RecordType[];
250
251
  }) => JSX.Element;
@@ -283,6 +284,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
283
284
  formatPageText?: import("./interface").FormatPageText;
284
285
  style?: React.CSSProperties;
285
286
  className?: string;
287
+ children?: any;
286
288
  total?: number;
287
289
  showTotal?: boolean;
288
290
  pageSize?: number;
@@ -292,7 +294,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
292
294
  defaultCurrentPage?: number;
293
295
  onPageChange?: (currentPage: number) => void;
294
296
  onPageSizeChange?: (newPageSize: number) => void;
295
- onChange: ((currentPage: number, pageSize: number) => void) | ((currentPage: number, currentPageSize: number) => void);
297
+ onChange: (currentPage: number, pageSize: number) => void;
296
298
  prevText?: React.ReactNode;
297
299
  nextText?: React.ReactNode;
298
300
  showSizeChanger?: boolean;
@@ -2,7 +2,8 @@ import React, { ReactNode } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { TableCellAdapter } from '@douyinfe/semi-foundation/lib/es/table/cellFoundation';
4
4
  import BaseComponent, { BaseProps } from '../_base/baseComponent';
5
- import { ColumnProps } from './interface';
5
+ import { TableContextProps } from './table-context';
6
+ import { ColumnProps, ExpandIcon } from './interface';
6
7
  export interface TableCellProps extends BaseProps {
7
8
  record?: Record<string, any>;
8
9
  prefixCls?: string;
@@ -19,7 +20,7 @@ export interface TableCellProps extends BaseProps {
19
20
  * When hideExpandedColumn is true or isSection is true
20
21
  * expandIcon is a custom icon or true
21
22
  */
22
- expandIcon?: ReactNode | boolean;
23
+ expandIcon?: ExpandIcon;
23
24
  renderExpandIcon?: (record: Record<string, any>) => ReactNode;
24
25
  hideExpandedColumn?: boolean;
25
26
  component?: any;
@@ -34,7 +35,7 @@ export interface TableCellProps extends BaseProps {
34
35
  colIndex?: number;
35
36
  }
36
37
  export default class TableCell extends BaseComponent<TableCellProps, Record<string, any>> {
37
- static contextType: React.Context<import("./table-context").TableContextProps>;
38
+ static contextType: React.Context<TableContextProps>;
38
39
  static defaultProps: {
39
40
  indent: number;
40
41
  indentSize: 20;
@@ -70,6 +71,7 @@ export default class TableCell extends BaseComponent<TableCellProps, Record<stri
70
71
  };
71
72
  get adapter(): TableCellAdapter;
72
73
  ref: React.MutableRefObject<any>;
74
+ context: TableContextProps;
73
75
  constructor(props: TableCellProps);
74
76
  /**
75
77
  * Control whether to execute the render function of the cell
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import BaseComponent from '../_base/baseComponent';
4
+ import { TableContextProps } from './table-context';
4
5
  import { TableComponents, OnHeaderRow, Fixed } from './interface';
5
6
  export interface TableHeaderRowProps {
6
7
  components?: TableComponents;
@@ -14,7 +15,7 @@ export interface TableHeaderRowProps {
14
15
  selectedRowKeysSet: Set<any>;
15
16
  }
16
17
  export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, Record<string, any>> {
17
- static contextType: React.Context<import("./table-context").TableContextProps>;
18
+ static contextType: React.Context<TableContextProps>;
18
19
  static propTypes: {
19
20
  components: PropTypes.Requireable<object>;
20
21
  row: PropTypes.Requireable<any[]>;
@@ -52,6 +53,7 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
52
53
  stopPropagation(e: any): void;
53
54
  };
54
55
  headerNode: HTMLElement;
56
+ context: TableContextProps;
55
57
  constructor(props: TableHeaderRowProps);
56
58
  cacheRef: (node: HTMLElement) => void;
57
59
  componentDidUpdate(prevProps: TableHeaderRowProps): void;
@@ -43,15 +43,15 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
43
43
  sortDirections: PropTypes.Requireable<string[]>;
44
44
  sortOrder: PropTypes.Requireable<string | boolean>;
45
45
  sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
46
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
46
+ title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
47
47
  useFullRender: PropTypes.Requireable<boolean>;
48
48
  width: PropTypes.Requireable<string | number>;
49
49
  }>[]>;
50
50
  hideExpandedColumn: PropTypes.Requireable<boolean>;
51
51
  id: PropTypes.Requireable<string>;
52
- expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
52
+ expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
53
53
  expandCellFixed: PropTypes.Requireable<boolean | "left" | "right">;
54
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
54
+ title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
55
55
  onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
56
56
  showHeader: PropTypes.Requireable<boolean>;
57
57
  indentSize: PropTypes.Requireable<number>;
@@ -69,7 +69,7 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
69
69
  defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
70
70
  pagination: PropTypes.Requireable<boolean | object>;
71
71
  renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
72
- footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
72
+ footer: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
73
73
  empty: PropTypes.Requireable<PropTypes.ReactNodeLike>;
74
74
  dataSource: PropTypes.Requireable<any[]>;
75
75
  childrenRecordName: PropTypes.Requireable<string>;
@@ -1,17 +1,18 @@
1
1
  import React from 'react';
2
- import { ColumnProps, GetVirtualizedListRef } from './interface';
2
+ import { ColumnProps, GetVirtualizedListRef, RowKey } from './interface';
3
+ import { BaseHeadWidth } from '@douyinfe/semi-foundation/lib/es/table/foundation';
3
4
  export interface TableContextProps {
4
5
  children?: React.ReactNode;
5
6
  anyColumnFixed?: boolean;
6
7
  flattenedColumns?: ColumnProps[];
7
- tableWidth?: number[];
8
- headWidths?: number[];
9
- setHeadWidths?: (headWidth?: number[], index?: number) => void;
8
+ tableWidth?: number;
9
+ headWidths?: BaseHeadWidth[][];
10
+ setHeadWidths?: (headWidth?: BaseHeadWidth[], index?: number) => void;
10
11
  getHeadWidths?: (index?: number) => number[];
11
12
  getCellWidths?: (flattenColumns: ColumnProps[], flattenedWidths?: number[], ignoreScrollBarKey?: boolean) => number[];
12
- handleRowExpanded?: (expanded: boolean, realKey: string, domEvent: React.MouseEvent<HTMLElement>) => void;
13
+ handleRowExpanded?: (expanded: boolean, realKey: RowKey<any>, domEvent: React.MouseEvent<HTMLElement>) => void;
13
14
  renderExpandIcon?: (record: Record<string, any>, isNested?: boolean, groupKey?: string | number) => React.ReactNode;
14
- renderSelection?: (record: Record<string, any>, isHeader?: boolean) => React.ReactNode;
15
+ renderSelection?: (record?: Record<string, any>, isHeader?: boolean) => React.ReactNode;
15
16
  getVirtualizedListRef?: GetVirtualizedListRef;
16
17
  setBodyHasScrollbar?: (bodyHasScrollBar: boolean) => void;
17
18
  }
@@ -1,9 +1,10 @@
1
1
  import React, { PureComponent, ReactNode } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { TabContextValue } from './interface';
3
4
  import { PlainTab, TabPaneProps } from './interface';
4
5
  declare class TabPane extends PureComponent<TabPaneProps> {
5
6
  static isTabPane: boolean;
6
- static contextType: React.Context<import("./interface").TabContextValue>;
7
+ static contextType: React.Context<TabContextValue>;
7
8
  static propTypes: {
8
9
  className: PropTypes.Requireable<string>;
9
10
  style: PropTypes.Requireable<object>;
@@ -18,6 +19,7 @@ declare class TabPane extends PureComponent<TabPaneProps> {
18
19
  ref: React.RefObject<HTMLDivElement>;
19
20
  isAnimating: boolean;
20
21
  _active: boolean;
22
+ context: TabContextValue;
21
23
  componentDidMount(): void;
22
24
  getDirection: (activeKey: string, itemKey: string, panes: Array<PlainTab>) => boolean;
23
25
  hideScroll: () => void;
@@ -48,6 +48,8 @@ class TabPane extends PureComponent {
48
48
 
49
49
  return false;
50
50
  };
51
+ /* istanbul ignore next */
52
+
51
53
 
52
54
  this.hideScroll = () => {
53
55
  if (this.ref && this.ref.current) {
@@ -55,6 +57,8 @@ class TabPane extends PureComponent {
55
57
  this.isAnimating = true;
56
58
  }
57
59
  };
60
+ /* istanbul ignore next */
61
+
58
62
 
59
63
  this.autoScroll = () => {
60
64
  if (this.ref && this.ref.current) {
@@ -49,6 +49,8 @@ class Tabs extends BaseComponent {
49
49
  this.onTabClick = (activeKey, event) => {
50
50
  this.foundation.handleTabClick(activeKey, event);
51
51
  };
52
+ /* istanbul ignore next */
53
+
52
54
 
53
55
  this.rePosChildren = (children, activeKey) => {
54
56
  const newChildren = [];
@@ -1,4 +1,4 @@
1
- import { ComponentType, CSSProperties, MouseEvent, ReactNode } from 'react';
1
+ import React, { ComponentType, CSSProperties, MouseEvent, ReactNode } from 'react';
2
2
  import { Motion } from '../_base/base';
3
3
  export declare type TabType = 'line' | 'card' | 'button';
4
4
  export declare type TabSize = 'small' | 'medium' | 'large';
@@ -51,6 +51,7 @@ export interface TabBarProps {
51
51
  }
52
52
  export interface TabPaneProps {
53
53
  className?: string;
54
+ children?: React.ReactNode | undefined;
54
55
  disabled?: boolean;
55
56
  icon?: ReactNode;
56
57
  itemKey?: string;
@@ -35,7 +35,7 @@ export default class TagGroup extends PureComponent<TagGroupProps> {
35
35
  popoverProps: PropTypes.Requireable<object>;
36
36
  avatarShape: PropTypes.Requireable<string>;
37
37
  };
38
- renderNTag(n: number, restTags: (Tag | React.ReactNode)[]): JSX.Element;
38
+ renderNTag(n: number, restTags: React.ReactNode): JSX.Element;
39
39
  renderMergeTags(tags: (Tag | React.ReactNode)[]): (React.ReactNode | Tag)[];
40
40
  renderAllTags(): (React.ReactNode | Tag)[];
41
41
  render(): JSX.Element;