rsuite 5.39.0 → 5.41.0

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 (890) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/Navbar/styles/index.less +1 -1
  3. package/SelectPicker/styles/index.less +4 -8
  4. package/cjs/@types/common.js +1 -0
  5. package/cjs/@types/utils.js +12 -2
  6. package/cjs/Affix/Affix.js +39 -59
  7. package/cjs/Affix/index.js +1 -3
  8. package/cjs/Animation/Bounce.js +4 -13
  9. package/cjs/Animation/Collapse.js +19 -40
  10. package/cjs/Animation/Fade.js +6 -15
  11. package/cjs/Animation/Slide.js +6 -15
  12. package/cjs/Animation/Transition.js +16 -83
  13. package/cjs/Animation/index.js +1 -7
  14. package/cjs/Animation/utils.js +1 -6
  15. package/cjs/AutoComplete/AutoComplete.js +55 -90
  16. package/cjs/AutoComplete/index.js +1 -3
  17. package/cjs/AutoComplete/utils.js +1 -9
  18. package/cjs/Avatar/Avatar.js +18 -32
  19. package/cjs/Avatar/index.js +1 -3
  20. package/cjs/AvatarGroup/AvatarGroup.js +13 -27
  21. package/cjs/AvatarGroup/index.js +1 -3
  22. package/cjs/Badge/Badge.js +14 -27
  23. package/cjs/Badge/index.js +1 -3
  24. package/cjs/Breadcrumb/Breadcrumb.js +19 -41
  25. package/cjs/Breadcrumb/BreadcrumbItem.js +14 -26
  26. package/cjs/Breadcrumb/index.js +1 -3
  27. package/cjs/Button/Button.js +22 -40
  28. package/cjs/Button/index.js +1 -3
  29. package/cjs/ButtonGroup/ButtonGroup.js +15 -26
  30. package/cjs/ButtonGroup/ButtonGroupContext.js +1 -4
  31. package/cjs/ButtonGroup/index.js +1 -4
  32. package/cjs/ButtonToolbar/ButtonToolbar.js +10 -20
  33. package/cjs/ButtonToolbar/index.js +1 -3
  34. package/cjs/Calendar/Calendar.js +24 -43
  35. package/cjs/Calendar/CalendarBody.js +14 -28
  36. package/cjs/Calendar/CalendarContainer.js +46 -69
  37. package/cjs/Calendar/CalendarContext.js +1 -6
  38. package/cjs/Calendar/CalendarHeader.js +32 -59
  39. package/cjs/Calendar/MonthDropdown.js +22 -45
  40. package/cjs/Calendar/MonthDropdownItem.js +16 -31
  41. package/cjs/Calendar/Table.js +10 -21
  42. package/cjs/Calendar/TableHeaderRow.js +11 -25
  43. package/cjs/Calendar/TableRow.js +35 -66
  44. package/cjs/Calendar/TimeDropdown.js +24 -64
  45. package/cjs/Calendar/index.js +1 -8
  46. package/cjs/Calendar/types.js +1 -0
  47. package/cjs/Calendar/useCalendarDate.js +3 -13
  48. package/cjs/Calendar/useCalendarState.js +3 -8
  49. package/cjs/Carousel/Carousel.js +40 -65
  50. package/cjs/Carousel/index.js +1 -3
  51. package/cjs/Cascader/Cascader.js +126 -197
  52. package/cjs/Cascader/DropdownMenu.js +33 -65
  53. package/cjs/Cascader/index.js +1 -3
  54. package/cjs/Cascader/utils.js +13 -24
  55. package/cjs/CheckPicker/CheckPicker.js +105 -156
  56. package/cjs/CheckPicker/index.js +1 -3
  57. package/cjs/CheckTree/index.js +1 -8
  58. package/cjs/CheckTreePicker/CheckTreeNode.js +28 -54
  59. package/cjs/CheckTreePicker/CheckTreePicker.js +166 -248
  60. package/cjs/CheckTreePicker/index.js +1 -3
  61. package/cjs/CheckTreePicker/utils.d.ts +1 -1
  62. package/cjs/CheckTreePicker/utils.js +14 -54
  63. package/cjs/Checkbox/Checkbox.js +48 -77
  64. package/cjs/Checkbox/index.js +1 -3
  65. package/cjs/CheckboxGroup/CheckboxGroup.js +20 -38
  66. package/cjs/CheckboxGroup/CheckboxGroupContext.js +1 -4
  67. package/cjs/CheckboxGroup/index.js +1 -4
  68. package/cjs/CloseButton/CloseButton.js +10 -20
  69. package/cjs/CloseButton/index.js +1 -3
  70. package/cjs/Col/Col.js +10 -23
  71. package/cjs/Col/index.js +1 -3
  72. package/cjs/Container/Container.js +11 -24
  73. package/cjs/Container/index.js +1 -3
  74. package/cjs/Content/Content.js +1 -3
  75. package/cjs/Content/index.js +1 -3
  76. package/cjs/CustomProvider/CustomProvider.js +13 -28
  77. package/cjs/CustomProvider/FormattedDate.js +3 -9
  78. package/cjs/CustomProvider/index.js +1 -6
  79. package/cjs/DOMHelper/index.js +1 -7
  80. package/cjs/DOMHelper/isElement.js +1 -2
  81. package/cjs/DatePicker/DatePicker.js +108 -161
  82. package/cjs/DatePicker/PredefinedRanges.js +12 -29
  83. package/cjs/DatePicker/Toolbar.js +20 -36
  84. package/cjs/DatePicker/index.js +1 -3
  85. package/cjs/DatePicker/types.js +1 -0
  86. package/cjs/DatePicker/utils.js +5 -13
  87. package/cjs/DateRangePicker/Calendar.js +18 -28
  88. package/cjs/DateRangePicker/DateRangePicker.js +128 -207
  89. package/cjs/DateRangePicker/DateRangePickerContext.js +1 -6
  90. package/cjs/DateRangePicker/disabledDateUtils.js +9 -32
  91. package/cjs/DateRangePicker/index.js +1 -3
  92. package/cjs/DateRangePicker/types.js +1 -0
  93. package/cjs/DateRangePicker/utils.js +7 -20
  94. package/cjs/Disclosure/Disclosure.js +14 -34
  95. package/cjs/Disclosure/DisclosureButton.js +4 -12
  96. package/cjs/Disclosure/DisclosureContent.js +1 -5
  97. package/cjs/Disclosure/DisclosureContext.js +1 -6
  98. package/cjs/Disclosure/index.js +1 -3
  99. package/cjs/Disclosure/useDisclosureContext.js +1 -6
  100. package/cjs/Divider/Divider.js +11 -20
  101. package/cjs/Divider/index.js +1 -3
  102. package/cjs/Drawer/Drawer.js +10 -27
  103. package/cjs/Drawer/index.js +1 -3
  104. package/cjs/Dropdown/Dropdown.js +35 -68
  105. package/cjs/Dropdown/DropdownContext.js +1 -4
  106. package/cjs/Dropdown/DropdownItem.js +22 -49
  107. package/cjs/Dropdown/DropdownMenu.js +36 -63
  108. package/cjs/Dropdown/DropdownSeparator.js +8 -17
  109. package/cjs/Dropdown/DropdownState.js +1 -10
  110. package/cjs/Dropdown/DropdownToggle.js +17 -29
  111. package/cjs/Dropdown/index.js +1 -3
  112. package/cjs/Dropdown/useRenderDropdownItem.js +1 -5
  113. package/cjs/FlexboxGrid/FlexboxGrid.js +12 -22
  114. package/cjs/FlexboxGrid/FlexboxGridItem.js +12 -22
  115. package/cjs/FlexboxGrid/index.js +1 -3
  116. package/cjs/Footer/Footer.js +1 -3
  117. package/cjs/Footer/index.js +1 -3
  118. package/cjs/Form/Form.js +36 -76
  119. package/cjs/Form/FormContext.js +1 -8
  120. package/cjs/Form/index.js +1 -4
  121. package/cjs/Form/useFormClassNames.js +11 -14
  122. package/cjs/Form/useSchemaModel.js +2 -6
  123. package/cjs/FormControl/FormControl.js +50 -82
  124. package/cjs/FormControl/index.js +1 -3
  125. package/cjs/FormControl/useRegisterModel.js +1 -3
  126. package/cjs/FormControlLabel/FormControlLabel.js +10 -22
  127. package/cjs/FormControlLabel/index.js +1 -3
  128. package/cjs/FormErrorMessage/FormErrorMessage.js +12 -27
  129. package/cjs/FormErrorMessage/index.js +1 -3
  130. package/cjs/FormGroup/FormGroup.js +9 -21
  131. package/cjs/FormGroup/index.js +1 -3
  132. package/cjs/FormHelpText/FormHelpText.js +11 -28
  133. package/cjs/FormHelpText/index.js +1 -3
  134. package/cjs/Grid/Grid.js +10 -19
  135. package/cjs/Grid/index.js +1 -3
  136. package/cjs/Header/Header.js +1 -3
  137. package/cjs/Header/index.js +1 -3
  138. package/cjs/IconButton/IconButton.js +11 -21
  139. package/cjs/IconButton/index.js +1 -3
  140. package/cjs/Input/Input.js +26 -43
  141. package/cjs/Input/index.js +1 -3
  142. package/cjs/InputGroup/InputGroup.js +23 -39
  143. package/cjs/InputGroup/InputGroupAddon.js +9 -18
  144. package/cjs/InputGroup/InputGroupButton.js +7 -17
  145. package/cjs/InputGroup/index.js +1 -3
  146. package/cjs/InputNumber/InputNumber.js +42 -88
  147. package/cjs/InputNumber/index.js +1 -3
  148. package/cjs/InputPicker/InputAutosize.js +17 -42
  149. package/cjs/InputPicker/InputPicker.js +149 -250
  150. package/cjs/InputPicker/InputSearch.js +15 -28
  151. package/cjs/InputPicker/index.js +1 -3
  152. package/cjs/List/List.js +37 -51
  153. package/cjs/List/ListContext.js +1 -5
  154. package/cjs/List/ListItem.js +26 -40
  155. package/cjs/List/helper/AutoScroller.js +11 -21
  156. package/cjs/List/helper/useManager.js +1 -8
  157. package/cjs/List/helper/useSortHelper.js +58 -82
  158. package/cjs/List/helper/utils.js +6 -19
  159. package/cjs/List/index.js +1 -3
  160. package/cjs/Loader/Loader.js +17 -26
  161. package/cjs/Loader/index.js +1 -3
  162. package/cjs/MaskedInput/MaskedInput.js +2 -8
  163. package/cjs/MaskedInput/TextMask.js +14 -23
  164. package/cjs/MaskedInput/adjustCaretPosition.js +99 -70
  165. package/cjs/MaskedInput/conformToMask.js +79 -73
  166. package/cjs/MaskedInput/createTextMaskInputElement.js +65 -71
  167. package/cjs/MaskedInput/index.js +1 -3
  168. package/cjs/MaskedInput/types.js +1 -0
  169. package/cjs/MaskedInput/utilities.js +1 -8
  170. package/cjs/Menu/Menu.js +35 -79
  171. package/cjs/Menu/MenuContext.js +1 -8
  172. package/cjs/Menu/MenuItem.js +15 -26
  173. package/cjs/Menu/Menubar.js +13 -32
  174. package/cjs/Menu/index.js +1 -3
  175. package/cjs/Menu/useMenu.js +5 -34
  176. package/cjs/Message/Message.js +23 -45
  177. package/cjs/Message/index.js +1 -3
  178. package/cjs/Modal/Modal.js +70 -91
  179. package/cjs/Modal/ModalBody.js +11 -25
  180. package/cjs/Modal/ModalContext.js +1 -4
  181. package/cjs/Modal/ModalDialog.js +14 -26
  182. package/cjs/Modal/ModalFooter.js +1 -3
  183. package/cjs/Modal/ModalHeader.js +14 -29
  184. package/cjs/Modal/ModalTitle.js +9 -20
  185. package/cjs/Modal/index.js +1 -3
  186. package/cjs/Modal/utils.js +8 -19
  187. package/cjs/MultiCascader/DropdownMenu.js +38 -64
  188. package/cjs/MultiCascader/MultiCascader.js +129 -192
  189. package/cjs/MultiCascader/index.js +1 -3
  190. package/cjs/MultiCascader/utils.js +44 -106
  191. package/cjs/Nav/Nav.js +27 -69
  192. package/cjs/Nav/NavContext.js +1 -4
  193. package/cjs/Nav/NavDropdown.js +28 -60
  194. package/cjs/Nav/NavDropdownItem.js +20 -42
  195. package/cjs/Nav/NavDropdownMenu.js +26 -54
  196. package/cjs/Nav/NavDropdownToggle.js +12 -26
  197. package/cjs/Nav/NavItem.js +20 -39
  198. package/cjs/Nav/NavMenu.js +2 -28
  199. package/cjs/Nav/index.js +1 -3
  200. package/cjs/Navbar/Navbar.js +10 -23
  201. package/cjs/Navbar/NavbarBody.js +1 -6
  202. package/cjs/Navbar/NavbarBrand.js +1 -3
  203. package/cjs/Navbar/NavbarDropdown.js +25 -49
  204. package/cjs/Navbar/NavbarDropdownItem.js +18 -44
  205. package/cjs/Navbar/NavbarDropdownMenu.js +22 -51
  206. package/cjs/Navbar/NavbarDropdownToggle.js +12 -25
  207. package/cjs/Navbar/NavbarHeader.js +1 -6
  208. package/cjs/Navbar/NavbarItem.js +19 -35
  209. package/cjs/Navbar/index.js +1 -3
  210. package/cjs/Notification/Notification.js +20 -43
  211. package/cjs/Notification/index.js +1 -3
  212. package/cjs/Overlay/Modal.js +40 -79
  213. package/cjs/Overlay/ModalManager.js +1 -26
  214. package/cjs/Overlay/Overlay.js +28 -50
  215. package/cjs/Overlay/OverlayContext.js +1 -4
  216. package/cjs/Overlay/OverlayTrigger.js +67 -116
  217. package/cjs/Overlay/Position.js +25 -64
  218. package/cjs/Overlay/index.js +1 -3
  219. package/cjs/Overlay/positionUtils.js +25 -86
  220. package/cjs/Pagination/Pagination.js +30 -70
  221. package/cjs/Pagination/PaginationButton.js +15 -29
  222. package/cjs/Pagination/PaginationGroup.js +38 -63
  223. package/cjs/Pagination/index.js +1 -3
  224. package/cjs/Panel/Panel.js +37 -61
  225. package/cjs/Panel/index.js +1 -3
  226. package/cjs/PanelGroup/PanelGroup.js +16 -29
  227. package/cjs/PanelGroup/index.js +1 -3
  228. package/cjs/Picker/DropdownMenu.js +50 -93
  229. package/cjs/Picker/DropdownMenuCheckItem.js +22 -33
  230. package/cjs/Picker/DropdownMenuGroup.js +10 -22
  231. package/cjs/Picker/DropdownMenuItem.js +15 -26
  232. package/cjs/Picker/PickerOverlay.js +12 -28
  233. package/cjs/Picker/PickerToggle.js +57 -89
  234. package/cjs/Picker/PickerToggleTrigger.js +8 -19
  235. package/cjs/Picker/SearchBar.js +14 -26
  236. package/cjs/Picker/SelectedElement.js +9 -17
  237. package/cjs/Picker/ToggleButton.js +1 -6
  238. package/cjs/Picker/index.js +1 -24
  239. package/cjs/Picker/propTypes.js +1 -7
  240. package/cjs/Picker/types.js +1 -0
  241. package/cjs/Picker/utils.js +94 -200
  242. package/cjs/Placeholder/Placeholder.js +1 -5
  243. package/cjs/Placeholder/PlaceholderGraph.js +13 -22
  244. package/cjs/Placeholder/PlaceholderGrid.js +18 -34
  245. package/cjs/Placeholder/PlaceholderParagraph.js +17 -29
  246. package/cjs/Placeholder/index.js +1 -3
  247. package/cjs/Plaintext/Plaintext.js +14 -23
  248. package/cjs/Plaintext/index.js +1 -3
  249. package/cjs/Popover/Popover.js +16 -27
  250. package/cjs/Popover/index.js +1 -3
  251. package/cjs/Progress/Progress.js +1 -4
  252. package/cjs/Progress/ProgressCircle.js +30 -47
  253. package/cjs/Progress/ProgressLine.js +19 -29
  254. package/cjs/Progress/index.js +1 -3
  255. package/cjs/Radio/Radio.js +42 -62
  256. package/cjs/Radio/index.js +1 -3
  257. package/cjs/RadioGroup/RadioGroup.js +22 -37
  258. package/cjs/RadioGroup/index.js +1 -3
  259. package/cjs/RadioTile/RadioTile.js +30 -47
  260. package/cjs/RadioTile/index.js +1 -3
  261. package/cjs/RadioTileGroup/RadioTileGroup.js +17 -32
  262. package/cjs/RadioTileGroup/index.js +1 -3
  263. package/cjs/RangeSlider/RangeSlider.js +63 -104
  264. package/cjs/RangeSlider/index.js +1 -3
  265. package/cjs/Rate/Character.js +16 -31
  266. package/cjs/Rate/Rate.js +35 -62
  267. package/cjs/Rate/index.js +1 -3
  268. package/cjs/Rate/utils.js +1 -6
  269. package/cjs/Ripple/Ripple.js +16 -40
  270. package/cjs/Ripple/index.js +1 -3
  271. package/cjs/Row/Row.js +11 -22
  272. package/cjs/Row/index.js +1 -3
  273. package/cjs/SafeAnchor/SafeAnchor.js +8 -19
  274. package/cjs/SafeAnchor/index.js +1 -3
  275. package/cjs/Schema/Schema.js +1 -2
  276. package/cjs/Schema/index.js +1 -3
  277. package/cjs/SelectPicker/SelectPicker.js +136 -170
  278. package/cjs/SelectPicker/index.js +1 -3
  279. package/cjs/Sidebar/Sidebar.js +13 -26
  280. package/cjs/Sidebar/index.js +1 -3
  281. package/cjs/Sidenav/ExpandedSidenavDropdown.js +32 -54
  282. package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +19 -41
  283. package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +22 -46
  284. package/cjs/Sidenav/Node.js +1 -12
  285. package/cjs/Sidenav/Sidenav.js +22 -45
  286. package/cjs/Sidenav/SidenavBody.js +1 -3
  287. package/cjs/Sidenav/SidenavDropdown.js +39 -70
  288. package/cjs/Sidenav/SidenavDropdownCollapse.js +9 -22
  289. package/cjs/Sidenav/SidenavDropdownItem.js +19 -45
  290. package/cjs/Sidenav/SidenavDropdownMenu.js +26 -54
  291. package/cjs/Sidenav/SidenavDropdownToggle.js +12 -25
  292. package/cjs/Sidenav/SidenavHeader.js +1 -3
  293. package/cjs/Sidenav/SidenavItem.js +27 -55
  294. package/cjs/Sidenav/SidenavToggle.js +11 -31
  295. package/cjs/Sidenav/index.js +1 -3
  296. package/cjs/Slider/Graduated.js +14 -29
  297. package/cjs/Slider/Handle.js +27 -52
  298. package/cjs/Slider/Input.js +2 -8
  299. package/cjs/Slider/Mark.js +11 -20
  300. package/cjs/Slider/ProgressBar.js +14 -23
  301. package/cjs/Slider/Slider.js +51 -84
  302. package/cjs/Slider/index.js +1 -3
  303. package/cjs/Slider/utils.js +1 -6
  304. package/cjs/Stack/Stack.js +22 -35
  305. package/cjs/Stack/StackItem.js +11 -17
  306. package/cjs/Stack/index.js +1 -3
  307. package/cjs/Steps/StepItem.js +16 -32
  308. package/cjs/Steps/Steps.js +18 -32
  309. package/cjs/Steps/index.js +1 -3
  310. package/cjs/Table/Table.js +6 -16
  311. package/cjs/Table/index.js +1 -3
  312. package/cjs/Tag/Tag.js +16 -28
  313. package/cjs/Tag/index.js +1 -3
  314. package/cjs/TagGroup/TagGroup.js +1 -3
  315. package/cjs/TagGroup/index.js +1 -3
  316. package/cjs/TagInput/index.js +7 -14
  317. package/cjs/TagPicker/index.js +5 -12
  318. package/cjs/Timeline/Timeline.js +14 -29
  319. package/cjs/Timeline/TimelineItem.js +14 -23
  320. package/cjs/Timeline/index.js +1 -3
  321. package/cjs/Toggle/Toggle.js +26 -45
  322. package/cjs/Toggle/index.js +1 -3
  323. package/cjs/Tooltip/Tooltip.js +13 -22
  324. package/cjs/Tooltip/index.js +1 -3
  325. package/cjs/Tree/Tree.js +1 -10
  326. package/cjs/Tree/TreeContext.js +1 -4
  327. package/cjs/Tree/index.js +1 -3
  328. package/cjs/TreePicker/TreeNode.js +37 -60
  329. package/cjs/TreePicker/TreePicker.js +155 -231
  330. package/cjs/TreePicker/index.js +1 -3
  331. package/cjs/Uploader/UploadFileItem.js +37 -82
  332. package/cjs/Uploader/UploadTrigger.js +24 -46
  333. package/cjs/Uploader/Uploader.js +89 -141
  334. package/cjs/Uploader/index.js +1 -3
  335. package/cjs/Whisper/Whisper.js +8 -20
  336. package/cjs/Whisper/index.js +1 -3
  337. package/cjs/Windowing/AutoSizer.js +13 -33
  338. package/cjs/Windowing/List.d.ts +2 -2
  339. package/cjs/Windowing/List.js +6 -22
  340. package/cjs/Windowing/index.js +1 -7
  341. package/cjs/index.js +1 -164
  342. package/cjs/locales/ar_EG.js +1 -4
  343. package/cjs/locales/da_DK.js +1 -5
  344. package/cjs/locales/de_DE.js +1 -5
  345. package/cjs/locales/default.js +1 -5
  346. package/cjs/locales/en_GB.js +1 -3
  347. package/cjs/locales/en_US.js +1 -4
  348. package/cjs/locales/es_AR.js +1 -5
  349. package/cjs/locales/es_ES.js +1 -5
  350. package/cjs/locales/fa_IR.js +1 -4
  351. package/cjs/locales/fi_FI.js +1 -5
  352. package/cjs/locales/fr_FR.js +1 -4
  353. package/cjs/locales/hu_HU.js +1 -5
  354. package/cjs/locales/index.js +1 -47
  355. package/cjs/locales/it_IT.js +1 -5
  356. package/cjs/locales/ja_JP.js +1 -5
  357. package/cjs/locales/kk_KZ.js +1 -4
  358. package/cjs/locales/ko_KR.js +1 -5
  359. package/cjs/locales/ne_NP.js +1 -5
  360. package/cjs/locales/nl_NL.js +1 -4
  361. package/cjs/locales/pt_BR.js +1 -4
  362. package/cjs/locales/ru_RU.js +1 -4
  363. package/cjs/locales/sv_SE.js +1 -5
  364. package/cjs/locales/tr_TR.js +1 -4
  365. package/cjs/locales/zh_CN.js +1 -4
  366. package/cjs/locales/zh_TW.js +1 -4
  367. package/cjs/toaster/ToastContainer.js +29 -52
  368. package/cjs/toaster/ToastContext.js +1 -4
  369. package/cjs/toaster/index.js +1 -4
  370. package/cjs/toaster/toaster.js +4 -27
  371. package/cjs/toaster/useToaster.js +2 -8
  372. package/cjs/utils/BrowserDetection.js +7 -24
  373. package/cjs/utils/ReactChildren.js +2 -19
  374. package/cjs/utils/ajaxUpload.js +15 -33
  375. package/cjs/utils/appendTooltip.js +3 -9
  376. package/cjs/utils/attachParent.js +1 -1
  377. package/cjs/utils/clone.js +1 -2
  378. package/cjs/utils/composeFunctions.js +1 -3
  379. package/cjs/utils/constants.js +3 -8
  380. package/cjs/utils/createChainedFunction.js +2 -6
  381. package/cjs/utils/createComponent.js +12 -24
  382. package/cjs/utils/dateUtils.js +7 -121
  383. package/cjs/utils/deprecateComponent.js +1 -8
  384. package/cjs/utils/deprecatePropType.js +2 -9
  385. package/cjs/utils/dom.js +3 -2
  386. package/cjs/utils/events.js +2 -3
  387. package/cjs/utils/getDOMNode.js +16 -9
  388. package/cjs/utils/getDataGroupBy.d.ts +0 -23
  389. package/cjs/utils/getDataGroupBy.js +5 -44
  390. package/cjs/utils/getSafeRegExpString.js +1 -1
  391. package/cjs/utils/guid.js +1 -1
  392. package/cjs/utils/htmlPropsUtils.js +23 -20
  393. package/cjs/utils/index.js +1 -86
  394. package/cjs/utils/isOneOf.js +1 -2
  395. package/cjs/utils/mergeRefs.js +1 -2
  396. package/cjs/utils/placementPolyfill.js +2 -5
  397. package/cjs/utils/prefix.js +4 -15
  398. package/cjs/utils/previewFile.js +1 -6
  399. package/cjs/utils/propTypeChecker.js +1 -8
  400. package/cjs/utils/reactToString.js +1 -5
  401. package/cjs/utils/render.js +3 -10
  402. package/cjs/utils/scrollTopAnimation.js +1 -9
  403. package/cjs/utils/shallowEqual.js +8 -14
  404. package/cjs/utils/shallowEqualArray.js +1 -7
  405. package/cjs/utils/statusIcons.js +1 -9
  406. package/cjs/utils/stringToObject.js +1 -7
  407. package/cjs/utils/tplTransform.js +2 -7
  408. package/cjs/utils/treeUtils.d.ts +1 -1
  409. package/cjs/utils/treeUtils.js +119 -334
  410. package/cjs/utils/useClassNames.js +9 -15
  411. package/cjs/utils/useClickOutside.js +4 -8
  412. package/cjs/utils/useControlled.js +11 -7
  413. package/cjs/utils/useCustom.js +12 -25
  414. package/cjs/utils/useElementResize.js +1 -6
  415. package/cjs/utils/useEnsuredRef.js +1 -4
  416. package/cjs/utils/useEventCallback.js +1 -4
  417. package/cjs/utils/useEventListener.js +1 -5
  418. package/cjs/utils/useFocus.js +5 -6
  419. package/cjs/utils/useInternalId.js +1 -6
  420. package/cjs/utils/useIsMounted.js +1 -3
  421. package/cjs/utils/useMap.js +5 -7
  422. package/cjs/utils/useMount.js +1 -4
  423. package/cjs/utils/usePortal.js +7 -20
  424. package/cjs/utils/useRootClose.js +9 -19
  425. package/cjs/utils/useTimeout.js +3 -8
  426. package/cjs/utils/useToggleCaret.js +2 -14
  427. package/cjs/utils/useUniqueId.js +2 -9
  428. package/cjs/utils/useUpdateEffect.js +3 -5
  429. package/cjs/utils/useUpdatedRef.js +1 -2
  430. package/cjs/utils/useWillUnmount.js +3 -5
  431. package/cjs/utils/warnOnce.js +2 -2
  432. package/dist/rsuite-no-reset-rtl.css +23 -25
  433. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  434. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  435. package/dist/rsuite-no-reset.css +23 -25
  436. package/dist/rsuite-no-reset.min.css +1 -1
  437. package/dist/rsuite-no-reset.min.css.map +1 -1
  438. package/dist/rsuite-rtl.css +23 -25
  439. package/dist/rsuite-rtl.min.css +1 -1
  440. package/dist/rsuite-rtl.min.css.map +1 -1
  441. package/dist/rsuite.css +23 -25
  442. package/dist/rsuite.js +407 -440
  443. package/dist/rsuite.js.map +1 -1
  444. package/dist/rsuite.min.css +1 -1
  445. package/dist/rsuite.min.css.map +1 -1
  446. package/dist/rsuite.min.js +1 -1
  447. package/dist/rsuite.min.js.map +1 -1
  448. package/esm/@types/common.js +1 -0
  449. package/esm/@types/utils.js +14 -2
  450. package/esm/Affix/Affix.js +39 -50
  451. package/esm/Affix/index.js +1 -0
  452. package/esm/Animation/Bounce.js +4 -5
  453. package/esm/Animation/Collapse.js +19 -26
  454. package/esm/Animation/Fade.js +6 -7
  455. package/esm/Animation/Slide.js +6 -7
  456. package/esm/Animation/Transition.js +16 -69
  457. package/esm/Animation/index.js +1 -0
  458. package/esm/Animation/utils.js +1 -2
  459. package/esm/AutoComplete/AutoComplete.js +55 -75
  460. package/esm/AutoComplete/index.js +1 -0
  461. package/esm/AutoComplete/utils.js +1 -4
  462. package/esm/Avatar/Avatar.js +18 -22
  463. package/esm/Avatar/index.js +1 -0
  464. package/esm/AvatarGroup/AvatarGroup.js +13 -16
  465. package/esm/AvatarGroup/index.js +1 -0
  466. package/esm/Badge/Badge.js +14 -19
  467. package/esm/Badge/index.js +1 -0
  468. package/esm/Breadcrumb/Breadcrumb.js +19 -30
  469. package/esm/Breadcrumb/BreadcrumbItem.js +14 -17
  470. package/esm/Breadcrumb/index.js +1 -0
  471. package/esm/Button/Button.js +22 -28
  472. package/esm/Button/index.js +1 -0
  473. package/esm/ButtonGroup/ButtonGroup.js +15 -16
  474. package/esm/ButtonGroup/ButtonGroupContext.js +1 -0
  475. package/esm/ButtonGroup/index.js +1 -0
  476. package/esm/ButtonToolbar/ButtonToolbar.js +10 -12
  477. package/esm/ButtonToolbar/index.js +1 -0
  478. package/esm/Calendar/Calendar.js +24 -29
  479. package/esm/Calendar/CalendarBody.js +14 -18
  480. package/esm/Calendar/CalendarContainer.js +46 -51
  481. package/esm/Calendar/CalendarContext.js +1 -0
  482. package/esm/Calendar/CalendarHeader.js +32 -41
  483. package/esm/Calendar/MonthDropdown.js +22 -27
  484. package/esm/Calendar/MonthDropdownItem.js +16 -20
  485. package/esm/Calendar/Table.js +10 -11
  486. package/esm/Calendar/TableHeaderRow.js +11 -15
  487. package/esm/Calendar/TableRow.js +36 -50
  488. package/esm/Calendar/TimeDropdown.js +24 -48
  489. package/esm/Calendar/index.js +1 -0
  490. package/esm/Calendar/types.js +1 -0
  491. package/esm/Calendar/useCalendarDate.js +3 -11
  492. package/esm/Calendar/useCalendarState.js +3 -6
  493. package/esm/Carousel/Carousel.js +40 -52
  494. package/esm/Carousel/index.js +1 -0
  495. package/esm/Cascader/Cascader.js +126 -178
  496. package/esm/Cascader/DropdownMenu.js +33 -45
  497. package/esm/Cascader/index.js +1 -0
  498. package/esm/Cascader/utils.js +13 -22
  499. package/esm/CheckPicker/CheckPicker.js +105 -139
  500. package/esm/CheckPicker/index.js +1 -0
  501. package/esm/CheckTree/index.js +1 -0
  502. package/esm/CheckTreePicker/CheckTreeNode.js +28 -44
  503. package/esm/CheckTreePicker/CheckTreePicker.js +166 -233
  504. package/esm/CheckTreePicker/index.js +1 -0
  505. package/esm/CheckTreePicker/utils.d.ts +1 -1
  506. package/esm/CheckTreePicker/utils.js +14 -37
  507. package/esm/Checkbox/Checkbox.js +48 -66
  508. package/esm/Checkbox/index.js +1 -0
  509. package/esm/CheckboxGroup/CheckboxGroup.js +20 -25
  510. package/esm/CheckboxGroup/CheckboxGroupContext.js +1 -0
  511. package/esm/CheckboxGroup/index.js +1 -0
  512. package/esm/CloseButton/CloseButton.js +10 -13
  513. package/esm/CloseButton/index.js +1 -0
  514. package/esm/Col/Col.js +10 -13
  515. package/esm/Col/index.js +1 -0
  516. package/esm/Container/Container.js +11 -13
  517. package/esm/Container/index.js +1 -0
  518. package/esm/Content/Content.js +1 -1
  519. package/esm/Content/index.js +1 -0
  520. package/esm/CustomProvider/CustomProvider.js +13 -16
  521. package/esm/CustomProvider/FormattedDate.js +3 -6
  522. package/esm/CustomProvider/index.js +1 -0
  523. package/esm/DOMHelper/index.js +1 -2
  524. package/esm/DOMHelper/isElement.js +1 -1
  525. package/esm/DatePicker/DatePicker.js +108 -131
  526. package/esm/DatePicker/PredefinedRanges.js +12 -19
  527. package/esm/DatePicker/Toolbar.js +20 -26
  528. package/esm/DatePicker/index.js +1 -0
  529. package/esm/DatePicker/types.js +1 -0
  530. package/esm/DatePicker/utils.js +5 -8
  531. package/esm/DateRangePicker/Calendar.js +18 -18
  532. package/esm/DateRangePicker/DateRangePicker.js +128 -184
  533. package/esm/DateRangePicker/DateRangePickerContext.js +1 -0
  534. package/esm/DateRangePicker/disabledDateUtils.js +9 -24
  535. package/esm/DateRangePicker/index.js +1 -0
  536. package/esm/DateRangePicker/types.js +1 -0
  537. package/esm/DateRangePicker/utils.js +7 -12
  538. package/esm/Disclosure/Disclosure.js +13 -24
  539. package/esm/Disclosure/DisclosureButton.js +4 -7
  540. package/esm/Disclosure/DisclosureContent.js +1 -2
  541. package/esm/Disclosure/DisclosureContext.js +1 -2
  542. package/esm/Disclosure/index.js +1 -0
  543. package/esm/Disclosure/useDisclosureContext.js +1 -2
  544. package/esm/Divider/Divider.js +11 -12
  545. package/esm/Divider/index.js +1 -0
  546. package/esm/Drawer/Drawer.js +10 -11
  547. package/esm/Drawer/index.js +1 -0
  548. package/esm/Dropdown/Dropdown.js +35 -50
  549. package/esm/Dropdown/DropdownContext.js +1 -0
  550. package/esm/Dropdown/DropdownItem.js +22 -31
  551. package/esm/Dropdown/DropdownMenu.js +36 -49
  552. package/esm/Dropdown/DropdownSeparator.js +8 -10
  553. package/esm/Dropdown/DropdownState.js +1 -7
  554. package/esm/Dropdown/DropdownToggle.js +17 -17
  555. package/esm/Dropdown/index.js +1 -0
  556. package/esm/Dropdown/useRenderDropdownItem.js +1 -2
  557. package/esm/FlexboxGrid/FlexboxGrid.js +12 -13
  558. package/esm/FlexboxGrid/FlexboxGridItem.js +12 -14
  559. package/esm/FlexboxGrid/index.js +1 -0
  560. package/esm/Footer/Footer.js +1 -0
  561. package/esm/Footer/index.js +1 -0
  562. package/esm/Form/Form.js +36 -63
  563. package/esm/Form/FormContext.js +1 -0
  564. package/esm/Form/index.js +1 -0
  565. package/esm/Form/useFormClassNames.js +11 -13
  566. package/esm/Form/useSchemaModel.js +2 -4
  567. package/esm/FormControl/FormControl.js +48 -68
  568. package/esm/FormControl/index.js +1 -0
  569. package/esm/FormControl/useRegisterModel.js +1 -2
  570. package/esm/FormControlLabel/FormControlLabel.js +10 -12
  571. package/esm/FormControlLabel/index.js +1 -0
  572. package/esm/FormErrorMessage/FormErrorMessage.js +12 -18
  573. package/esm/FormErrorMessage/index.js +1 -0
  574. package/esm/FormGroup/FormGroup.js +9 -10
  575. package/esm/FormGroup/index.js +1 -0
  576. package/esm/FormHelpText/FormHelpText.js +11 -15
  577. package/esm/FormHelpText/index.js +1 -0
  578. package/esm/Grid/Grid.js +10 -11
  579. package/esm/Grid/index.js +1 -0
  580. package/esm/Header/Header.js +1 -0
  581. package/esm/Header/index.js +1 -0
  582. package/esm/IconButton/IconButton.js +11 -12
  583. package/esm/IconButton/index.js +1 -0
  584. package/esm/Input/Input.js +26 -32
  585. package/esm/Input/index.js +1 -0
  586. package/esm/InputGroup/InputGroup.js +23 -26
  587. package/esm/InputGroup/InputGroupAddon.js +9 -10
  588. package/esm/InputGroup/InputGroupButton.js +7 -9
  589. package/esm/InputGroup/index.js +1 -0
  590. package/esm/InputNumber/InputNumber.js +42 -72
  591. package/esm/InputNumber/index.js +1 -0
  592. package/esm/InputPicker/InputAutosize.js +17 -37
  593. package/esm/InputPicker/InputPicker.js +149 -225
  594. package/esm/InputPicker/InputSearch.js +15 -20
  595. package/esm/InputPicker/index.js +1 -0
  596. package/esm/List/List.js +37 -39
  597. package/esm/List/ListContext.js +1 -0
  598. package/esm/List/ListItem.js +26 -30
  599. package/esm/List/helper/AutoScroller.js +11 -21
  600. package/esm/List/helper/useManager.js +1 -6
  601. package/esm/List/helper/useSortHelper.js +58 -74
  602. package/esm/List/helper/utils.js +6 -11
  603. package/esm/List/index.js +1 -0
  604. package/esm/Loader/Loader.js +17 -19
  605. package/esm/Loader/index.js +1 -0
  606. package/esm/MaskedInput/MaskedInput.js +2 -1
  607. package/esm/MaskedInput/TextMask.js +12 -14
  608. package/esm/MaskedInput/adjustCaretPosition.js +99 -69
  609. package/esm/MaskedInput/conformToMask.js +79 -70
  610. package/esm/MaskedInput/createTextMaskInputElement.js +65 -62
  611. package/esm/MaskedInput/index.js +1 -0
  612. package/esm/MaskedInput/types.js +1 -0
  613. package/esm/MaskedInput/utilities.js +1 -6
  614. package/esm/Menu/Menu.js +35 -66
  615. package/esm/Menu/MenuContext.js +1 -4
  616. package/esm/Menu/MenuItem.js +15 -19
  617. package/esm/Menu/Menubar.js +13 -23
  618. package/esm/Menu/index.js +1 -0
  619. package/esm/Menu/useMenu.js +4 -27
  620. package/esm/Message/Message.js +23 -34
  621. package/esm/Message/index.js +1 -0
  622. package/esm/Modal/Modal.js +70 -69
  623. package/esm/Modal/ModalBody.js +11 -13
  624. package/esm/Modal/ModalContext.js +1 -0
  625. package/esm/Modal/ModalDialog.js +14 -18
  626. package/esm/Modal/ModalFooter.js +1 -0
  627. package/esm/Modal/ModalHeader.js +14 -16
  628. package/esm/Modal/ModalTitle.js +9 -10
  629. package/esm/Modal/index.js +1 -0
  630. package/esm/Modal/utils.js +8 -12
  631. package/esm/MultiCascader/DropdownMenu.js +38 -48
  632. package/esm/MultiCascader/MultiCascader.js +129 -174
  633. package/esm/MultiCascader/index.js +1 -0
  634. package/esm/MultiCascader/utils.js +44 -87
  635. package/esm/Nav/Nav.js +27 -45
  636. package/esm/Nav/NavContext.js +1 -0
  637. package/esm/Nav/NavDropdown.js +28 -44
  638. package/esm/Nav/NavDropdownItem.js +20 -31
  639. package/esm/Nav/NavDropdownMenu.js +26 -42
  640. package/esm/Nav/NavDropdownToggle.js +12 -15
  641. package/esm/Nav/NavItem.js +20 -28
  642. package/esm/Nav/NavMenu.js +2 -13
  643. package/esm/Nav/index.js +1 -0
  644. package/esm/Navbar/Navbar.js +10 -11
  645. package/esm/Navbar/NavbarBody.js +1 -0
  646. package/esm/Navbar/NavbarBrand.js +1 -0
  647. package/esm/Navbar/NavbarDropdown.js +25 -33
  648. package/esm/Navbar/NavbarDropdownItem.js +18 -30
  649. package/esm/Navbar/NavbarDropdownMenu.js +22 -37
  650. package/esm/Navbar/NavbarDropdownToggle.js +12 -14
  651. package/esm/Navbar/NavbarHeader.js +1 -0
  652. package/esm/Navbar/NavbarItem.js +19 -23
  653. package/esm/Navbar/index.js +1 -0
  654. package/esm/Notification/Notification.js +20 -32
  655. package/esm/Notification/index.js +1 -0
  656. package/esm/Overlay/Modal.js +40 -64
  657. package/esm/Overlay/ModalManager.js +1 -19
  658. package/esm/Overlay/Overlay.js +28 -37
  659. package/esm/Overlay/OverlayContext.js +1 -0
  660. package/esm/Overlay/OverlayTrigger.js +68 -101
  661. package/esm/Overlay/Position.js +25 -47
  662. package/esm/Overlay/index.js +1 -0
  663. package/esm/Overlay/positionUtils.js +25 -73
  664. package/esm/Pagination/Pagination.js +30 -55
  665. package/esm/Pagination/PaginationButton.js +15 -19
  666. package/esm/Pagination/PaginationGroup.js +38 -49
  667. package/esm/Pagination/index.js +1 -0
  668. package/esm/Panel/Panel.js +37 -49
  669. package/esm/Panel/index.js +1 -0
  670. package/esm/PanelGroup/PanelGroup.js +16 -18
  671. package/esm/PanelGroup/index.js +1 -0
  672. package/esm/Picker/DropdownMenu.js +50 -72
  673. package/esm/Picker/DropdownMenuCheckItem.js +22 -24
  674. package/esm/Picker/DropdownMenuGroup.js +10 -13
  675. package/esm/Picker/DropdownMenuItem.js +15 -18
  676. package/esm/Picker/PickerOverlay.js +12 -17
  677. package/esm/Picker/PickerToggle.js +57 -71
  678. package/esm/Picker/PickerToggleTrigger.js +8 -10
  679. package/esm/Picker/SearchBar.js +14 -15
  680. package/esm/Picker/SelectedElement.js +9 -14
  681. package/esm/Picker/ToggleButton.js +1 -0
  682. package/esm/Picker/index.js +1 -0
  683. package/esm/Picker/propTypes.js +1 -1
  684. package/esm/Picker/types.js +1 -0
  685. package/esm/Picker/utils.js +94 -182
  686. package/esm/Placeholder/Placeholder.js +1 -0
  687. package/esm/Placeholder/PlaceholderGraph.js +13 -16
  688. package/esm/Placeholder/PlaceholderGrid.js +18 -25
  689. package/esm/Placeholder/PlaceholderParagraph.js +17 -20
  690. package/esm/Placeholder/index.js +1 -0
  691. package/esm/Plaintext/Plaintext.js +14 -17
  692. package/esm/Plaintext/index.js +1 -0
  693. package/esm/Popover/Popover.js +16 -21
  694. package/esm/Popover/index.js +1 -0
  695. package/esm/Progress/Progress.js +1 -0
  696. package/esm/Progress/ProgressCircle.js +30 -39
  697. package/esm/Progress/ProgressLine.js +19 -21
  698. package/esm/Progress/index.js +1 -0
  699. package/esm/Radio/Radio.js +42 -52
  700. package/esm/Radio/index.js +1 -0
  701. package/esm/RadioGroup/RadioGroup.js +22 -25
  702. package/esm/RadioGroup/index.js +1 -0
  703. package/esm/RadioTile/RadioTile.js +30 -34
  704. package/esm/RadioTile/index.js +1 -0
  705. package/esm/RadioTileGroup/RadioTileGroup.js +17 -20
  706. package/esm/RadioTileGroup/index.js +1 -0
  707. package/esm/RangeSlider/RangeSlider.js +63 -86
  708. package/esm/RangeSlider/index.js +1 -0
  709. package/esm/Rate/Character.js +16 -21
  710. package/esm/Rate/Rate.js +35 -48
  711. package/esm/Rate/index.js +1 -0
  712. package/esm/Rate/utils.js +1 -2
  713. package/esm/Ripple/Ripple.js +16 -30
  714. package/esm/Ripple/index.js +1 -0
  715. package/esm/Row/Row.js +11 -14
  716. package/esm/Row/index.js +1 -0
  717. package/esm/SafeAnchor/SafeAnchor.js +8 -13
  718. package/esm/SafeAnchor/index.js +1 -0
  719. package/esm/Schema/Schema.js +1 -0
  720. package/esm/Schema/index.js +1 -0
  721. package/esm/SelectPicker/SelectPicker.js +137 -157
  722. package/esm/SelectPicker/index.js +1 -0
  723. package/esm/Sidebar/Sidebar.js +13 -18
  724. package/esm/Sidebar/index.js +1 -0
  725. package/esm/Sidenav/ExpandedSidenavDropdown.js +32 -35
  726. package/esm/Sidenav/ExpandedSidenavDropdownItem.js +19 -27
  727. package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +22 -29
  728. package/esm/Sidenav/Node.js +1 -10
  729. package/esm/Sidenav/Sidenav.js +22 -28
  730. package/esm/Sidenav/SidenavBody.js +1 -0
  731. package/esm/Sidenav/SidenavDropdown.js +39 -52
  732. package/esm/Sidenav/SidenavDropdownCollapse.js +9 -13
  733. package/esm/Sidenav/SidenavDropdownItem.js +19 -31
  734. package/esm/Sidenav/SidenavDropdownMenu.js +26 -41
  735. package/esm/Sidenav/SidenavDropdownToggle.js +12 -14
  736. package/esm/Sidenav/SidenavHeader.js +1 -0
  737. package/esm/Sidenav/SidenavItem.js +27 -37
  738. package/esm/Sidenav/SidenavToggle.js +11 -18
  739. package/esm/Sidenav/index.js +1 -0
  740. package/esm/Slider/Graduated.js +14 -21
  741. package/esm/Slider/Handle.js +27 -39
  742. package/esm/Slider/Input.js +2 -2
  743. package/esm/Slider/Mark.js +11 -14
  744. package/esm/Slider/ProgressBar.js +14 -18
  745. package/esm/Slider/Slider.js +51 -67
  746. package/esm/Slider/index.js +1 -0
  747. package/esm/Slider/utils.js +1 -5
  748. package/esm/Stack/Stack.js +22 -27
  749. package/esm/Stack/StackItem.js +11 -11
  750. package/esm/Stack/index.js +1 -0
  751. package/esm/Steps/StepItem.js +16 -22
  752. package/esm/Steps/Steps.js +18 -22
  753. package/esm/Steps/index.js +1 -0
  754. package/esm/Table/Table.js +6 -7
  755. package/esm/Table/index.js +1 -0
  756. package/esm/Tag/Tag.js +16 -19
  757. package/esm/Tag/index.js +1 -0
  758. package/esm/TagGroup/TagGroup.js +1 -0
  759. package/esm/TagGroup/index.js +1 -0
  760. package/esm/TagInput/index.js +7 -7
  761. package/esm/TagPicker/index.js +5 -5
  762. package/esm/Timeline/Timeline.js +14 -19
  763. package/esm/Timeline/TimelineItem.js +14 -15
  764. package/esm/Timeline/index.js +1 -0
  765. package/esm/Toggle/Toggle.js +26 -35
  766. package/esm/Toggle/index.js +1 -0
  767. package/esm/Tooltip/Tooltip.js +13 -16
  768. package/esm/Tooltip/index.js +1 -0
  769. package/esm/Tree/Tree.js +1 -3
  770. package/esm/Tree/TreeContext.js +1 -0
  771. package/esm/Tree/index.js +1 -0
  772. package/esm/TreePicker/TreeNode.js +37 -49
  773. package/esm/TreePicker/TreePicker.js +155 -218
  774. package/esm/TreePicker/index.js +1 -0
  775. package/esm/Uploader/UploadFileItem.js +37 -68
  776. package/esm/Uploader/UploadTrigger.js +24 -38
  777. package/esm/Uploader/Uploader.js +90 -132
  778. package/esm/Uploader/index.js +1 -0
  779. package/esm/Whisper/Whisper.js +8 -10
  780. package/esm/Whisper/index.js +1 -0
  781. package/esm/Windowing/AutoSizer.js +13 -24
  782. package/esm/Windowing/List.d.ts +2 -2
  783. package/esm/Windowing/List.js +6 -15
  784. package/esm/Windowing/index.js +1 -0
  785. package/esm/index.js +3 -0
  786. package/esm/locales/ar_EG.js +1 -0
  787. package/esm/locales/da_DK.js +1 -1
  788. package/esm/locales/de_DE.js +1 -1
  789. package/esm/locales/default.js +1 -1
  790. package/esm/locales/en_GB.js +1 -0
  791. package/esm/locales/en_US.js +1 -0
  792. package/esm/locales/es_AR.js +1 -1
  793. package/esm/locales/es_ES.js +1 -1
  794. package/esm/locales/fa_IR.js +1 -0
  795. package/esm/locales/fi_FI.js +1 -1
  796. package/esm/locales/fr_FR.js +1 -0
  797. package/esm/locales/hu_HU.js +1 -1
  798. package/esm/locales/index.js +1 -0
  799. package/esm/locales/it_IT.js +1 -1
  800. package/esm/locales/ja_JP.js +1 -1
  801. package/esm/locales/kk_KZ.js +1 -0
  802. package/esm/locales/ko_KR.js +1 -1
  803. package/esm/locales/ne_NP.js +1 -1
  804. package/esm/locales/nl_NL.js +1 -0
  805. package/esm/locales/pt_BR.js +1 -0
  806. package/esm/locales/ru_RU.js +1 -0
  807. package/esm/locales/sv_SE.js +1 -1
  808. package/esm/locales/tr_TR.js +1 -0
  809. package/esm/locales/zh_CN.js +1 -0
  810. package/esm/locales/zh_TW.js +1 -0
  811. package/esm/toaster/ToastContainer.js +29 -42
  812. package/esm/toaster/ToastContext.js +1 -0
  813. package/esm/toaster/index.js +1 -0
  814. package/esm/toaster/toaster.js +4 -22
  815. package/esm/toaster/useToaster.js +3 -5
  816. package/esm/utils/BrowserDetection.js +9 -9
  817. package/esm/utils/ReactChildren.js +2 -8
  818. package/esm/utils/ajaxUpload.js +15 -32
  819. package/esm/utils/appendTooltip.js +3 -3
  820. package/esm/utils/attachParent.js +1 -0
  821. package/esm/utils/clone.js +1 -1
  822. package/esm/utils/composeFunctions.js +1 -1
  823. package/esm/utils/constants.js +4 -7
  824. package/esm/utils/createChainedFunction.js +2 -5
  825. package/esm/utils/createComponent.js +12 -16
  826. package/esm/utils/dateUtils.js +7 -23
  827. package/esm/utils/deprecateComponent.js +2 -2
  828. package/esm/utils/deprecatePropType.js +4 -6
  829. package/esm/utils/dom.js +3 -1
  830. package/esm/utils/events.js +2 -1
  831. package/esm/utils/getDOMNode.js +15 -8
  832. package/esm/utils/getDataGroupBy.d.ts +0 -23
  833. package/esm/utils/getDataGroupBy.js +5 -39
  834. package/esm/utils/getSafeRegExpString.js +1 -0
  835. package/esm/utils/guid.js +1 -0
  836. package/esm/utils/htmlPropsUtils.js +23 -14
  837. package/esm/utils/index.js +2 -1
  838. package/esm/utils/isOneOf.js +1 -1
  839. package/esm/utils/mergeRefs.js +1 -1
  840. package/esm/utils/placementPolyfill.js +2 -4
  841. package/esm/utils/prefix.js +4 -4
  842. package/esm/utils/previewFile.js +1 -3
  843. package/esm/utils/propTypeChecker.js +1 -3
  844. package/esm/utils/reactToString.js +1 -2
  845. package/esm/utils/render.js +3 -5
  846. package/esm/utils/scrollTopAnimation.js +1 -5
  847. package/esm/utils/shallowEqual.js +8 -13
  848. package/esm/utils/shallowEqualArray.js +1 -5
  849. package/esm/utils/statusIcons.js +1 -0
  850. package/esm/utils/stringToObject.js +3 -4
  851. package/esm/utils/tplTransform.js +2 -4
  852. package/esm/utils/treeUtils.d.ts +1 -1
  853. package/esm/utils/treeUtils.js +120 -272
  854. package/esm/utils/useClassNames.js +9 -9
  855. package/esm/utils/useClickOutside.js +4 -6
  856. package/esm/utils/useControlled.js +12 -6
  857. package/esm/utils/useCustom.js +12 -20
  858. package/esm/utils/useElementResize.js +2 -4
  859. package/esm/utils/useEnsuredRef.js +2 -3
  860. package/esm/utils/useEventCallback.js +2 -3
  861. package/esm/utils/useEventListener.js +2 -2
  862. package/esm/utils/useFocus.js +5 -4
  863. package/esm/utils/useInternalId.js +2 -3
  864. package/esm/utils/useIsMounted.js +1 -2
  865. package/esm/utils/useMap.js +5 -5
  866. package/esm/utils/useMount.js +1 -3
  867. package/esm/utils/usePortal.js +7 -13
  868. package/esm/utils/useRootClose.js +9 -13
  869. package/esm/utils/useTimeout.js +3 -7
  870. package/esm/utils/useToggleCaret.js +2 -7
  871. package/esm/utils/useUniqueId.js +2 -4
  872. package/esm/utils/useUpdateEffect.js +3 -4
  873. package/esm/utils/useUpdatedRef.js +2 -1
  874. package/esm/utils/useWillUnmount.js +4 -2
  875. package/esm/utils/warnOnce.js +2 -2
  876. package/package.json +2 -2
  877. package/styles/color-modes/light.less +4 -4
  878. package/styles/mixins/listbox.less +0 -2
  879. package/cjs/SelectPicker/Listbox.d.ts +0 -34
  880. package/cjs/SelectPicker/Listbox.js +0 -263
  881. package/cjs/SelectPicker/ListboxOption.d.ts +0 -11
  882. package/cjs/SelectPicker/ListboxOption.js +0 -50
  883. package/cjs/SelectPicker/ListboxOptionGroup.d.ts +0 -9
  884. package/cjs/SelectPicker/ListboxOptionGroup.js +0 -69
  885. package/esm/SelectPicker/Listbox.d.ts +0 -34
  886. package/esm/SelectPicker/Listbox.js +0 -240
  887. package/esm/SelectPicker/ListboxOption.d.ts +0 -11
  888. package/esm/SelectPicker/ListboxOption.js +0 -37
  889. package/esm/SelectPicker/ListboxOptionGroup.d.ts +0 -9
  890. package/esm/SelectPicker/ListboxOptionGroup.js +0 -53
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
3
  import _extends from "@babel/runtime/helpers/esm/extends";
3
4
  import React, { useCallback, useRef, useImperativeHandle, useReducer, useEffect } from 'react';
@@ -8,20 +9,18 @@ import UploadTrigger from './UploadTrigger';
8
9
  import { ajaxUpload, useClassNames, useCustom, guid, useWillUnmount } from '../utils';
9
10
  import Plaintext from '../Plaintext';
10
11
 
12
+ // Define several states of the file during the upload process.
13
+
11
14
  var getFiles = function getFiles(event) {
12
15
  if (typeof (event === null || event === void 0 ? void 0 : event['dataTransfer']) === 'object') {
13
16
  var _event$dataTransfer;
14
-
15
17
  return event === null || event === void 0 ? void 0 : (_event$dataTransfer = event['dataTransfer']) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files;
16
18
  }
17
-
18
19
  if (event.target) {
19
20
  return event.target['files'];
20
21
  }
21
-
22
22
  return [];
23
23
  };
24
-
25
24
  var createFile = function createFile(file) {
26
25
  var fileKey = file.fileKey;
27
26
  return _extends({}, file, {
@@ -29,28 +28,26 @@ var createFile = function createFile(file) {
29
28
  progress: 0
30
29
  });
31
30
  };
32
-
33
31
  function fileListReducer(files, action) {
34
32
  var _action$files;
35
-
36
33
  switch (action.type) {
37
34
  // Add one or more files
38
35
  case 'push':
39
36
  return [].concat(files, action.files);
40
- // Remove a file by `fileKey`
41
37
 
38
+ // Remove a file by `fileKey`
42
39
  case 'remove':
43
40
  return files.filter(function (f) {
44
41
  return f.fileKey !== action.fileKey;
45
42
  });
46
- // Update a file
47
43
 
44
+ // Update a file
48
45
  case 'updateFile':
49
46
  return files.map(function (file) {
50
47
  return file.fileKey === action.file.fileKey ? action.file : file;
51
48
  });
52
- // Initialization file list
53
49
 
50
+ // Initialization file list
54
51
  case 'init':
55
52
  return ((_action$files = action.files) === null || _action$files === void 0 ? void 0 : _action$files.map(function (file) {
56
53
  // The state of the file needs to be preserved when the `fileList` is controlled.
@@ -58,28 +55,22 @@ function fileListReducer(files, action) {
58
55
  return f.fileKey === file.fileKey;
59
56
  }) || createFile(file);
60
57
  })) || [];
61
-
62
58
  default:
63
59
  throw new Error();
64
60
  }
65
61
  }
66
-
67
62
  var useFileList = function useFileList(defaultFileList) {
68
63
  if (defaultFileList === void 0) {
69
64
  defaultFileList = [];
70
65
  }
71
-
72
66
  var fileListRef = useRef(defaultFileList.map(createFile));
73
67
  var fileListUpdateCallback = useRef();
74
-
75
68
  var _useReducer = useReducer(fileListReducer, fileListRef.current),
76
- fileList = _useReducer[0],
77
- dispatch = _useReducer[1];
78
-
69
+ fileList = _useReducer[0],
70
+ dispatch = _useReducer[1];
79
71
  fileListRef.current = fileList;
80
72
  useEffect(function () {
81
73
  var _fileListUpdateCallba;
82
-
83
74
  (_fileListUpdateCallba = fileListUpdateCallback.current) === null || _fileListUpdateCallba === void 0 ? void 0 : _fileListUpdateCallba.call(fileListUpdateCallback, fileList);
84
75
  fileListUpdateCallback.current = null;
85
76
  }, [fileList]);
@@ -92,84 +83,77 @@ var useFileList = function useFileList(defaultFileList) {
92
83
  }, []);
93
84
  return [fileListRef, dispatchCallback];
94
85
  };
95
-
96
86
  var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
97
87
  var _props$as = props.as,
98
- Component = _props$as === void 0 ? 'div' : _props$as,
99
- _props$classPrefix = props.classPrefix,
100
- classPrefix = _props$classPrefix === void 0 ? 'uploader' : _props$classPrefix,
101
- className = props.className,
102
- _props$listType = props.listType,
103
- listType = _props$listType === void 0 ? 'text' : _props$listType,
104
- defaultFileList = props.defaultFileList,
105
- fileListProp = props.fileList,
106
- _props$fileListVisibl = props.fileListVisible,
107
- fileListVisible = _props$fileListVisibl === void 0 ? true : _props$fileListVisibl,
108
- localeProp = props.locale,
109
- style = props.style,
110
- draggable = props.draggable,
111
- _props$name = props.name,
112
- name = _props$name === void 0 ? 'file' : _props$name,
113
- _props$multiple = props.multiple,
114
- multiple = _props$multiple === void 0 ? false : _props$multiple,
115
- _props$disabled = props.disabled,
116
- disabled = _props$disabled === void 0 ? false : _props$disabled,
117
- readOnly = props.readOnly,
118
- plaintext = props.plaintext,
119
- accept = props.accept,
120
- children = props.children,
121
- toggleAs = props.toggleAs,
122
- _props$removable = props.removable,
123
- removable = _props$removable === void 0 ? true : _props$removable,
124
- disabledFileItem = props.disabledFileItem,
125
- maxPreviewFileSize = props.maxPreviewFileSize,
126
- _props$method = props.method,
127
- method = _props$method === void 0 ? 'POST' : _props$method,
128
- _props$autoUpload = props.autoUpload,
129
- autoUpload = _props$autoUpload === void 0 ? true : _props$autoUpload,
130
- action = props.action,
131
- headers = props.headers,
132
- _props$withCredential = props.withCredentials,
133
- withCredentials = _props$withCredential === void 0 ? false : _props$withCredential,
134
- disableMultipart = props.disableMultipart,
135
- _props$timeout = props.timeout,
136
- timeout = _props$timeout === void 0 ? 0 : _props$timeout,
137
- _props$data = props.data,
138
- data = _props$data === void 0 ? {} : _props$data,
139
- onRemove = props.onRemove,
140
- onUpload = props.onUpload,
141
- shouldUpload = props.shouldUpload,
142
- shouldQueueUpdate = props.shouldQueueUpdate,
143
- renderFileInfo = props.renderFileInfo,
144
- renderThumbnail = props.renderThumbnail,
145
- onPreview = props.onPreview,
146
- onChange = props.onChange,
147
- onSuccess = props.onSuccess,
148
- onError = props.onError,
149
- onProgress = props.onProgress,
150
- onReupload = props.onReupload,
151
- rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "listType", "defaultFileList", "fileList", "fileListVisible", "locale", "style", "draggable", "name", "multiple", "disabled", "readOnly", "plaintext", "accept", "children", "toggleAs", "removable", "disabledFileItem", "maxPreviewFileSize", "method", "autoUpload", "action", "headers", "withCredentials", "disableMultipart", "timeout", "data", "onRemove", "onUpload", "shouldUpload", "shouldQueueUpdate", "renderFileInfo", "renderThumbnail", "onPreview", "onChange", "onSuccess", "onError", "onProgress", "onReupload"]);
152
-
88
+ Component = _props$as === void 0 ? 'div' : _props$as,
89
+ _props$classPrefix = props.classPrefix,
90
+ classPrefix = _props$classPrefix === void 0 ? 'uploader' : _props$classPrefix,
91
+ className = props.className,
92
+ _props$listType = props.listType,
93
+ listType = _props$listType === void 0 ? 'text' : _props$listType,
94
+ defaultFileList = props.defaultFileList,
95
+ fileListProp = props.fileList,
96
+ _props$fileListVisibl = props.fileListVisible,
97
+ fileListVisible = _props$fileListVisibl === void 0 ? true : _props$fileListVisibl,
98
+ localeProp = props.locale,
99
+ style = props.style,
100
+ draggable = props.draggable,
101
+ _props$name = props.name,
102
+ name = _props$name === void 0 ? 'file' : _props$name,
103
+ _props$multiple = props.multiple,
104
+ multiple = _props$multiple === void 0 ? false : _props$multiple,
105
+ _props$disabled = props.disabled,
106
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
107
+ readOnly = props.readOnly,
108
+ plaintext = props.plaintext,
109
+ accept = props.accept,
110
+ children = props.children,
111
+ toggleAs = props.toggleAs,
112
+ _props$removable = props.removable,
113
+ removable = _props$removable === void 0 ? true : _props$removable,
114
+ disabledFileItem = props.disabledFileItem,
115
+ maxPreviewFileSize = props.maxPreviewFileSize,
116
+ _props$method = props.method,
117
+ method = _props$method === void 0 ? 'POST' : _props$method,
118
+ _props$autoUpload = props.autoUpload,
119
+ autoUpload = _props$autoUpload === void 0 ? true : _props$autoUpload,
120
+ action = props.action,
121
+ headers = props.headers,
122
+ _props$withCredential = props.withCredentials,
123
+ withCredentials = _props$withCredential === void 0 ? false : _props$withCredential,
124
+ disableMultipart = props.disableMultipart,
125
+ _props$timeout = props.timeout,
126
+ timeout = _props$timeout === void 0 ? 0 : _props$timeout,
127
+ _props$data = props.data,
128
+ data = _props$data === void 0 ? {} : _props$data,
129
+ onRemove = props.onRemove,
130
+ onUpload = props.onUpload,
131
+ shouldUpload = props.shouldUpload,
132
+ shouldQueueUpdate = props.shouldQueueUpdate,
133
+ renderFileInfo = props.renderFileInfo,
134
+ renderThumbnail = props.renderThumbnail,
135
+ onPreview = props.onPreview,
136
+ onChange = props.onChange,
137
+ onSuccess = props.onSuccess,
138
+ onError = props.onError,
139
+ onProgress = props.onProgress,
140
+ onReupload = props.onReupload,
141
+ rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "listType", "defaultFileList", "fileList", "fileListVisible", "locale", "style", "draggable", "name", "multiple", "disabled", "readOnly", "plaintext", "accept", "children", "toggleAs", "removable", "disabledFileItem", "maxPreviewFileSize", "method", "autoUpload", "action", "headers", "withCredentials", "disableMultipart", "timeout", "data", "onRemove", "onUpload", "shouldUpload", "shouldQueueUpdate", "renderFileInfo", "renderThumbnail", "onPreview", "onChange", "onSuccess", "onError", "onProgress", "onReupload"]);
153
142
  var _useClassNames = useClassNames(classPrefix),
154
- merge = _useClassNames.merge,
155
- withClassPrefix = _useClassNames.withClassPrefix,
156
- prefix = _useClassNames.prefix;
157
-
143
+ merge = _useClassNames.merge,
144
+ withClassPrefix = _useClassNames.withClassPrefix,
145
+ prefix = _useClassNames.prefix;
158
146
  var classes = merge(className, withClassPrefix(listType, {
159
147
  draggable: draggable
160
148
  }));
161
-
162
149
  var _useCustom = useCustom('Uploader', localeProp),
163
- locale = _useCustom.locale;
164
-
150
+ locale = _useCustom.locale;
165
151
  var rootRef = useRef();
166
152
  var xhrs = useRef({});
167
153
  var trigger = useRef();
168
-
169
154
  var _useFileList = useFileList(fileListProp || defaultFileList),
170
- fileList = _useFileList[0],
171
- dispatch = _useFileList[1];
172
-
155
+ fileList = _useFileList[0],
156
+ dispatch = _useFileList[1];
173
157
  useEffect(function () {
174
158
  if (typeof fileListProp !== 'undefined') {
175
159
  // Force reset fileList in reducer, when `fileListProp` is updated
@@ -185,15 +169,15 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
185
169
  file: nextFile
186
170
  });
187
171
  }, [dispatch]);
172
+
188
173
  /**
189
174
  * Clear the value in input.
190
175
  */
191
-
192
176
  var cleanInputValue = useCallback(function () {
193
177
  var _trigger$current;
194
-
195
178
  (_trigger$current = trigger.current) === null || _trigger$current === void 0 ? void 0 : _trigger$current.clearInput();
196
179
  }, []);
180
+
197
181
  /**
198
182
  * Callback for successful file upload.
199
183
  * @param file
@@ -201,16 +185,15 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
201
185
  * @param event
202
186
  * @param xhr
203
187
  */
204
-
205
188
  var handleAjaxUploadSuccess = useCallback(function (file, response, event, xhr) {
206
189
  var nextFile = _extends({}, file, {
207
190
  status: 'finished',
208
191
  progress: 100
209
192
  });
210
-
211
193
  updateFileStatus(nextFile);
212
194
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(response, nextFile, event, xhr);
213
195
  }, [onSuccess, updateFileStatus]);
196
+
214
197
  /**
215
198
  * Callback for file upload error.
216
199
  * @param file
@@ -218,15 +201,14 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
218
201
  * @param event
219
202
  * @param xhr
220
203
  */
221
-
222
204
  var handleAjaxUploadError = useCallback(function (file, status, event, xhr) {
223
205
  var nextFile = _extends({}, file, {
224
206
  status: 'error'
225
207
  });
226
-
227
208
  updateFileStatus(nextFile);
228
209
  onError === null || onError === void 0 ? void 0 : onError(status, nextFile, event, xhr);
229
210
  }, [onError, updateFileStatus]);
211
+
230
212
  /**
231
213
  * Callback for file upload progress update.
232
214
  * @param file
@@ -234,53 +216,47 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
234
216
  * @param event
235
217
  * @param xhr
236
218
  */
237
-
238
219
  var handleAjaxUploadProgress = useCallback(function (file, percent, event, xhr) {
239
220
  var nextFile = _extends({}, file, {
240
221
  status: 'uploading',
241
222
  progress: percent
242
223
  });
243
-
244
224
  updateFileStatus(nextFile);
245
225
  onProgress === null || onProgress === void 0 ? void 0 : onProgress(percent, nextFile, event, xhr);
246
226
  }, [onProgress, updateFileStatus]);
227
+
247
228
  /**
248
229
  * Upload a single file.
249
230
  * @param file
250
231
  */
251
-
252
232
  var handleUploadFile = useCallback(function (file) {
253
233
  var _ajaxUpload = ajaxUpload({
254
- name: name,
255
- timeout: timeout,
256
- headers: headers,
257
- data: data,
258
- method: method,
259
- withCredentials: withCredentials,
260
- disableMultipart: disableMultipart,
261
- file: file.blobFile,
262
- url: action,
263
- onError: handleAjaxUploadError.bind(null, file),
264
- onSuccess: handleAjaxUploadSuccess.bind(null, file),
265
- onProgress: handleAjaxUploadProgress.bind(null, file)
266
- }),
267
- xhr = _ajaxUpload.xhr,
268
- uploadData = _ajaxUpload.data;
269
-
234
+ name: name,
235
+ timeout: timeout,
236
+ headers: headers,
237
+ data: data,
238
+ method: method,
239
+ withCredentials: withCredentials,
240
+ disableMultipart: disableMultipart,
241
+ file: file.blobFile,
242
+ url: action,
243
+ onError: handleAjaxUploadError.bind(null, file),
244
+ onSuccess: handleAjaxUploadSuccess.bind(null, file),
245
+ onProgress: handleAjaxUploadProgress.bind(null, file)
246
+ }),
247
+ xhr = _ajaxUpload.xhr,
248
+ uploadData = _ajaxUpload.data;
270
249
  updateFileStatus(_extends({}, file, {
271
250
  status: 'uploading'
272
251
  }));
273
-
274
252
  if (file.fileKey) {
275
253
  xhrs.current[file.fileKey] = xhr;
276
254
  }
277
-
278
255
  onUpload === null || onUpload === void 0 ? void 0 : onUpload(file, uploadData, xhr);
279
256
  }, [name, timeout, headers, data, method, withCredentials, disableMultipart, action, handleAjaxUploadError, handleAjaxUploadSuccess, handleAjaxUploadProgress, updateFileStatus, onUpload]);
280
257
  var handleAjaxUpload = useCallback(function () {
281
258
  fileList.current.forEach(function (file) {
282
259
  var checkState = shouldUpload === null || shouldUpload === void 0 ? void 0 : shouldUpload(file);
283
-
284
260
  if (checkState instanceof Promise) {
285
261
  checkState.then(function (res) {
286
262
  if (res) {
@@ -291,14 +267,12 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
291
267
  } else if (checkState === false) {
292
268
  return;
293
269
  }
294
-
295
270
  if (file.status === 'inited') {
296
271
  handleUploadFile(file);
297
272
  }
298
273
  });
299
274
  cleanInputValue();
300
275
  }, [cleanInputValue, fileList, handleUploadFile, shouldUpload]);
301
-
302
276
  var handleUploadTriggerChange = function handleUploadTriggerChange(event) {
303
277
  var files = getFiles(event);
304
278
  var newFileList = [];
@@ -312,12 +286,10 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
312
286
  });
313
287
  var nextFileList = [].concat(fileList.current, newFileList);
314
288
  var checkState = shouldQueueUpdate === null || shouldQueueUpdate === void 0 ? void 0 : shouldQueueUpdate(nextFileList, newFileList);
315
-
316
289
  if (checkState === false) {
317
290
  cleanInputValue();
318
291
  return;
319
292
  }
320
-
321
293
  var upload = function upload() {
322
294
  onChange === null || onChange === void 0 ? void 0 : onChange(nextFileList);
323
295
  dispatch({
@@ -327,33 +299,26 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
327
299
  autoUpload && handleAjaxUpload();
328
300
  });
329
301
  };
330
-
331
302
  if (checkState instanceof Promise) {
332
303
  checkState.then(function (res) {
333
304
  res && upload();
334
305
  });
335
306
  return;
336
307
  }
337
-
338
308
  upload();
339
309
  };
340
-
341
310
  var handleRemoveFile = function handleRemoveFile(fileKey) {
342
311
  var _xhrs$current, _xhrs$current$file$fi;
343
-
344
312
  var file = find(fileList.current, function (f) {
345
313
  return f.fileKey === fileKey;
346
314
  });
347
315
  var nextFileList = fileList.current.filter(function (f) {
348
316
  return f.fileKey !== fileKey;
349
317
  });
350
-
351
318
  if (((_xhrs$current = xhrs.current) === null || _xhrs$current === void 0 ? void 0 : (_xhrs$current$file$fi = _xhrs$current[file.fileKey]) === null || _xhrs$current$file$fi === void 0 ? void 0 : _xhrs$current$file$fi.readyState) !== 4) {
352
319
  var _xhrs$current$file$fi2;
353
-
354
320
  (_xhrs$current$file$fi2 = xhrs.current[file.fileKey]) === null || _xhrs$current$file$fi2 === void 0 ? void 0 : _xhrs$current$file$fi2.abort();
355
321
  }
356
-
357
322
  dispatch({
358
323
  type: 'remove',
359
324
  fileKey: fileKey
@@ -362,22 +327,19 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
362
327
  onChange === null || onChange === void 0 ? void 0 : onChange(nextFileList);
363
328
  cleanInputValue();
364
329
  };
365
-
366
330
  var handleReupload = function handleReupload(file) {
367
331
  autoUpload && handleUploadFile(file);
368
332
  onReupload === null || onReupload === void 0 ? void 0 : onReupload(file);
369
- }; // public API
370
-
333
+ };
371
334
 
335
+ // public API
372
336
  var start = function start(file) {
373
337
  if (file) {
374
338
  handleUploadFile(file);
375
339
  return;
376
340
  }
377
-
378
341
  handleAjaxUpload();
379
342
  };
380
-
381
343
  useImperativeHandle(ref, function () {
382
344
  return {
383
345
  root: rootRef.current,
@@ -397,7 +359,6 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
397
359
  onChange: handleUploadTriggerChange,
398
360
  as: toggleAs
399
361
  }), children)];
400
-
401
362
  if (fileListVisible) {
402
363
  renderList.push( /*#__PURE__*/React.createElement("div", {
403
364
  key: "items",
@@ -420,18 +381,15 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
420
381
  });
421
382
  })));
422
383
  }
423
-
424
384
  if (plaintext) {
425
385
  return /*#__PURE__*/React.createElement(Plaintext, {
426
386
  localeKey: "notUploaded",
427
387
  className: withClassPrefix(listType)
428
388
  }, fileList.current.length ? renderList[1] : null);
429
389
  }
430
-
431
390
  if (listType === 'picture') {
432
391
  renderList.reverse();
433
392
  }
434
-
435
393
  return /*#__PURE__*/React.createElement(Component, {
436
394
  ref: rootRef,
437
395
  className: classes,
@@ -1,2 +1,3 @@
1
+ 'use client';
1
2
  import Uploader from './Uploader';
2
3
  export default Uploader;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import _extends from "@babel/runtime/helpers/esm/extends";
2
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
4
  import React, { useContext } from 'react';
@@ -7,14 +8,13 @@ import { createChainedFunction, placementPolyfill, PLACEMENT } from '../utils';
7
8
  import { CustomContext } from '../CustomProvider';
8
9
  var Whisper = /*#__PURE__*/React.forwardRef(function (props, ref) {
9
10
  var onOpen = props.onOpen,
10
- onClose = props.onClose,
11
- onEntered = props.onEntered,
12
- onExited = props.onExited,
13
- _props$placement = props.placement,
14
- placement = _props$placement === void 0 ? 'right' : _props$placement,
15
- preventOverflow = props.preventOverflow,
16
- rest = _objectWithoutPropertiesLoose(props, ["onOpen", "onClose", "onEntered", "onExited", "placement", "preventOverflow"]);
17
-
11
+ onClose = props.onClose,
12
+ onEntered = props.onEntered,
13
+ onExited = props.onExited,
14
+ _props$placement = props.placement,
15
+ placement = _props$placement === void 0 ? 'right' : _props$placement,
16
+ preventOverflow = props.preventOverflow,
17
+ rest = _objectWithoutPropertiesLoose(props, ["onOpen", "onClose", "onEntered", "onExited", "placement", "preventOverflow"]);
18
18
  var context = useContext(CustomContext);
19
19
  return /*#__PURE__*/React.createElement(OverlayTrigger, _extends({}, rest, {
20
20
  ref: ref,
@@ -31,12 +31,10 @@ Whisper.propTypes = {
31
31
  onEntered: PropTypes.func,
32
32
  onExited: PropTypes.func,
33
33
  placement: PropTypes.oneOf(PLACEMENT),
34
-
35
34
  /**
36
35
  * Prevent floating element overflow
37
36
  */
38
37
  preventOverflow: PropTypes.bool,
39
-
40
38
  /**
41
39
  * Whether enable speaker follow cursor
42
40
  */
@@ -1,2 +1,3 @@
1
+ 'use client';
1
2
  import Whisper from './Whisper';
2
3
  export default Whisper;
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import _extends from "@babel/runtime/helpers/esm/extends";
2
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
4
  import React, { useState, useRef } from 'react';
@@ -6,49 +7,40 @@ import getStyle from 'dom-lib/getStyle';
6
7
  import { mergeRefs, useElementResize, useMount } from '../utils';
7
8
  var AutoSizer = /*#__PURE__*/React.forwardRef(function (props, ref) {
8
9
  var children = props.children,
9
- className = props.className,
10
- disableHeight = props.disableHeight,
11
- disableWidth = props.disableWidth,
12
- defaultHeight = props.defaultHeight,
13
- defaultWidth = props.defaultWidth,
14
- style = props.style,
15
- onResize = props.onResize,
16
- rest = _objectWithoutPropertiesLoose(props, ["children", "className", "disableHeight", "disableWidth", "defaultHeight", "defaultWidth", "style", "onResize"]);
17
-
10
+ className = props.className,
11
+ disableHeight = props.disableHeight,
12
+ disableWidth = props.disableWidth,
13
+ defaultHeight = props.defaultHeight,
14
+ defaultWidth = props.defaultWidth,
15
+ style = props.style,
16
+ onResize = props.onResize,
17
+ rest = _objectWithoutPropertiesLoose(props, ["children", "className", "disableHeight", "disableWidth", "defaultHeight", "defaultWidth", "style", "onResize"]);
18
18
  var _useState = useState(defaultHeight || 0),
19
- height = _useState[0],
20
- setHeight = _useState[1];
21
-
19
+ height = _useState[0],
20
+ setHeight = _useState[1];
22
21
  var _useState2 = useState(defaultWidth || 0),
23
- width = _useState2[0],
24
- setWidth = _useState2[1];
25
-
22
+ width = _useState2[0],
23
+ setWidth = _useState2[1];
26
24
  var rootRef = useRef(null);
27
25
  var getParentNode = useCallback(function () {
28
26
  var _rootRef$current;
29
-
30
27
  if ((_rootRef$current = rootRef.current) !== null && _rootRef$current !== void 0 && _rootRef$current.parentNode && rootRef.current.parentNode.ownerDocument && rootRef.current.parentNode.ownerDocument.defaultView && rootRef.current.parentNode instanceof rootRef.current.parentNode.ownerDocument.defaultView.HTMLElement) {
31
28
  return rootRef.current.parentNode;
32
29
  }
33
-
34
30
  return null;
35
31
  }, []);
36
32
  var handleResize = useCallback(function () {
37
33
  var parentNode = getParentNode();
38
-
39
34
  if (parentNode) {
40
35
  var offsetHeight = parentNode.offsetHeight || 0;
41
36
  var offsetWidth = parentNode.offsetWidth || 0;
42
-
43
37
  var _style = getStyle(parentNode);
44
-
45
38
  var paddingLeft = parseInt(_style.paddingLeft, 10) || 0;
46
39
  var paddingRight = parseInt(_style.paddingRight, 10) || 0;
47
40
  var paddingTop = parseInt(_style.paddingTop, 10) || 0;
48
41
  var paddingBottom = parseInt(_style.paddingBottom, 10) || 0;
49
42
  var newHeight = offsetHeight - paddingTop - paddingBottom;
50
43
  var newWidth = offsetWidth - paddingLeft - paddingRight;
51
-
52
44
  if (!disableHeight && height !== newHeight || !disableWidth && width !== newWidth) {
53
45
  setHeight(offsetHeight - paddingTop - paddingBottom);
54
46
  setWidth(offsetWidth - paddingLeft - paddingRight);
@@ -68,17 +60,14 @@ var AutoSizer = /*#__PURE__*/React.forwardRef(function (props, ref) {
68
60
  width: 0,
69
61
  height: 0
70
62
  };
71
-
72
63
  if (!disableHeight) {
73
64
  outerStyle.height = 0;
74
65
  childParams.height = height;
75
66
  }
76
-
77
67
  if (!disableWidth) {
78
68
  outerStyle.width = 0;
79
69
  childParams.width = width;
80
70
  }
81
-
82
71
  return /*#__PURE__*/React.createElement("div", _extends({
83
72
  className: className,
84
73
  ref: mergeRefs(rootRef, ref),
@@ -2,7 +2,7 @@ import { VariableSizeList, ListItemKeySelector, ListOnScrollProps, ListOnItemsRe
2
2
  import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
3
3
  export interface ListProps<T = any> extends WithAsProps {
4
4
  /**
5
- * @deprecated use {@link itemSize} instead
5
+ * @deprecated use itemSize instead
6
6
  * Either a fixed row height (number) or a function that returns the height of a row given its index: ({ index: number }): number
7
7
  */
8
8
  rowHeight?: number | (({ index: number }: {
@@ -34,7 +34,7 @@ export interface ListProps<T = any> extends WithAsProps {
34
34
  */
35
35
  onScroll?: (props: ListOnScrollProps) => void;
36
36
  }
37
- export interface ListHandle extends Pick<VariableSizeList, 'resetAfterIndex' | 'scrollTo' | 'scrollToItem'> {
37
+ export interface ListHandle extends Partial<VariableSizeList> {
38
38
  /**
39
39
  * @deprecated use scrollToItem instead
40
40
  * Ensure row is visible. This method can be used to safely scroll back to a cell that a user has scrolled away from even if it was previously scrolled to.