rsuite 5.2.3 → 5.4.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 (495) hide show
  1. package/Avatar/styles/index.less +2 -2
  2. package/AvatarGroup/package.json +7 -0
  3. package/AvatarGroup/styles/index.less +19 -0
  4. package/ButtonGroup/styles/index.less +0 -18
  5. package/CHANGELOG.md +63 -0
  6. package/CheckTreePicker/styles/index.less +14 -1
  7. package/Dropdown/styles/index.less +4 -3
  8. package/Nav/styles/index.less +1 -0
  9. package/Navbar/styles/index.less +7 -0
  10. package/Radio/styles/index.less +6 -0
  11. package/Sidenav/styles/index.less +2 -2
  12. package/Stack/package.json +7 -0
  13. package/Stack/styles/index.less +5 -0
  14. package/Table/styles/index.less +0 -4
  15. package/TreePicker/styles/index.less +10 -14
  16. package/cjs/@types/common.d.ts +13 -12
  17. package/cjs/@types/utils.d.ts +12 -0
  18. package/cjs/Affix/Affix.js +5 -5
  19. package/cjs/Animation/Transition.d.ts +21 -12
  20. package/cjs/Animation/Transition.js +4 -1
  21. package/cjs/AutoComplete/AutoComplete.js +1 -1
  22. package/cjs/AutoComplete/utils.d.ts +1 -1
  23. package/cjs/Avatar/Avatar.js +10 -3
  24. package/cjs/AvatarGroup/AvatarGroup.d.ts +15 -0
  25. package/cjs/AvatarGroup/AvatarGroup.js +76 -0
  26. package/cjs/AvatarGroup/index.d.ts +3 -0
  27. package/cjs/AvatarGroup/index.js +11 -0
  28. package/cjs/Breadcrumb/Breadcrumb.js +1 -1
  29. package/cjs/Button/Button.js +8 -2
  30. package/cjs/ButtonGroup/ButtonGroup.js +14 -3
  31. package/cjs/ButtonGroup/ButtonGroupContext.d.ts +7 -0
  32. package/cjs/ButtonGroup/ButtonGroupContext.js +13 -0
  33. package/cjs/ButtonGroup/index.d.ts +2 -0
  34. package/cjs/ButtonGroup/index.js +3 -0
  35. package/cjs/Calendar/Calendar.d.ts +4 -4
  36. package/cjs/Calendar/Calendar.js +26 -22
  37. package/cjs/Calendar/CalendarContext.js +1 -1
  38. package/cjs/Calendar/Header.js +1 -3
  39. package/cjs/Calendar/Table.js +1 -1
  40. package/cjs/Calendar/TableRow.js +13 -8
  41. package/cjs/Calendar/TimeDropdown.js +6 -5
  42. package/cjs/Calendar/View.js +9 -5
  43. package/cjs/Calendar/types.d.ts +2 -2
  44. package/cjs/Calendar/useCalendarDate.d.ts +2 -2
  45. package/cjs/Carousel/Carousel.d.ts +2 -2
  46. package/cjs/Carousel/Carousel.js +1 -1
  47. package/cjs/Cascader/Cascader.d.ts +1 -1
  48. package/cjs/Cascader/Cascader.js +10 -10
  49. package/cjs/Cascader/DropdownMenu.d.ts +5 -4
  50. package/cjs/Cascader/utils.d.ts +10 -10
  51. package/cjs/CheckPicker/CheckPicker.d.ts +9 -4
  52. package/cjs/CheckPicker/CheckPicker.js +4 -4
  53. package/cjs/CheckPicker/test/CheckPicker.test.d.ts +1 -0
  54. package/cjs/CheckPicker/test/CheckPicker.test.js +76 -0
  55. package/cjs/CheckTree/index.js +6 -5
  56. package/cjs/CheckTreePicker/CheckTreeNode.d.ts +1 -1
  57. package/cjs/CheckTreePicker/CheckTreeNode.js +7 -9
  58. package/cjs/CheckTreePicker/CheckTreePicker.js +34 -27
  59. package/cjs/CheckTreePicker/utils.d.ts +3 -1
  60. package/cjs/CheckTreePicker/utils.js +12 -10
  61. package/cjs/Checkbox/Checkbox.d.ts +1 -1
  62. package/cjs/Container/Container.js +6 -3
  63. package/cjs/CustomProvider/CustomProvider.d.ts +31 -57
  64. package/cjs/DOMHelper/index.d.ts +12 -12
  65. package/cjs/DatePicker/DatePicker.d.ts +1 -1
  66. package/cjs/DatePicker/DatePicker.js +19 -11
  67. package/cjs/DatePicker/Toolbar.d.ts +12 -9
  68. package/cjs/DatePicker/Toolbar.js +6 -8
  69. package/cjs/DatePicker/types.d.ts +4 -4
  70. package/cjs/DatePicker/utils.d.ts +4 -3
  71. package/cjs/DateRangePicker/Calendar.d.ts +9 -7
  72. package/cjs/DateRangePicker/Calendar.js +27 -6
  73. package/cjs/DateRangePicker/DateRangePicker.d.ts +8 -6
  74. package/cjs/DateRangePicker/DateRangePicker.js +133 -110
  75. package/cjs/DateRangePicker/types.d.ts +2 -1
  76. package/cjs/DateRangePicker/utils.d.ts +6 -6
  77. package/cjs/DateRangePicker/utils.js +7 -2
  78. package/cjs/Disclosure/Disclosure.js +6 -4
  79. package/cjs/Disclosure/DisclosureButton.js +9 -7
  80. package/cjs/Disclosure/DisclosureContent.js +4 -6
  81. package/cjs/Disclosure/DisclosureContext.d.ts +2 -2
  82. package/cjs/Disclosure/useDisclosureContext.d.ts +2 -0
  83. package/cjs/Disclosure/useDisclosureContext.js +20 -0
  84. package/cjs/Dropdown/Dropdown.d.ts +1 -1
  85. package/cjs/Dropdown/DropdownContext.d.ts +2 -2
  86. package/cjs/Dropdown/DropdownItem.js +1 -1
  87. package/cjs/Dropdown/DropdownMenu.d.ts +3 -3
  88. package/cjs/Dropdown/DropdownMenu.js +9 -6
  89. package/cjs/Dropdown/DropdownState.d.ts +1 -1
  90. package/cjs/Dropdown/DropdownToggle.js +10 -2
  91. package/cjs/Dropdown/useRenderDropdownItem.d.ts +1 -1
  92. package/cjs/Form/Form.js +1 -1
  93. package/cjs/Form/FormContext.d.ts +1 -1
  94. package/cjs/FormControl/FormControl.d.ts +1 -1
  95. package/cjs/FormControl/FormControl.js +5 -4
  96. package/cjs/FormGroup/FormGroup.d.ts +1 -1
  97. package/cjs/FormGroup/FormGroup.js +9 -4
  98. package/cjs/Input/Input.d.ts +3 -2
  99. package/cjs/InputGroup/InputGroup.d.ts +1 -1
  100. package/cjs/InputNumber/InputNumber.js +6 -2
  101. package/cjs/InputPicker/InputAutosize.js +4 -4
  102. package/cjs/InputPicker/InputPicker.d.ts +2 -2
  103. package/cjs/InputPicker/InputPicker.js +15 -10
  104. package/cjs/List/ListContext.d.ts +1 -1
  105. package/cjs/List/ListContext.js +8 -1
  106. package/cjs/List/helper/AutoScroller.js +4 -2
  107. package/cjs/List/helper/useManager.d.ts +3 -3
  108. package/cjs/List/helper/useManager.js +1 -1
  109. package/cjs/List/helper/useSortHelper.d.ts +3 -3
  110. package/cjs/List/helper/useSortHelper.js +6 -4
  111. package/cjs/List/helper/utils.d.ts +2 -2
  112. package/cjs/MaskedInput/TextMask.d.ts +5 -5
  113. package/cjs/MaskedInput/adjustCaretPosition.d.ts +6 -6
  114. package/cjs/MaskedInput/conformToMask.js +5 -4
  115. package/cjs/MaskedInput/createTextMaskInputElement.d.ts +2 -2
  116. package/cjs/MaskedInput/utilities.d.ts +1 -1
  117. package/cjs/Menu/Menu.js +14 -7
  118. package/cjs/Menu/MenuContext.d.ts +1 -1
  119. package/cjs/Menu/MenuItem.d.ts +1 -1
  120. package/cjs/Menu/MenuItem.js +19 -15
  121. package/cjs/Menu/Menubar.js +8 -8
  122. package/cjs/Menu/useMenu.js +17 -7
  123. package/cjs/Modal/Modal.js +12 -6
  124. package/cjs/Modal/ModalContext.d.ts +2 -2
  125. package/cjs/Modal/utils.d.ts +1 -1
  126. package/cjs/Modal/utils.js +3 -5
  127. package/cjs/MultiCascader/DropdownMenu.d.ts +4 -4
  128. package/cjs/MultiCascader/MultiCascader.js +6 -6
  129. package/cjs/MultiCascader/utils.d.ts +17 -17
  130. package/cjs/Nav/Nav.d.ts +1 -1
  131. package/cjs/Nav/Nav.js +10 -12
  132. package/cjs/Nav/NavContext.d.ts +7 -1
  133. package/cjs/Nav/NavContext.js +1 -0
  134. package/cjs/Nav/NavItem.d.ts +1 -1
  135. package/cjs/Navbar/Navbar.js +1 -1
  136. package/cjs/Navbar/NavbarItem.d.ts +1 -1
  137. package/cjs/Overlay/Modal.d.ts +2 -2
  138. package/cjs/Overlay/Modal.js +70 -45
  139. package/cjs/Overlay/ModalManager.d.ts +17 -8
  140. package/cjs/Overlay/ModalManager.js +11 -20
  141. package/cjs/Overlay/Overlay.d.ts +3 -3
  142. package/cjs/Overlay/Overlay.js +8 -2
  143. package/cjs/Overlay/OverlayContext.d.ts +6 -0
  144. package/cjs/Overlay/OverlayContext.js +14 -0
  145. package/cjs/Overlay/OverlayTrigger.d.ts +11 -11
  146. package/cjs/Overlay/OverlayTrigger.js +21 -7
  147. package/cjs/Overlay/Position.d.ts +4 -4
  148. package/cjs/Overlay/Position.js +14 -8
  149. package/cjs/Overlay/positionUtils.d.ts +1 -1
  150. package/cjs/Overlay/positionUtils.js +8 -8
  151. package/cjs/Pagination/Pagination.d.ts +1 -1
  152. package/cjs/Pagination/PaginationButton.d.ts +3 -3
  153. package/cjs/Pagination/PaginationGroup.js +5 -3
  154. package/cjs/Panel/Panel.d.ts +1 -1
  155. package/cjs/Panel/Panel.js +2 -2
  156. package/cjs/PanelGroup/PanelGroup.d.ts +2 -2
  157. package/cjs/PanelGroup/PanelGroup.js +8 -5
  158. package/cjs/Picker/DropdownMenu.d.ts +8 -5
  159. package/cjs/Picker/DropdownMenu.js +5 -5
  160. package/cjs/Picker/PickerOverlay.js +4 -3
  161. package/cjs/Picker/PickerToggle.js +4 -3
  162. package/cjs/Picker/PickerToggleTrigger.d.ts +2 -6
  163. package/cjs/Picker/SearchBar.d.ts +1 -1
  164. package/cjs/Picker/SelectedElement.js +2 -1
  165. package/cjs/Picker/VirtualizedList.d.ts +29 -2
  166. package/cjs/Picker/propTypes.d.ts +5 -7
  167. package/cjs/Picker/propTypes.js +4 -3
  168. package/cjs/Picker/utils.d.ts +15 -23
  169. package/cjs/Picker/utils.js +71 -46
  170. package/cjs/Placeholder/PlaceholderGrid.js +1 -1
  171. package/cjs/Plaintext/Plaintext.js +2 -1
  172. package/cjs/Radio/Radio.d.ts +1 -1
  173. package/cjs/RadioGroup/RadioGroup.d.ts +2 -2
  174. package/cjs/RadioGroup/RadioGroup.js +1 -1
  175. package/cjs/RangeSlider/RangeSlider.d.ts +2 -2
  176. package/cjs/RangeSlider/RangeSlider.js +6 -4
  177. package/cjs/Rate/Character.js +4 -2
  178. package/cjs/Rate/Rate.js +2 -1
  179. package/cjs/Ripple/Ripple.js +1 -1
  180. package/cjs/SelectPicker/SelectPicker.d.ts +12 -5
  181. package/cjs/SelectPicker/SelectPicker.js +8 -8
  182. package/cjs/SelectPicker/index.d.ts +1 -1
  183. package/cjs/SelectPicker/test/SelectPicker.test.d.ts +1 -0
  184. package/cjs/SelectPicker/test/SelectPicker.test.js +62 -0
  185. package/cjs/Sidenav/Node.d.ts +1 -1
  186. package/cjs/Sidenav/Sidenav.d.ts +4 -4
  187. package/cjs/Sidenav/Sidenav.js +5 -2
  188. package/cjs/Sidenav/SidenavDropdown.js +11 -8
  189. package/cjs/Sidenav/SidenavDropdownItem.js +10 -5
  190. package/cjs/Sidenav/SidenavDropdownMenu.js +9 -5
  191. package/cjs/Sidenav/SidenavItem.d.ts +1 -1
  192. package/cjs/Sidenav/SidenavItem.js +4 -0
  193. package/cjs/Slider/Graduated.d.ts +5 -5
  194. package/cjs/Slider/Handle.d.ts +1 -1
  195. package/cjs/Slider/Handle.js +10 -6
  196. package/cjs/Slider/Mark.d.ts +1 -1
  197. package/cjs/Slider/Slider.d.ts +1 -1
  198. package/cjs/Slider/Slider.js +2 -2
  199. package/cjs/Slider/utils.d.ts +2 -1
  200. package/cjs/Slider/utils.js +4 -5
  201. package/cjs/Stack/Stack.d.ts +26 -0
  202. package/cjs/Stack/Stack.js +86 -0
  203. package/cjs/Stack/index.d.ts +3 -0
  204. package/cjs/Stack/index.js +11 -0
  205. package/cjs/Steps/StepItem.js +1 -1
  206. package/cjs/TagInput/index.js +1 -1
  207. package/cjs/Toggle/Toggle.js +5 -4
  208. package/cjs/Tree/Tree.d.ts +3 -2
  209. package/cjs/Tree/Tree.js +6 -5
  210. package/cjs/Tree/TreeContext.d.ts +0 -1
  211. package/cjs/TreePicker/TreeNode.js +7 -22
  212. package/cjs/TreePicker/TreePicker.js +37 -54
  213. package/cjs/Uploader/UploadFileItem.d.ts +1 -1
  214. package/cjs/Uploader/UploadFileItem.js +2 -2
  215. package/cjs/Uploader/UploadTrigger.d.ts +1 -1
  216. package/cjs/Uploader/UploadTrigger.js +2 -3
  217. package/cjs/Uploader/Uploader.d.ts +5 -5
  218. package/cjs/Uploader/Uploader.js +1 -2
  219. package/cjs/index.d.ts +6 -2
  220. package/cjs/index.js +13 -5
  221. package/cjs/locales/index.d.ts +3 -3
  222. package/cjs/toaster/ToastContainer.d.ts +1 -1
  223. package/cjs/toaster/ToastContainer.js +1 -1
  224. package/cjs/toaster/toaster.js +3 -1
  225. package/cjs/utils/BrowserDetection.js +1 -1
  226. package/cjs/utils/ReactChildren.d.ts +2 -2
  227. package/cjs/utils/ajaxUpload.d.ts +1 -1
  228. package/cjs/utils/ajaxUpload.js +5 -4
  229. package/cjs/utils/appendTooltip.d.ts +1 -1
  230. package/cjs/utils/constants.d.ts +4 -4
  231. package/cjs/utils/createChainedFunction.d.ts +1 -1
  232. package/cjs/utils/getDataGroupBy.d.ts +1 -1
  233. package/cjs/utils/mergeRefs.d.ts +2 -2
  234. package/cjs/utils/previewFile.d.ts +1 -1
  235. package/cjs/utils/propTypeChecker.d.ts +6 -2
  236. package/cjs/utils/propTypeChecker.js +7 -6
  237. package/cjs/utils/reactToString.d.ts +2 -1
  238. package/cjs/utils/statusIcons.d.ts +1 -1
  239. package/cjs/utils/stringToObject.d.ts +1 -1
  240. package/cjs/utils/treeUtils.d.ts +35 -32
  241. package/cjs/utils/treeUtils.js +46 -23
  242. package/cjs/utils/useControlled.d.ts +6 -1
  243. package/cjs/utils/useControlled.js +0 -8
  244. package/cjs/utils/useCustom.js +6 -4
  245. package/cjs/utils/useFocus.d.ts +2 -2
  246. package/cjs/utils/usePortal.d.ts +2 -2
  247. package/cjs/utils/useRootClose.d.ts +2 -2
  248. package/cjs/utils/useTimeout.d.ts +1 -1
  249. package/cjs/utils/useTimeout.js +5 -3
  250. package/dist/rsuite-rtl.css +63 -193
  251. package/dist/rsuite-rtl.min.css +1 -1
  252. package/dist/rsuite-rtl.min.css.map +1 -1
  253. package/dist/rsuite.css +63 -193
  254. package/dist/rsuite.js +194 -117
  255. package/dist/rsuite.js.map +1 -1
  256. package/dist/rsuite.min.css +1 -1
  257. package/dist/rsuite.min.css.map +1 -1
  258. package/dist/rsuite.min.js +1 -1
  259. package/dist/rsuite.min.js.map +1 -1
  260. package/esm/@types/common.d.ts +13 -12
  261. package/esm/@types/utils.d.ts +12 -0
  262. package/esm/Affix/Affix.js +5 -5
  263. package/esm/Animation/Transition.d.ts +21 -12
  264. package/esm/Animation/Transition.js +4 -1
  265. package/esm/AutoComplete/AutoComplete.js +1 -1
  266. package/esm/AutoComplete/utils.d.ts +1 -1
  267. package/esm/Avatar/Avatar.js +7 -3
  268. package/esm/AvatarGroup/AvatarGroup.d.ts +15 -0
  269. package/esm/AvatarGroup/AvatarGroup.js +57 -0
  270. package/esm/AvatarGroup/index.d.ts +3 -0
  271. package/esm/AvatarGroup/index.js +2 -0
  272. package/esm/Breadcrumb/Breadcrumb.js +1 -1
  273. package/esm/Button/Button.js +6 -2
  274. package/esm/ButtonGroup/ButtonGroup.js +11 -3
  275. package/esm/ButtonGroup/ButtonGroupContext.d.ts +7 -0
  276. package/esm/ButtonGroup/ButtonGroupContext.js +3 -0
  277. package/esm/ButtonGroup/index.d.ts +2 -0
  278. package/esm/ButtonGroup/index.js +2 -0
  279. package/esm/Calendar/Calendar.d.ts +4 -4
  280. package/esm/Calendar/Calendar.js +27 -23
  281. package/esm/Calendar/CalendarContext.js +1 -1
  282. package/esm/Calendar/Header.js +1 -3
  283. package/esm/Calendar/Table.js +1 -1
  284. package/esm/Calendar/TableRow.js +14 -9
  285. package/esm/Calendar/TimeDropdown.js +5 -4
  286. package/esm/Calendar/View.js +10 -6
  287. package/esm/Calendar/types.d.ts +2 -2
  288. package/esm/Calendar/useCalendarDate.d.ts +2 -2
  289. package/esm/Carousel/Carousel.d.ts +2 -2
  290. package/esm/Carousel/Carousel.js +1 -1
  291. package/esm/Cascader/Cascader.d.ts +1 -1
  292. package/esm/Cascader/Cascader.js +10 -10
  293. package/esm/Cascader/DropdownMenu.d.ts +5 -4
  294. package/esm/Cascader/utils.d.ts +10 -10
  295. package/esm/CheckPicker/CheckPicker.d.ts +9 -4
  296. package/esm/CheckPicker/CheckPicker.js +4 -4
  297. package/esm/CheckPicker/test/CheckPicker.test.d.ts +1 -0
  298. package/esm/CheckPicker/test/CheckPicker.test.js +64 -0
  299. package/esm/CheckTree/index.js +7 -6
  300. package/esm/CheckTreePicker/CheckTreeNode.d.ts +1 -1
  301. package/esm/CheckTreePicker/CheckTreeNode.js +4 -7
  302. package/esm/CheckTreePicker/CheckTreePicker.js +33 -25
  303. package/esm/CheckTreePicker/utils.d.ts +3 -1
  304. package/esm/CheckTreePicker/utils.js +12 -10
  305. package/esm/Checkbox/Checkbox.d.ts +1 -1
  306. package/esm/Container/Container.js +7 -4
  307. package/esm/CustomProvider/CustomProvider.d.ts +31 -57
  308. package/esm/DOMHelper/index.d.ts +12 -12
  309. package/esm/DatePicker/DatePicker.d.ts +1 -1
  310. package/esm/DatePicker/DatePicker.js +18 -11
  311. package/esm/DatePicker/Toolbar.d.ts +12 -9
  312. package/esm/DatePicker/Toolbar.js +6 -8
  313. package/esm/DatePicker/types.d.ts +4 -4
  314. package/esm/DatePicker/utils.d.ts +4 -3
  315. package/esm/DateRangePicker/Calendar.d.ts +9 -7
  316. package/esm/DateRangePicker/Calendar.js +28 -6
  317. package/esm/DateRangePicker/DateRangePicker.d.ts +8 -6
  318. package/esm/DateRangePicker/DateRangePicker.js +131 -110
  319. package/esm/DateRangePicker/types.d.ts +2 -1
  320. package/esm/DateRangePicker/utils.d.ts +6 -6
  321. package/esm/DateRangePicker/utils.js +6 -2
  322. package/esm/Disclosure/Disclosure.js +6 -4
  323. package/esm/Disclosure/DisclosureButton.js +8 -7
  324. package/esm/Disclosure/DisclosureContent.js +5 -7
  325. package/esm/Disclosure/DisclosureContext.d.ts +2 -2
  326. package/esm/Disclosure/useDisclosureContext.d.ts +2 -0
  327. package/esm/Disclosure/useDisclosureContext.js +11 -0
  328. package/esm/Dropdown/Dropdown.d.ts +1 -1
  329. package/esm/Dropdown/DropdownContext.d.ts +2 -2
  330. package/esm/Dropdown/DropdownItem.js +1 -1
  331. package/esm/Dropdown/DropdownMenu.d.ts +3 -3
  332. package/esm/Dropdown/DropdownMenu.js +10 -7
  333. package/esm/Dropdown/DropdownState.d.ts +1 -1
  334. package/esm/Dropdown/DropdownToggle.js +9 -2
  335. package/esm/Dropdown/useRenderDropdownItem.d.ts +1 -1
  336. package/esm/Form/Form.js +1 -1
  337. package/esm/Form/FormContext.d.ts +1 -1
  338. package/esm/FormControl/FormControl.d.ts +1 -1
  339. package/esm/FormControl/FormControl.js +5 -4
  340. package/esm/FormGroup/FormGroup.d.ts +1 -1
  341. package/esm/FormGroup/FormGroup.js +7 -4
  342. package/esm/Input/Input.d.ts +3 -2
  343. package/esm/InputGroup/InputGroup.d.ts +1 -1
  344. package/esm/InputNumber/InputNumber.js +6 -2
  345. package/esm/InputPicker/InputAutosize.js +4 -4
  346. package/esm/InputPicker/InputPicker.d.ts +2 -2
  347. package/esm/InputPicker/InputPicker.js +15 -10
  348. package/esm/List/ListContext.d.ts +1 -1
  349. package/esm/List/ListContext.js +7 -1
  350. package/esm/List/helper/AutoScroller.js +4 -2
  351. package/esm/List/helper/useManager.d.ts +3 -3
  352. package/esm/List/helper/useManager.js +1 -1
  353. package/esm/List/helper/useSortHelper.d.ts +3 -3
  354. package/esm/List/helper/useSortHelper.js +6 -4
  355. package/esm/List/helper/utils.d.ts +2 -2
  356. package/esm/MaskedInput/TextMask.d.ts +5 -5
  357. package/esm/MaskedInput/adjustCaretPosition.d.ts +6 -6
  358. package/esm/MaskedInput/conformToMask.js +5 -4
  359. package/esm/MaskedInput/createTextMaskInputElement.d.ts +2 -2
  360. package/esm/MaskedInput/utilities.d.ts +1 -1
  361. package/esm/Menu/Menu.js +13 -7
  362. package/esm/Menu/MenuContext.d.ts +1 -1
  363. package/esm/Menu/MenuItem.d.ts +1 -1
  364. package/esm/Menu/MenuItem.js +18 -15
  365. package/esm/Menu/Menubar.js +7 -8
  366. package/esm/Menu/useMenu.js +17 -7
  367. package/esm/Modal/Modal.js +12 -6
  368. package/esm/Modal/ModalContext.d.ts +2 -2
  369. package/esm/Modal/utils.d.ts +1 -1
  370. package/esm/Modal/utils.js +3 -5
  371. package/esm/MultiCascader/DropdownMenu.d.ts +4 -4
  372. package/esm/MultiCascader/MultiCascader.js +6 -6
  373. package/esm/MultiCascader/utils.d.ts +17 -17
  374. package/esm/Nav/Nav.d.ts +1 -1
  375. package/esm/Nav/Nav.js +11 -13
  376. package/esm/Nav/NavContext.d.ts +7 -1
  377. package/esm/Nav/NavContext.js +1 -0
  378. package/esm/Nav/NavItem.d.ts +1 -1
  379. package/esm/Navbar/Navbar.js +1 -1
  380. package/esm/Navbar/NavbarItem.d.ts +1 -1
  381. package/esm/Overlay/Modal.d.ts +2 -2
  382. package/esm/Overlay/Modal.js +71 -46
  383. package/esm/Overlay/ModalManager.d.ts +17 -8
  384. package/esm/Overlay/ModalManager.js +11 -20
  385. package/esm/Overlay/Overlay.d.ts +3 -3
  386. package/esm/Overlay/Overlay.js +8 -3
  387. package/esm/Overlay/OverlayContext.d.ts +6 -0
  388. package/esm/Overlay/OverlayContext.js +4 -0
  389. package/esm/Overlay/OverlayTrigger.d.ts +11 -11
  390. package/esm/Overlay/OverlayTrigger.js +21 -8
  391. package/esm/Overlay/Position.d.ts +4 -4
  392. package/esm/Overlay/Position.js +14 -8
  393. package/esm/Overlay/positionUtils.d.ts +1 -1
  394. package/esm/Overlay/positionUtils.js +6 -6
  395. package/esm/Pagination/Pagination.d.ts +1 -1
  396. package/esm/Pagination/PaginationButton.d.ts +3 -3
  397. package/esm/Pagination/PaginationGroup.js +5 -3
  398. package/esm/Panel/Panel.d.ts +1 -1
  399. package/esm/Panel/Panel.js +2 -2
  400. package/esm/PanelGroup/PanelGroup.d.ts +2 -2
  401. package/esm/PanelGroup/PanelGroup.js +9 -6
  402. package/esm/Picker/DropdownMenu.d.ts +8 -5
  403. package/esm/Picker/DropdownMenu.js +5 -5
  404. package/esm/Picker/PickerOverlay.js +4 -3
  405. package/esm/Picker/PickerToggle.js +4 -3
  406. package/esm/Picker/PickerToggleTrigger.d.ts +2 -6
  407. package/esm/Picker/SearchBar.d.ts +1 -1
  408. package/esm/Picker/SelectedElement.js +2 -1
  409. package/esm/Picker/VirtualizedList.d.ts +29 -2
  410. package/esm/Picker/propTypes.d.ts +5 -7
  411. package/esm/Picker/propTypes.js +4 -3
  412. package/esm/Picker/utils.d.ts +15 -23
  413. package/esm/Picker/utils.js +70 -46
  414. package/esm/Placeholder/PlaceholderGrid.js +1 -1
  415. package/esm/Plaintext/Plaintext.js +2 -1
  416. package/esm/Radio/Radio.d.ts +1 -1
  417. package/esm/RadioGroup/RadioGroup.d.ts +2 -2
  418. package/esm/RadioGroup/RadioGroup.js +1 -1
  419. package/esm/RangeSlider/RangeSlider.d.ts +2 -2
  420. package/esm/RangeSlider/RangeSlider.js +5 -4
  421. package/esm/Rate/Character.js +3 -2
  422. package/esm/Rate/Rate.js +2 -1
  423. package/esm/Ripple/Ripple.js +1 -1
  424. package/esm/SelectPicker/SelectPicker.d.ts +12 -5
  425. package/esm/SelectPicker/SelectPicker.js +8 -8
  426. package/esm/SelectPicker/index.d.ts +1 -1
  427. package/esm/SelectPicker/test/SelectPicker.test.d.ts +1 -0
  428. package/esm/SelectPicker/test/SelectPicker.test.js +52 -0
  429. package/esm/Sidenav/Node.d.ts +1 -1
  430. package/esm/Sidenav/Sidenav.d.ts +4 -4
  431. package/esm/Sidenav/Sidenav.js +5 -2
  432. package/esm/Sidenav/SidenavDropdown.js +11 -7
  433. package/esm/Sidenav/SidenavDropdownItem.js +11 -5
  434. package/esm/Sidenav/SidenavDropdownMenu.js +9 -5
  435. package/esm/Sidenav/SidenavItem.d.ts +1 -1
  436. package/esm/Sidenav/SidenavItem.js +4 -0
  437. package/esm/Slider/Graduated.d.ts +5 -5
  438. package/esm/Slider/Handle.d.ts +1 -1
  439. package/esm/Slider/Handle.js +10 -6
  440. package/esm/Slider/Mark.d.ts +1 -1
  441. package/esm/Slider/Slider.d.ts +1 -1
  442. package/esm/Slider/Slider.js +2 -2
  443. package/esm/Slider/utils.d.ts +2 -1
  444. package/esm/Slider/utils.js +5 -2
  445. package/esm/Stack/Stack.d.ts +26 -0
  446. package/esm/Stack/Stack.js +71 -0
  447. package/esm/Stack/index.d.ts +3 -0
  448. package/esm/Stack/index.js +2 -0
  449. package/esm/Steps/StepItem.js +1 -1
  450. package/esm/TagInput/index.js +1 -1
  451. package/esm/Toggle/Toggle.js +5 -4
  452. package/esm/Tree/Tree.d.ts +3 -2
  453. package/esm/Tree/Tree.js +7 -6
  454. package/esm/Tree/TreeContext.d.ts +0 -1
  455. package/esm/TreePicker/TreeNode.js +6 -21
  456. package/esm/TreePicker/TreePicker.js +36 -52
  457. package/esm/Uploader/UploadFileItem.d.ts +1 -1
  458. package/esm/Uploader/UploadFileItem.js +2 -2
  459. package/esm/Uploader/UploadTrigger.d.ts +1 -1
  460. package/esm/Uploader/UploadTrigger.js +2 -3
  461. package/esm/Uploader/Uploader.d.ts +5 -5
  462. package/esm/Uploader/Uploader.js +1 -2
  463. package/esm/index.d.ts +6 -2
  464. package/esm/index.js +3 -1
  465. package/esm/locales/index.d.ts +3 -3
  466. package/esm/toaster/ToastContainer.d.ts +1 -1
  467. package/esm/toaster/ToastContainer.js +1 -1
  468. package/esm/toaster/toaster.js +3 -1
  469. package/esm/utils/BrowserDetection.js +1 -1
  470. package/esm/utils/ReactChildren.d.ts +2 -2
  471. package/esm/utils/ajaxUpload.d.ts +1 -1
  472. package/esm/utils/ajaxUpload.js +5 -4
  473. package/esm/utils/appendTooltip.d.ts +1 -1
  474. package/esm/utils/constants.d.ts +4 -4
  475. package/esm/utils/createChainedFunction.d.ts +1 -1
  476. package/esm/utils/getDataGroupBy.d.ts +1 -1
  477. package/esm/utils/mergeRefs.d.ts +2 -2
  478. package/esm/utils/previewFile.d.ts +1 -1
  479. package/esm/utils/propTypeChecker.d.ts +6 -2
  480. package/esm/utils/propTypeChecker.js +7 -6
  481. package/esm/utils/reactToString.d.ts +2 -1
  482. package/esm/utils/statusIcons.d.ts +1 -1
  483. package/esm/utils/stringToObject.d.ts +1 -1
  484. package/esm/utils/treeUtils.d.ts +35 -32
  485. package/esm/utils/treeUtils.js +45 -21
  486. package/esm/utils/useControlled.d.ts +6 -1
  487. package/esm/utils/useControlled.js +0 -8
  488. package/esm/utils/useCustom.js +6 -4
  489. package/esm/utils/useFocus.d.ts +2 -2
  490. package/esm/utils/usePortal.d.ts +2 -2
  491. package/esm/utils/useRootClose.d.ts +2 -2
  492. package/esm/utils/useTimeout.d.ts +1 -1
  493. package/esm/utils/useTimeout.js +5 -3
  494. package/package.json +3 -3
  495. package/styles/index.less +2 -0
@@ -275,8 +275,8 @@ var UploadFileItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
275
275
  UploadFileItem.displayName = 'UploadFileItem';
276
276
  UploadFileItem.propTypes = {
277
277
  locale: PropTypes.any,
278
- file: PropTypes.object,
279
- listType: PropTypes.oneOf(['text', 'picture-text', 'picture']),
278
+ file: PropTypes.object.isRequired,
279
+ listType: PropTypes.oneOf(['text', 'picture-text', 'picture']).isRequired,
280
280
  disabled: PropTypes.bool,
281
281
  className: PropTypes.string,
282
282
  maxPreviewFileSize: PropTypes.number,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { UploaderLocale } from '../locales';
3
3
  export interface UploadTriggerProps {
4
- as: React.ElementType | string;
4
+ as?: React.ElementType;
5
5
  name?: string;
6
6
  multiple?: boolean;
7
7
  disabled?: boolean;
@@ -32,13 +32,13 @@ var UploadTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
32
32
  onDrop = props.onDrop,
33
33
  rest = _objectWithoutPropertiesLoose(props, ["as", "name", "accept", "multiple", "disabled", "readOnly", "children", "classPrefix", "className", "draggable", "locale", "onChange", "onDragEnter", "onDragLeave", "onDragOver", "onDrop"]);
34
34
 
35
- var rootRef = useRef();
35
+ var rootRef = useRef(null);
36
36
 
37
37
  var _useState = useState(false),
38
38
  dragOver = _useState[0],
39
39
  setDragOver = _useState[1];
40
40
 
41
- var inputRef = useRef();
41
+ var inputRef = useRef(null);
42
42
 
43
43
  var _useClassNames = useClassNames(classPrefix),
44
44
  merge = _useClassNames.merge,
@@ -151,7 +151,6 @@ UploadTrigger.propTypes = {
151
151
  classPrefix: PropTypes.string,
152
152
  className: PropTypes.string,
153
153
  children: PropTypes.node,
154
- as: PropTypes.elementType,
155
154
  draggable: PropTypes.bool,
156
155
  onDragEnter: PropTypes.func,
157
156
  onDragLeave: PropTypes.func,
@@ -21,7 +21,7 @@ export interface UploaderInstance {
21
21
  }
22
22
  export interface UploaderProps extends WithAsProps {
23
23
  /** Uploading URL */
24
- action?: string;
24
+ action: string;
25
25
  /** File types that can be accepted. See input accept Attribute */
26
26
  accept?: string;
27
27
  /** Automatically upload files after selecting them */
@@ -62,7 +62,7 @@ export interface UploaderProps extends WithAsProps {
62
62
  /** Max file size limit of the preview file */
63
63
  maxPreviewFileSize?: number;
64
64
  /** You can use a custom element for this component */
65
- toggleAs?: React.ElementType | string;
65
+ toggleAs?: React.ElementType;
66
66
  /** Removable list file */
67
67
  removable?: boolean;
68
68
  /** File list can be rendered */
@@ -84,11 +84,11 @@ export interface UploaderProps extends WithAsProps {
84
84
  /** In the file list, click the callback function for the uploaded file */
85
85
  onPreview?: (file: FileType, event: React.SyntheticEvent) => void;
86
86
  /** Upload callback function with erro */
87
- onError?: (status: any, file: FileType, event: React.SyntheticEvent, xhr: XMLHttpRequest) => void;
87
+ onError?: (status: any, file: FileType, event: ProgressEvent, xhr: XMLHttpRequest) => void;
88
88
  /** callback function after successful upload */
89
- onSuccess?: (response: any, file: FileType, event: React.SyntheticEvent, xhr: XMLHttpRequest) => void;
89
+ onSuccess?: (response: any, file: FileType, event: ProgressEvent, xhr: XMLHttpRequest) => void;
90
90
  /** Callback functions that upload progress change */
91
- onProgress?: (percent: number, file: FileType, event: React.SyntheticEvent, xhr: XMLHttpRequest) => void;
91
+ onProgress?: (percent: number, file: FileType, event: ProgressEvent, xhr: XMLHttpRequest) => void;
92
92
  /** In the file list, click the callback function to delete a file */
93
93
  onRemove?: (file: FileType) => void;
94
94
  /** Custom render file information */
@@ -428,7 +428,7 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
428
428
  });
429
429
  Uploader.displayName = 'Uploader';
430
430
  Uploader.propTypes = {
431
- action: PropTypes.string,
431
+ action: PropTypes.string.isRequired,
432
432
  accept: PropTypes.string,
433
433
  autoUpload: PropTypes.bool,
434
434
  children: PropTypes.node,
@@ -458,7 +458,6 @@ Uploader.propTypes = {
458
458
  onRemove: PropTypes.func,
459
459
  maxPreviewFileSize: PropTypes.number,
460
460
  style: PropTypes.object,
461
- toggleAs: PropTypes.elementType,
462
461
  renderFileInfo: PropTypes.func,
463
462
  renderThumbnail: PropTypes.func,
464
463
  removable: PropTypes.bool,
package/esm/index.d.ts CHANGED
@@ -24,14 +24,14 @@ export { default as Loader } from './Loader';
24
24
  export type { LoaderProps } from './Loader';
25
25
  export { default as SafeAnchor } from './SafeAnchor';
26
26
  export type { SafeAnchorProps } from './SafeAnchor';
27
- export { default as Divider } from './Divider';
28
- export type { DividerProps } from './Divider';
29
27
  export { default as Placeholder } from './Placeholder';
30
28
  export type { PlaceholderGraphProps, PlaceholderGridProps, PlaceholderParagraphProps } from './Placeholder';
31
29
  export { default as Badge } from './Badge';
32
30
  export type { BadgeProps } from './Badge';
33
31
  export { default as Avatar } from './Avatar';
34
32
  export type { AvatarProps } from './Avatar';
33
+ export { default as AvatarGroup } from './AvatarGroup';
34
+ export type { AvatarGroupProps } from './AvatarGroup';
35
35
  export { default as toaster } from './toaster';
36
36
  export type { Toaster } from './toaster';
37
37
  export { default as Dropdown } from './Dropdown';
@@ -142,6 +142,10 @@ export { default as Sidebar } from './Sidebar';
142
142
  export type { SidebarProps } from './Sidebar';
143
143
  export { default as Footer } from './Footer';
144
144
  export type { FooterProps } from './Footer';
145
+ export { default as Divider } from './Divider';
146
+ export type { DividerProps } from './Divider';
147
+ export { default as Stack } from './Stack';
148
+ export type { StackProps } from './Stack';
145
149
  export { default as Schema } from './Schema';
146
150
  export { default as Animation } from './Animation';
147
151
  export type { TransitionProps, SlideProps, CollapseProps, FadeProps, BounceProps } from './Animation';
package/esm/index.js CHANGED
@@ -12,10 +12,10 @@ export { default as Message } from './Message';
12
12
  export { default as Drawer } from './Drawer';
13
13
  export { default as Loader } from './Loader';
14
14
  export { default as SafeAnchor } from './SafeAnchor';
15
- export { default as Divider } from './Divider';
16
15
  export { default as Placeholder } from './Placeholder';
17
16
  export { default as Badge } from './Badge';
18
17
  export { default as Avatar } from './Avatar';
18
+ export { default as AvatarGroup } from './AvatarGroup';
19
19
  export { default as toaster } from './toaster';
20
20
  // Nav
21
21
  export { default as Dropdown } from './Dropdown';
@@ -75,6 +75,8 @@ export { default as Content } from './Content';
75
75
  export { default as Header } from './Header';
76
76
  export { default as Sidebar } from './Sidebar';
77
77
  export { default as Footer } from './Footer';
78
+ export { default as Divider } from './Divider';
79
+ export { default as Stack } from './Stack';
78
80
  // Utils
79
81
  export { default as Schema } from './Schema';
80
82
  export { default as Animation } from './Animation';
@@ -19,15 +19,15 @@ declare type PickKeys<T> = {
19
19
  [keys in keyof T]?: T[keys];
20
20
  };
21
21
  export declare type Locale = PickKeys<typeof defaultLocale>;
22
- export declare type CommonLocale = PickKeys<typeof defaultLocale.common>;
22
+ export declare type CommonLocale = typeof defaultLocale.common;
23
23
  export declare type CalendarLocale = PickKeys<typeof defaultLocale.Calendar>;
24
24
  export declare type PlaintextLocale = PickKeys<typeof defaultLocale.Plaintext>;
25
25
  export declare type PaginationLocale = PickKeys<typeof defaultLocale.Pagination>;
26
26
  export declare type TableLocale = CommonLocale;
27
27
  export declare type DatePickerLocale = PickKeys<typeof defaultLocale.DatePicker>;
28
28
  export declare type DateRangePickerLocale = PickKeys<typeof defaultLocale.DateRangePicker>;
29
- export declare type PickerLocale = PickKeys<typeof defaultLocale.Picker> & CommonLocale;
30
- export declare type InputPickerLocale = PickerLocale & PickKeys<typeof defaultLocale.InputPicker>;
29
+ export declare type PickerLocale = typeof defaultLocale.Picker & CommonLocale;
30
+ export declare type InputPickerLocale = PickerLocale & typeof defaultLocale.InputPicker;
31
31
  export declare type UploaderLocale = PickKeys<typeof defaultLocale.Uploader>;
32
32
  export declare type CloseButtonLocale = PickKeys<typeof defaultLocale.CloseButton>;
33
33
  export declare type BreadcrumbLocale = PickKeys<typeof defaultLocale.Breadcrumb>;
@@ -18,7 +18,7 @@ export interface NodeProps extends WithAsProps {
18
18
  onClose?: (event?: React.MouseEvent<HTMLDivElement>) => void;
19
19
  }
20
20
  interface ToastContainerComponent extends RsRefForwardingComponent<'div', ToastContainerProps> {
21
- getInstance?: (props: ToastContainerProps) => [React.RefObject<ToastContainerInstance>, () => void];
21
+ getInstance: (props: ToastContainerProps) => [React.RefObject<ToastContainerInstance>, () => void];
22
22
  }
23
23
  declare const ToastContainer: ToastContainerComponent;
24
24
  export default ToastContainer;
@@ -14,7 +14,7 @@ var useMessages = function useMessages() {
14
14
 
15
15
  var getKey = useCallback(function (key) {
16
16
  if (typeof key === 'undefined' && messages.length) {
17
- key = messages[messages.length - 1].key;
17
+ return messages[messages.length - 1].key;
18
18
  }
19
19
 
20
20
  return key;
@@ -40,7 +40,9 @@ toaster.push = function (message, options) {
40
40
  var container = getContainer(options.placement);
41
41
 
42
42
  if (!container) {
43
- container = createContainer(options.placement, options);
43
+ var _options$placement;
44
+
45
+ container = createContainer((_options$placement = options.placement) !== null && _options$placement !== void 0 ? _options$placement : '', options);
44
46
  }
45
47
 
46
48
  return container.current.push(message);
@@ -12,5 +12,5 @@ export var isIE11 = function isIE11() {
12
12
  }; // Edge 20+
13
13
 
14
14
  export var isEdge = function isEdge() {
15
- return canUseDOM && !isIE() && !!window.styleMedia;
15
+ return canUseDOM && !isIE() && 'styleMedia' in window;
16
16
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export declare function find(children: React.ReactNode, func: any, context?: any): React.ReactNode;
3
- export declare function map(children: React.ReactNode, func: any, context?: any): any[];
4
- export declare function mapCloneElement(children: React.ReactNode, func: any, context?: any): any[];
3
+ export declare function map(children: React.ReactNode, func: any, context?: any): any[] | null | undefined;
4
+ export declare function mapCloneElement(children: React.ReactNode, func: any, context?: any): any[] | null | undefined;
5
5
  export declare function count(children: React.ReactChildren): number;
6
6
  declare function some(children: React.ReactNode, func: any, context?: any): boolean;
7
7
  declare const _default: {
@@ -17,6 +17,6 @@ interface Options {
17
17
  }
18
18
  export default function ajaxUpload(options: Options): {
19
19
  xhr: XMLHttpRequest;
20
- data: any;
20
+ data: File | FormData;
21
21
  };
22
22
  export {};
@@ -27,15 +27,16 @@ export default function ajaxUpload(options) {
27
27
  withCredentials = options.withCredentials,
28
28
  disableMultipart = options.disableMultipart;
29
29
  var xhr = new XMLHttpRequest();
30
- var sendableData = null;
30
+ var sendableData;
31
31
  xhr.open('POST', url, true);
32
32
 
33
33
  if (!disableMultipart) {
34
34
  sendableData = new FormData();
35
35
  sendableData.append(name, file, file.name);
36
- Object.keys(data).forEach(function (key) {
37
- return sendableData.append(key, data[key]);
38
- });
36
+
37
+ for (var key in data) {
38
+ sendableData.append(key, data[key]);
39
+ }
39
40
  } else {
40
41
  sendableData = file;
41
42
  }
@@ -3,7 +3,7 @@ import { TypeAttributes } from '../@types/common';
3
3
  interface Props {
4
4
  ref?: React.Ref<any>;
5
5
  message?: React.ReactNode;
6
- children?: React.ReactElement | ((props: any, ref: any) => React.ReactElement);
6
+ children: React.ReactElement | ((props: any, ref: any) => React.ReactElement);
7
7
  placement?: TypeAttributes.Placement;
8
8
  }
9
9
  export default function appendTooltip({ message, ref, ...rest }: Props): JSX.Element;
@@ -1,10 +1,10 @@
1
1
  export declare const SIZE: string[];
2
2
  export declare const STATUS: string[];
3
3
  export declare const COLOR: string[];
4
- export declare const PLACEMENT_4: string[];
5
- export declare const PLACEMENT_8: string[];
6
- export declare const PLACEMENT_AUTO: string[];
7
- export declare const PLACEMENT: any[];
4
+ export declare const PLACEMENT_4: readonly ["top", "bottom", "right", "left"];
5
+ export declare const PLACEMENT_8: readonly ["bottomStart", "bottomEnd", "topStart", "topEnd", "leftStart", "rightStart", "leftEnd", "rightEnd"];
6
+ export declare const PLACEMENT_AUTO: readonly ["auto", "autoVertical", "autoVerticalStart", "autoVerticalEnd", "autoHorizontal", "autoHorizontalStart", "autoHorizontalEnd"];
7
+ export declare const PLACEMENT: readonly ["top", "bottom", "right", "left", "bottomStart", "bottomEnd", "topStart", "topEnd", "leftStart", "rightStart", "leftEnd", "rightEnd", "auto", "autoVertical", "autoVerticalStart", "autoVerticalEnd", "autoHorizontal", "autoHorizontalStart", "autoHorizontalEnd"];
8
8
  /**
9
9
  * Check Tree Node State
10
10
  */
@@ -11,5 +11,5 @@
11
11
  * @param {function} functions to chain
12
12
  * @returns {function|undefined}
13
13
  */
14
- declare function createChainedFunction<T = any>(...funcs: T[]): T;
14
+ declare function createChainedFunction<T = any>(...funcs: (T | null)[]): T;
15
15
  export default createChainedFunction;
@@ -1,3 +1,3 @@
1
1
  export declare const KEY_GROUP: string | symbol;
2
2
  export declare const KEY_GROUP_TITLE = "groupTitle";
3
- export default function getDataGroupBy(data: any[], key: string, sort: any): any[];
3
+ export default function getDataGroupBy(data: any[] | undefined, key: string, sort: any): any[];
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  declare type CallbackRef<T> = (ref: T | null) => void;
3
3
  declare type Ref<T> = React.MutableRefObject<T> | CallbackRef<T>;
4
- export default function mergeRefs<T>(refA?: Ref<T> | null, refB?: Ref<T> | null): (value: T | null) => void;
4
+ export default function mergeRefs<T>(refA?: Ref<T | null> | null, refB?: Ref<T | null> | null): React.RefCallback<T>;
5
5
  export {};
@@ -1,3 +1,3 @@
1
1
  export declare function isImage(file: any): boolean;
2
- declare const _default: (file: File, callback: (result: string | ArrayBuffer) => void) => void;
2
+ declare const _default: (file: File, callback: (result: string | ArrayBuffer | null) => void) => void;
3
3
  export default _default;
@@ -1,3 +1,7 @@
1
- import PropTypes from 'prop-types';
2
- export declare function tupleType(...types: any[]): any;
1
+ import PropTypes, { Requireable, Validator } from 'prop-types';
2
+ declare type ExtractValue<T extends ReadonlyArray<Validator<any>>> = {
3
+ [K in keyof T]: T[K] extends Validator<infer V> ? V : never;
4
+ };
5
+ export declare function tupleType<T extends readonly Validator<any>[]>(...types: T): Requireable<ExtractValue<T>>;
3
6
  export declare const refType: PropTypes.Requireable<any>;
7
+ export {};
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
2
2
  var ANONYMOUS = '';
3
3
 
4
4
  function createChainableTypeChecker(validate) {
5
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5
+ function checkType(isRequired, props, propName, componentName, location, propFullName) {
6
6
  componentName = componentName || ANONYMOUS;
7
7
  propFullName = propFullName || propName;
8
8
 
@@ -17,12 +17,13 @@ function createChainableTypeChecker(validate) {
17
17
 
18
18
  return null;
19
19
  } else {
20
- return validate(props, propName, componentName, location, propFullName, secret);
20
+ return validate(props, propName, componentName, location, propFullName);
21
21
  }
22
22
  }
23
23
 
24
- var chainedCheckType = checkType.bind(null, false);
25
- chainedCheckType.isRequired = checkType.bind(null, true);
24
+ var chainedCheckType = Object.assign(checkType.bind(null, false), {
25
+ isRequired: checkType.bind(null, true)
26
+ });
26
27
  return chainedCheckType;
27
28
  }
28
29
 
@@ -31,7 +32,7 @@ export function tupleType() {
31
32
  types[_key] = arguments[_key];
32
33
  }
33
34
 
34
- return createChainableTypeChecker(function (props, propName, componentName, location, propFullName, secret) {
35
+ return createChainableTypeChecker(function (props, propName, componentName, location, propFullName) {
35
36
  var value = props[propName];
36
37
 
37
38
  if (!location) {
@@ -55,7 +56,7 @@ export function tupleType() {
55
56
  }
56
57
 
57
58
  for (var i = 0; i < value.length; ++i) {
58
- var error = types[i](value, i, componentName, 'element', propFullName + "[" + i + "]", secret);
59
+ var error = types[i](value, String(i), componentName, 'element', propFullName + "[" + i + "]");
59
60
 
60
61
  if (error) {
61
62
  return error;
@@ -1 +1,2 @@
1
- export default function reactToString(element: any): any[];
1
+ import React from 'react';
2
+ export default function reactToString(element: React.ReactElement): string[];
@@ -7,6 +7,6 @@ export declare const MESSAGE_STATUS_ICONS: {
7
7
  };
8
8
  export declare const PROGRESS_STATUS_ICON: {
9
9
  success: JSX.Element;
10
- active: any;
10
+ active: null;
11
11
  fail: JSX.Element;
12
12
  };
@@ -1,2 +1,2 @@
1
- declare const _default: (value: any, labelKey?: string, valueKey?: string) => object;
1
+ declare const _default: (value: any, labelKey?: string | undefined, valueKey?: string | undefined) => object | null;
2
2
  export default _default;
@@ -30,7 +30,7 @@ export declare function getNodeParents(node: any, parentKey?: string, valueKey?:
30
30
  * @param node
31
31
  * @param valueKey
32
32
  */
33
- export declare function getNodeParentKeys(nodes: TreeNodesType, node: TreeNodeType, valueKey: string): any[];
33
+ export declare function getNodeParentKeys(nodes: TreeNodesType, node: TreeNodeType, valueKey: string): TreeNodeType[];
34
34
  export declare function hasVisibleChildren(node: TreeNodeType, childrenKey: string): any;
35
35
  /**
36
36
  * shallow equal array
@@ -61,7 +61,7 @@ export declare function createUpdateTreeDataFunction(params: any, { valueKey, ch
61
61
  childrenKey: any;
62
62
  }): (tree: any[]) => any[];
63
63
  export declare function findNodeOfTree(data: any, check: any): any;
64
- export declare function filterNodesOfTree(data: any, check: any): any[];
64
+ export declare function filterNodesOfTree(data: any, check: any): TreeNodeType[];
65
65
  /**
66
66
  * get all focusable items
67
67
  * exclude not visible and disabled node
@@ -70,7 +70,7 @@ export declare function filterNodesOfTree(data: any, check: any): any[];
70
70
  * @param isSearching - component is in Searching
71
71
  * @returns
72
72
  */
73
- export declare const getFocusableItems: (filteredData: ItemDataType[], props: PartialTreeProps, isSearching?: boolean) => any[];
73
+ export declare const getFocusableItems: (filteredData: ItemDataType[], props: PartialTreeProps, isSearching?: boolean | undefined) => TreeNodeType[];
74
74
  /**
75
75
  * return all focusable Item and active Element index
76
76
  * @param focusItemValue
@@ -82,7 +82,7 @@ export declare const getActiveIndex: (focusItemValue: any, focusItems: any[], va
82
82
  * @param flattenNodes - flattenData
83
83
  */
84
84
  export declare const getActiveItem: (focusItemValue: string | number, flattenNodes: TreeNodesType, valueKey: string) => any;
85
- export declare const getElementByDataKey: (dataKey: string, treeNodesRefs: any, selector: string) => Element;
85
+ export declare const getElementByDataKey: (dataKey: string, treeNodesRefs: any, selector: string) => Element | null;
86
86
  /**
87
87
  * focus to specify tree node
88
88
  * @param refKey - target node refKey
@@ -91,7 +91,7 @@ export declare const getElementByDataKey: (dataKey: string, treeNodesRefs: any,
91
91
  */
92
92
  export declare const focusTreeNode: (refKey: string, treeNodeRefs: any, selector: string) => void;
93
93
  export interface FocusPrevOrNextProps {
94
- focusItemValue: string | number;
94
+ focusItemValue: string | number | null;
95
95
  focusableItems: any[];
96
96
  treeNodesRefs: any;
97
97
  selector: string;
@@ -111,7 +111,7 @@ export declare const focusPreviousItem: ({ focusItemValue, focusableItems, treeN
111
111
  export interface ArrowHandlerProps {
112
112
  focusItem: TreeNodeType;
113
113
  expand: boolean;
114
- childrenKey?: string;
114
+ childrenKey: string;
115
115
  onExpand: (focusItem: TreeNodeType) => void;
116
116
  onFocusItem: () => void;
117
117
  }
@@ -137,20 +137,21 @@ export declare function rightArrowHandler({ focusItem, expand, childrenKey, onEx
137
137
  * @param value - activeItem value
138
138
  * @param valueKey
139
139
  */
140
- export declare const getScrollToIndex: (nodes: TreeNodeType[], value: string | number, valueKey: string) => number;
140
+ export declare const getScrollToIndex: (nodes: readonly TreeNodeType[], value: string | number, valueKey: string) => number;
141
141
  /**
142
142
  * when searching, expand state always return true
143
143
  * @param searchKeyword
144
144
  * @param expand
145
145
  */
146
146
  export declare function getExpandWhenSearching(searchKeyword: string, expand: boolean): boolean;
147
- export declare function getTreeActiveNode(nodes: TreeNodesType, value: number | string, valueKey: string): any;
147
+ declare function getTreeActiveNode<T extends number | string | undefined>(nodes: TreeNodesType, value: T, valueKey: string): T extends undefined ? undefined : TreeNodeType | undefined;
148
+ export { getTreeActiveNode };
148
149
  /**
149
150
  * toggle tree node
150
151
  * @param param0
151
152
  */
152
- export declare function toggleExpand({ node, isExpand, expandItemValues, valueKey }: any): unknown[];
153
- export declare function getTreeNodeTitle(label: any): string;
153
+ export declare function toggleExpand({ node, isExpand, expandItemValues, valueKey }: any): ItemDataType<string | number>[];
154
+ export declare function getTreeNodeTitle(label: any): string | undefined;
154
155
  /**
155
156
  * get all children from flattenNodes object by given parent node
156
157
  * @param nodes
@@ -158,14 +159,14 @@ export declare function getTreeNodeTitle(label: any): string;
158
159
  */
159
160
  export declare function getChildrenByFlattenNodes(nodes: TreeNodesType, parent: TreeNodeType): TreeNodeType[];
160
161
  export declare function useTreeDrag(): {
161
- dragNode: any;
162
- dragOverNodeKey: any;
163
- dragNodeKeys: any[];
164
- dropNodePosition: TREE_NODE_DROP_POSITION;
165
- setDragNode: (node: ItemDataType) => void;
166
- setDragOverNodeKey: React.Dispatch<any>;
167
- setDragNodeKeys: React.Dispatch<React.SetStateAction<any[]>>;
168
- setDropNodePosition: React.Dispatch<React.SetStateAction<TREE_NODE_DROP_POSITION>>;
162
+ dragNode: ItemDataType<string | number> | null;
163
+ dragOverNodeKey: null;
164
+ dragNodeKeys: (string | number)[];
165
+ dropNodePosition: TREE_NODE_DROP_POSITION | null;
166
+ setDragNode: (node: ItemDataType | null) => void;
167
+ setDragOverNodeKey: React.Dispatch<React.SetStateAction<null>>;
168
+ setDragNodeKeys: React.Dispatch<React.SetStateAction<(string | number)[]>>;
169
+ setDropNodePosition: React.Dispatch<React.SetStateAction<TREE_NODE_DROP_POSITION | null>>;
169
170
  };
170
171
  interface FlattenTreeDataProps {
171
172
  data: TreeNodeType[];
@@ -189,44 +190,44 @@ interface UnSerializeListProps {
189
190
  export declare function useFlattenTreeData({ data, labelKey, valueKey, childrenKey, uncheckableItemValues, callback }: FlattenTreeDataProps): {
190
191
  forceUpdate: () => void;
191
192
  flattenNodes: TreeNodesType;
192
- flattenTreeData: (treeData: TreeNodeType[], ref: string, parent?: TreeNodeType, layer?: any) => any[];
193
- serializeListOnlyParent: (nodes: TreeNodesType, key: string) => any[];
193
+ flattenTreeData: (treeData: TreeNodeType[], ref: string, parent?: TreeNodeType | undefined, layer?: any) => never[] | undefined;
194
+ serializeListOnlyParent: (nodes: TreeNodesType, key: string) => (string | number)[];
194
195
  unSerializeList: ({ nodes, key, value, cascade, uncheckableItemValues }: UnSerializeListProps) => void;
195
196
  formatVirtualizedTreeData: (nodes: TreeNodesType, data: any[], expandItemValues: ItemDataType[], options: {
196
197
  cascade?: boolean;
197
198
  searchKeyword?: string;
198
- }) => any[];
199
+ }) => TreeNodeType[];
199
200
  };
200
201
  /**
201
202
  * A hook that saving every tree node ref
202
203
  */
203
204
  export declare function useTreeNodeRefs(): {
204
205
  treeNodesRefs: {};
205
- saveTreeNodeRef: (refKey: string, ref: React.Ref<any>) => void;
206
+ saveTreeNodeRef: (ref: React.Ref<any>, refKey?: string | undefined) => void;
206
207
  };
207
208
  interface TreeSearchProps {
208
209
  labelKey: string;
209
210
  childrenKey: string;
210
- searchKeyword: string;
211
+ searchKeyword?: string;
211
212
  data: ItemDataType[];
212
- searchBy: (keyword: any, label: any, item: any) => boolean;
213
+ searchBy?: (keyword: any, label: any, item: any) => boolean;
213
214
  callback?: (keyword: string, data: ItemDataType[], event: React.SyntheticEvent) => void;
214
215
  }
215
216
  /**
216
217
  * A hook that handles tree search filter options
217
218
  * @param props
218
219
  */
219
- export declare function useTreeSearch(props: TreeSearchProps): {
220
+ export declare function useTreeSearch<T extends HTMLElement = HTMLInputElement>(props: TreeSearchProps): {
220
221
  searchKeywordState: string;
221
- filteredData: ItemDataType[];
222
+ filteredData: ItemDataType<string | number>[];
222
223
  setFilteredData: (data: ItemDataType[], searchKeyword: string) => void;
223
224
  setSearchKeyword: React.Dispatch<React.SetStateAction<string>>;
224
- handleSearch: (searchKeyword: string, event: React.SyntheticEvent) => void;
225
+ handleSearch: (searchKeyword: string, event: React.ChangeEvent<T>) => void;
225
226
  };
226
227
  export declare function useGetTreeNodeChildren(treeData: ItemDataType[], valueKey: string, childrenKey: string): {
227
- data: ItemDataType[];
228
- setData: React.Dispatch<React.SetStateAction<ItemDataType[]>>;
229
- loadingNodeValues: any[];
228
+ data: ItemDataType<string | number>[];
229
+ setData: React.Dispatch<React.SetStateAction<ItemDataType<string | number>[]>>;
230
+ loadingNodeValues: never[];
230
231
  loadChildren: (node: any, getChildren: any) => void;
231
232
  };
232
233
  export interface FocusToTreeNodeProps {
@@ -236,7 +237,7 @@ export interface FocusToTreeNodeProps {
236
237
  virtualized: boolean;
237
238
  container: HTMLDivElement;
238
239
  list: ListInstance;
239
- formattedNodes: TreeNodesType[];
240
+ formattedNodes: TreeNodeType[];
240
241
  }
241
242
  /**
242
243
  * Focus to active tree node.
@@ -244,4 +245,6 @@ export interface FocusToTreeNodeProps {
244
245
  */
245
246
  export declare function focusToActiveTreeNode({ list, valueKey, activeNode, virtualized, container, selector, formattedNodes }: FocusToTreeNodeProps): void;
246
247
  export declare function isSearching(searchKeyword?: string): boolean;
247
- export {};
248
+ export declare function getTreeNodeIndent(rtl: any, layer: any, absolute?: boolean): {
249
+ [x: string]: number;
250
+ };