rsuite 5.40.0 → 5.42.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 (894) hide show
  1. package/CHANGELOG.md +30 -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 +165 -247
  60. package/cjs/CheckTreePicker/index.js +1 -3
  61. package/cjs/CheckTreePicker/utils.js +12 -52
  62. package/cjs/Checkbox/Checkbox.js +48 -77
  63. package/cjs/Checkbox/index.js +1 -3
  64. package/cjs/CheckboxGroup/CheckboxGroup.js +20 -38
  65. package/cjs/CheckboxGroup/CheckboxGroupContext.js +1 -4
  66. package/cjs/CheckboxGroup/index.js +1 -4
  67. package/cjs/CloseButton/CloseButton.js +10 -20
  68. package/cjs/CloseButton/index.js +1 -3
  69. package/cjs/Col/Col.js +10 -23
  70. package/cjs/Col/index.js +1 -3
  71. package/cjs/Container/Container.js +11 -24
  72. package/cjs/Container/index.js +1 -3
  73. package/cjs/Content/Content.js +1 -3
  74. package/cjs/Content/index.js +1 -3
  75. package/cjs/CustomProvider/CustomProvider.js +13 -28
  76. package/cjs/CustomProvider/FormattedDate.js +3 -9
  77. package/cjs/CustomProvider/index.js +1 -6
  78. package/cjs/DOMHelper/index.js +1 -7
  79. package/cjs/DOMHelper/isElement.js +1 -2
  80. package/cjs/DatePicker/DatePicker.js +108 -161
  81. package/cjs/DatePicker/PredefinedRanges.js +12 -29
  82. package/cjs/DatePicker/Toolbar.js +20 -36
  83. package/cjs/DatePicker/index.js +1 -3
  84. package/cjs/DatePicker/types.js +1 -0
  85. package/cjs/DatePicker/utils.js +5 -13
  86. package/cjs/DateRangePicker/Calendar.js +18 -28
  87. package/cjs/DateRangePicker/DateRangePicker.js +128 -207
  88. package/cjs/DateRangePicker/DateRangePickerContext.js +1 -6
  89. package/cjs/DateRangePicker/disabledDateUtils.js +9 -32
  90. package/cjs/DateRangePicker/index.js +1 -3
  91. package/cjs/DateRangePicker/types.js +1 -0
  92. package/cjs/DateRangePicker/utils.js +7 -20
  93. package/cjs/Disclosure/Disclosure.js +14 -34
  94. package/cjs/Disclosure/DisclosureButton.js +4 -12
  95. package/cjs/Disclosure/DisclosureContent.js +1 -5
  96. package/cjs/Disclosure/DisclosureContext.js +1 -6
  97. package/cjs/Disclosure/index.js +1 -3
  98. package/cjs/Disclosure/useDisclosureContext.js +1 -6
  99. package/cjs/Divider/Divider.js +11 -20
  100. package/cjs/Divider/index.js +1 -3
  101. package/cjs/Drawer/Drawer.js +10 -27
  102. package/cjs/Drawer/index.js +1 -3
  103. package/cjs/Dropdown/Dropdown.js +35 -68
  104. package/cjs/Dropdown/DropdownContext.js +1 -4
  105. package/cjs/Dropdown/DropdownItem.js +22 -49
  106. package/cjs/Dropdown/DropdownMenu.js +36 -63
  107. package/cjs/Dropdown/DropdownSeparator.js +8 -17
  108. package/cjs/Dropdown/DropdownState.js +1 -10
  109. package/cjs/Dropdown/DropdownToggle.js +17 -29
  110. package/cjs/Dropdown/index.js +1 -3
  111. package/cjs/Dropdown/useRenderDropdownItem.js +1 -5
  112. package/cjs/FlexboxGrid/FlexboxGrid.js +12 -22
  113. package/cjs/FlexboxGrid/FlexboxGridItem.js +12 -22
  114. package/cjs/FlexboxGrid/index.js +1 -3
  115. package/cjs/Footer/Footer.js +1 -3
  116. package/cjs/Footer/index.js +1 -3
  117. package/cjs/Form/Form.js +38 -79
  118. package/cjs/Form/FormContext.d.ts +2 -3
  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 +48 -84
  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.d.ts +2 -0
  150. package/cjs/InputPicker/InputPicker.js +152 -251
  151. package/cjs/InputPicker/InputSearch.js +15 -28
  152. package/cjs/InputPicker/index.js +1 -3
  153. package/cjs/List/List.js +37 -51
  154. package/cjs/List/ListContext.js +1 -5
  155. package/cjs/List/ListItem.js +26 -40
  156. package/cjs/List/helper/AutoScroller.js +11 -21
  157. package/cjs/List/helper/useManager.js +1 -8
  158. package/cjs/List/helper/useSortHelper.js +58 -82
  159. package/cjs/List/helper/utils.js +6 -19
  160. package/cjs/List/index.js +1 -3
  161. package/cjs/Loader/Loader.js +17 -26
  162. package/cjs/Loader/index.js +1 -3
  163. package/cjs/MaskedInput/MaskedInput.js +2 -8
  164. package/cjs/MaskedInput/TextMask.js +14 -23
  165. package/cjs/MaskedInput/adjustCaretPosition.js +99 -70
  166. package/cjs/MaskedInput/conformToMask.js +79 -73
  167. package/cjs/MaskedInput/createTextMaskInputElement.js +65 -71
  168. package/cjs/MaskedInput/index.js +1 -3
  169. package/cjs/MaskedInput/types.js +1 -0
  170. package/cjs/MaskedInput/utilities.js +1 -8
  171. package/cjs/Menu/Menu.js +35 -79
  172. package/cjs/Menu/MenuContext.js +1 -8
  173. package/cjs/Menu/MenuItem.js +15 -26
  174. package/cjs/Menu/Menubar.js +13 -32
  175. package/cjs/Menu/index.js +1 -3
  176. package/cjs/Menu/useMenu.js +5 -34
  177. package/cjs/Message/Message.js +23 -45
  178. package/cjs/Message/index.js +1 -3
  179. package/cjs/Modal/Modal.js +70 -91
  180. package/cjs/Modal/ModalBody.js +11 -25
  181. package/cjs/Modal/ModalContext.js +1 -4
  182. package/cjs/Modal/ModalDialog.js +14 -26
  183. package/cjs/Modal/ModalFooter.js +1 -3
  184. package/cjs/Modal/ModalHeader.js +14 -29
  185. package/cjs/Modal/ModalTitle.js +9 -20
  186. package/cjs/Modal/index.js +1 -3
  187. package/cjs/Modal/utils.js +8 -19
  188. package/cjs/MultiCascader/DropdownMenu.js +38 -64
  189. package/cjs/MultiCascader/MultiCascader.js +129 -192
  190. package/cjs/MultiCascader/index.js +1 -3
  191. package/cjs/MultiCascader/utils.js +44 -106
  192. package/cjs/Nav/Nav.js +27 -69
  193. package/cjs/Nav/NavContext.js +1 -4
  194. package/cjs/Nav/NavDropdown.js +28 -60
  195. package/cjs/Nav/NavDropdownItem.js +20 -42
  196. package/cjs/Nav/NavDropdownMenu.js +26 -54
  197. package/cjs/Nav/NavDropdownToggle.js +12 -26
  198. package/cjs/Nav/NavItem.js +20 -39
  199. package/cjs/Nav/NavMenu.js +2 -28
  200. package/cjs/Nav/index.js +1 -3
  201. package/cjs/Navbar/Navbar.js +10 -23
  202. package/cjs/Navbar/NavbarBody.js +1 -6
  203. package/cjs/Navbar/NavbarBrand.js +1 -3
  204. package/cjs/Navbar/NavbarDropdown.js +25 -49
  205. package/cjs/Navbar/NavbarDropdownItem.js +18 -44
  206. package/cjs/Navbar/NavbarDropdownMenu.js +22 -51
  207. package/cjs/Navbar/NavbarDropdownToggle.js +12 -25
  208. package/cjs/Navbar/NavbarHeader.js +1 -6
  209. package/cjs/Navbar/NavbarItem.js +19 -35
  210. package/cjs/Navbar/index.js +1 -3
  211. package/cjs/Notification/Notification.js +20 -43
  212. package/cjs/Notification/index.js +1 -3
  213. package/cjs/Overlay/Modal.js +40 -79
  214. package/cjs/Overlay/ModalManager.js +1 -26
  215. package/cjs/Overlay/Overlay.js +28 -50
  216. package/cjs/Overlay/OverlayContext.js +1 -4
  217. package/cjs/Overlay/OverlayTrigger.js +67 -116
  218. package/cjs/Overlay/Position.js +25 -64
  219. package/cjs/Overlay/index.js +1 -3
  220. package/cjs/Overlay/positionUtils.js +25 -86
  221. package/cjs/Pagination/Pagination.js +30 -70
  222. package/cjs/Pagination/PaginationButton.js +15 -29
  223. package/cjs/Pagination/PaginationGroup.js +38 -63
  224. package/cjs/Pagination/index.js +1 -3
  225. package/cjs/Panel/Panel.js +37 -61
  226. package/cjs/Panel/index.js +1 -3
  227. package/cjs/PanelGroup/PanelGroup.js +16 -29
  228. package/cjs/PanelGroup/index.js +1 -3
  229. package/cjs/Picker/DropdownMenu.js +50 -93
  230. package/cjs/Picker/DropdownMenuCheckItem.js +22 -33
  231. package/cjs/Picker/DropdownMenuGroup.js +10 -22
  232. package/cjs/Picker/DropdownMenuItem.js +15 -26
  233. package/cjs/Picker/PickerOverlay.js +12 -28
  234. package/cjs/Picker/PickerToggle.js +57 -89
  235. package/cjs/Picker/PickerToggleTrigger.js +8 -19
  236. package/cjs/Picker/SearchBar.js +14 -26
  237. package/cjs/Picker/SelectedElement.js +9 -17
  238. package/cjs/Picker/ToggleButton.js +1 -6
  239. package/cjs/Picker/index.js +1 -24
  240. package/cjs/Picker/propTypes.js +1 -7
  241. package/cjs/Picker/types.js +1 -0
  242. package/cjs/Picker/utils.js +94 -200
  243. package/cjs/Placeholder/Placeholder.js +1 -5
  244. package/cjs/Placeholder/PlaceholderGraph.js +13 -22
  245. package/cjs/Placeholder/PlaceholderGrid.js +18 -34
  246. package/cjs/Placeholder/PlaceholderParagraph.js +17 -29
  247. package/cjs/Placeholder/index.js +1 -3
  248. package/cjs/Plaintext/Plaintext.js +14 -23
  249. package/cjs/Plaintext/index.js +1 -3
  250. package/cjs/Popover/Popover.js +16 -27
  251. package/cjs/Popover/index.js +1 -3
  252. package/cjs/Progress/Progress.js +1 -4
  253. package/cjs/Progress/ProgressCircle.js +30 -47
  254. package/cjs/Progress/ProgressLine.js +19 -29
  255. package/cjs/Progress/index.js +1 -3
  256. package/cjs/Radio/Radio.js +42 -62
  257. package/cjs/Radio/index.js +1 -3
  258. package/cjs/RadioGroup/RadioGroup.js +22 -37
  259. package/cjs/RadioGroup/index.js +1 -3
  260. package/cjs/RadioTile/RadioTile.js +30 -47
  261. package/cjs/RadioTile/index.js +1 -3
  262. package/cjs/RadioTileGroup/RadioTileGroup.js +17 -32
  263. package/cjs/RadioTileGroup/index.js +1 -3
  264. package/cjs/RangeSlider/RangeSlider.js +63 -104
  265. package/cjs/RangeSlider/index.js +1 -3
  266. package/cjs/Rate/Character.js +16 -31
  267. package/cjs/Rate/Rate.js +35 -62
  268. package/cjs/Rate/index.js +1 -3
  269. package/cjs/Rate/utils.js +1 -6
  270. package/cjs/Ripple/Ripple.js +16 -40
  271. package/cjs/Ripple/index.js +1 -3
  272. package/cjs/Row/Row.js +11 -22
  273. package/cjs/Row/index.js +1 -3
  274. package/cjs/SafeAnchor/SafeAnchor.js +8 -19
  275. package/cjs/SafeAnchor/index.js +1 -3
  276. package/cjs/Schema/Schema.js +1 -2
  277. package/cjs/Schema/index.js +1 -3
  278. package/cjs/SelectPicker/SelectPicker.js +136 -170
  279. package/cjs/SelectPicker/index.js +1 -3
  280. package/cjs/Sidebar/Sidebar.js +13 -26
  281. package/cjs/Sidebar/index.js +1 -3
  282. package/cjs/Sidenav/ExpandedSidenavDropdown.js +32 -54
  283. package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +19 -41
  284. package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +22 -46
  285. package/cjs/Sidenav/Node.js +1 -12
  286. package/cjs/Sidenav/Sidenav.js +22 -45
  287. package/cjs/Sidenav/SidenavBody.js +1 -3
  288. package/cjs/Sidenav/SidenavDropdown.js +39 -70
  289. package/cjs/Sidenav/SidenavDropdownCollapse.js +9 -22
  290. package/cjs/Sidenav/SidenavDropdownItem.js +19 -45
  291. package/cjs/Sidenav/SidenavDropdownMenu.js +26 -54
  292. package/cjs/Sidenav/SidenavDropdownToggle.js +12 -25
  293. package/cjs/Sidenav/SidenavHeader.js +1 -3
  294. package/cjs/Sidenav/SidenavItem.js +27 -55
  295. package/cjs/Sidenav/SidenavToggle.js +11 -31
  296. package/cjs/Sidenav/index.js +1 -3
  297. package/cjs/Slider/Graduated.js +14 -29
  298. package/cjs/Slider/Handle.js +27 -52
  299. package/cjs/Slider/Input.js +2 -8
  300. package/cjs/Slider/Mark.js +11 -20
  301. package/cjs/Slider/ProgressBar.js +14 -23
  302. package/cjs/Slider/Slider.js +51 -84
  303. package/cjs/Slider/index.js +1 -3
  304. package/cjs/Slider/utils.js +1 -6
  305. package/cjs/Stack/Stack.js +22 -35
  306. package/cjs/Stack/StackItem.js +11 -17
  307. package/cjs/Stack/index.js +1 -3
  308. package/cjs/Steps/StepItem.js +16 -32
  309. package/cjs/Steps/Steps.js +18 -32
  310. package/cjs/Steps/index.js +1 -3
  311. package/cjs/Table/Table.js +6 -16
  312. package/cjs/Table/index.js +1 -3
  313. package/cjs/Tag/Tag.js +16 -28
  314. package/cjs/Tag/index.js +1 -3
  315. package/cjs/TagGroup/TagGroup.js +1 -3
  316. package/cjs/TagGroup/index.js +1 -3
  317. package/cjs/TagInput/index.d.ts +3 -0
  318. package/cjs/TagInput/index.js +11 -16
  319. package/cjs/TagPicker/index.d.ts +3 -0
  320. package/cjs/TagPicker/index.js +9 -14
  321. package/cjs/Timeline/Timeline.js +14 -29
  322. package/cjs/Timeline/TimelineItem.js +14 -23
  323. package/cjs/Timeline/index.js +1 -3
  324. package/cjs/Toggle/Toggle.js +26 -45
  325. package/cjs/Toggle/index.js +1 -3
  326. package/cjs/Tooltip/Tooltip.js +13 -22
  327. package/cjs/Tooltip/index.js +1 -3
  328. package/cjs/Tree/Tree.js +1 -10
  329. package/cjs/Tree/TreeContext.js +1 -4
  330. package/cjs/Tree/index.js +1 -3
  331. package/cjs/TreePicker/TreeNode.js +37 -60
  332. package/cjs/TreePicker/TreePicker.js +155 -231
  333. package/cjs/TreePicker/index.js +1 -3
  334. package/cjs/Uploader/UploadFileItem.js +37 -82
  335. package/cjs/Uploader/UploadTrigger.js +24 -46
  336. package/cjs/Uploader/Uploader.js +89 -141
  337. package/cjs/Uploader/index.js +1 -3
  338. package/cjs/Whisper/Whisper.js +8 -20
  339. package/cjs/Whisper/index.js +1 -3
  340. package/cjs/Windowing/AutoSizer.js +13 -33
  341. package/cjs/Windowing/List.d.ts +2 -2
  342. package/cjs/Windowing/List.js +6 -22
  343. package/cjs/Windowing/index.js +1 -7
  344. package/cjs/index.js +1 -164
  345. package/cjs/locales/ar_EG.js +1 -4
  346. package/cjs/locales/da_DK.js +1 -5
  347. package/cjs/locales/de_DE.js +1 -5
  348. package/cjs/locales/default.js +1 -5
  349. package/cjs/locales/en_GB.js +1 -3
  350. package/cjs/locales/en_US.js +1 -4
  351. package/cjs/locales/es_AR.js +1 -5
  352. package/cjs/locales/es_ES.js +1 -5
  353. package/cjs/locales/fa_IR.js +1 -4
  354. package/cjs/locales/fi_FI.js +1 -5
  355. package/cjs/locales/fr_FR.js +1 -4
  356. package/cjs/locales/hu_HU.js +1 -5
  357. package/cjs/locales/index.js +1 -47
  358. package/cjs/locales/it_IT.js +1 -5
  359. package/cjs/locales/ja_JP.js +1 -5
  360. package/cjs/locales/kk_KZ.js +1 -4
  361. package/cjs/locales/ko_KR.js +1 -5
  362. package/cjs/locales/ne_NP.js +1 -5
  363. package/cjs/locales/nl_NL.js +1 -4
  364. package/cjs/locales/pt_BR.js +1 -4
  365. package/cjs/locales/ru_RU.js +1 -4
  366. package/cjs/locales/sv_SE.js +1 -5
  367. package/cjs/locales/tr_TR.js +1 -4
  368. package/cjs/locales/zh_CN.js +1 -4
  369. package/cjs/locales/zh_TW.js +1 -4
  370. package/cjs/toaster/ToastContainer.js +29 -52
  371. package/cjs/toaster/ToastContext.js +1 -4
  372. package/cjs/toaster/index.js +1 -4
  373. package/cjs/toaster/toaster.js +4 -27
  374. package/cjs/toaster/useToaster.js +2 -8
  375. package/cjs/utils/BrowserDetection.js +7 -24
  376. package/cjs/utils/ReactChildren.js +2 -19
  377. package/cjs/utils/ajaxUpload.js +15 -33
  378. package/cjs/utils/appendTooltip.js +3 -9
  379. package/cjs/utils/attachParent.js +1 -1
  380. package/cjs/utils/clone.js +1 -2
  381. package/cjs/utils/composeFunctions.js +1 -3
  382. package/cjs/utils/constants.js +3 -8
  383. package/cjs/utils/createChainedFunction.js +2 -6
  384. package/cjs/utils/createComponent.js +12 -24
  385. package/cjs/utils/dateUtils.js +7 -121
  386. package/cjs/utils/deprecateComponent.js +1 -8
  387. package/cjs/utils/deprecatePropType.js +2 -9
  388. package/cjs/utils/dom.js +3 -2
  389. package/cjs/utils/events.js +2 -3
  390. package/cjs/utils/getDOMNode.js +16 -9
  391. package/cjs/utils/getDataGroupBy.d.ts +0 -23
  392. package/cjs/utils/getDataGroupBy.js +5 -44
  393. package/cjs/utils/getSafeRegExpString.js +1 -1
  394. package/cjs/utils/guid.js +1 -1
  395. package/cjs/utils/htmlPropsUtils.js +23 -20
  396. package/cjs/utils/index.js +1 -86
  397. package/cjs/utils/isOneOf.js +1 -2
  398. package/cjs/utils/mergeRefs.js +1 -2
  399. package/cjs/utils/placementPolyfill.js +2 -5
  400. package/cjs/utils/prefix.js +4 -15
  401. package/cjs/utils/previewFile.js +1 -6
  402. package/cjs/utils/propTypeChecker.js +1 -8
  403. package/cjs/utils/reactToString.js +1 -5
  404. package/cjs/utils/render.js +3 -10
  405. package/cjs/utils/scrollTopAnimation.js +1 -9
  406. package/cjs/utils/shallowEqual.js +8 -14
  407. package/cjs/utils/shallowEqualArray.js +1 -7
  408. package/cjs/utils/statusIcons.js +1 -9
  409. package/cjs/utils/stringToObject.js +1 -7
  410. package/cjs/utils/tplTransform.js +2 -7
  411. package/cjs/utils/treeUtils.js +112 -327
  412. package/cjs/utils/useClassNames.js +9 -15
  413. package/cjs/utils/useClickOutside.js +4 -8
  414. package/cjs/utils/useControlled.js +11 -7
  415. package/cjs/utils/useCustom.js +12 -25
  416. package/cjs/utils/useElementResize.js +1 -6
  417. package/cjs/utils/useEnsuredRef.js +1 -4
  418. package/cjs/utils/useEventCallback.js +1 -4
  419. package/cjs/utils/useEventListener.js +1 -5
  420. package/cjs/utils/useFocus.js +5 -6
  421. package/cjs/utils/useInternalId.js +1 -6
  422. package/cjs/utils/useIsMounted.js +1 -3
  423. package/cjs/utils/useMap.js +5 -7
  424. package/cjs/utils/useMount.js +1 -4
  425. package/cjs/utils/usePortal.js +7 -20
  426. package/cjs/utils/useRootClose.js +9 -19
  427. package/cjs/utils/useTimeout.js +3 -8
  428. package/cjs/utils/useToggleCaret.js +2 -14
  429. package/cjs/utils/useUniqueId.js +2 -9
  430. package/cjs/utils/useUpdateEffect.js +3 -5
  431. package/cjs/utils/useUpdatedRef.js +1 -2
  432. package/cjs/utils/useWillUnmount.js +3 -5
  433. package/cjs/utils/warnOnce.js +2 -2
  434. package/dist/rsuite-no-reset-rtl.css +23 -25
  435. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  436. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  437. package/dist/rsuite-no-reset.css +23 -25
  438. package/dist/rsuite-no-reset.min.css +1 -1
  439. package/dist/rsuite-no-reset.min.css.map +1 -1
  440. package/dist/rsuite-rtl.css +23 -25
  441. package/dist/rsuite-rtl.min.css +1 -1
  442. package/dist/rsuite-rtl.min.css.map +1 -1
  443. package/dist/rsuite.css +23 -25
  444. package/dist/rsuite.js +438 -471
  445. package/dist/rsuite.js.map +1 -1
  446. package/dist/rsuite.min.css +1 -1
  447. package/dist/rsuite.min.css.map +1 -1
  448. package/dist/rsuite.min.js +1 -1
  449. package/dist/rsuite.min.js.map +1 -1
  450. package/esm/@types/common.js +1 -0
  451. package/esm/@types/utils.js +14 -2
  452. package/esm/Affix/Affix.js +39 -50
  453. package/esm/Affix/index.js +1 -0
  454. package/esm/Animation/Bounce.js +4 -5
  455. package/esm/Animation/Collapse.js +19 -26
  456. package/esm/Animation/Fade.js +6 -7
  457. package/esm/Animation/Slide.js +6 -7
  458. package/esm/Animation/Transition.js +16 -69
  459. package/esm/Animation/index.js +1 -0
  460. package/esm/Animation/utils.js +1 -2
  461. package/esm/AutoComplete/AutoComplete.js +55 -75
  462. package/esm/AutoComplete/index.js +1 -0
  463. package/esm/AutoComplete/utils.js +1 -4
  464. package/esm/Avatar/Avatar.js +18 -22
  465. package/esm/Avatar/index.js +1 -0
  466. package/esm/AvatarGroup/AvatarGroup.js +13 -16
  467. package/esm/AvatarGroup/index.js +1 -0
  468. package/esm/Badge/Badge.js +14 -19
  469. package/esm/Badge/index.js +1 -0
  470. package/esm/Breadcrumb/Breadcrumb.js +19 -30
  471. package/esm/Breadcrumb/BreadcrumbItem.js +14 -17
  472. package/esm/Breadcrumb/index.js +1 -0
  473. package/esm/Button/Button.js +22 -28
  474. package/esm/Button/index.js +1 -0
  475. package/esm/ButtonGroup/ButtonGroup.js +15 -16
  476. package/esm/ButtonGroup/ButtonGroupContext.js +1 -0
  477. package/esm/ButtonGroup/index.js +1 -0
  478. package/esm/ButtonToolbar/ButtonToolbar.js +10 -12
  479. package/esm/ButtonToolbar/index.js +1 -0
  480. package/esm/Calendar/Calendar.js +24 -29
  481. package/esm/Calendar/CalendarBody.js +14 -18
  482. package/esm/Calendar/CalendarContainer.js +46 -51
  483. package/esm/Calendar/CalendarContext.js +1 -0
  484. package/esm/Calendar/CalendarHeader.js +32 -41
  485. package/esm/Calendar/MonthDropdown.js +22 -27
  486. package/esm/Calendar/MonthDropdownItem.js +16 -20
  487. package/esm/Calendar/Table.js +10 -11
  488. package/esm/Calendar/TableHeaderRow.js +11 -15
  489. package/esm/Calendar/TableRow.js +36 -50
  490. package/esm/Calendar/TimeDropdown.js +24 -48
  491. package/esm/Calendar/index.js +1 -0
  492. package/esm/Calendar/types.js +1 -0
  493. package/esm/Calendar/useCalendarDate.js +3 -11
  494. package/esm/Calendar/useCalendarState.js +3 -6
  495. package/esm/Carousel/Carousel.js +40 -52
  496. package/esm/Carousel/index.js +1 -0
  497. package/esm/Cascader/Cascader.js +126 -178
  498. package/esm/Cascader/DropdownMenu.js +33 -45
  499. package/esm/Cascader/index.js +1 -0
  500. package/esm/Cascader/utils.js +13 -22
  501. package/esm/CheckPicker/CheckPicker.js +105 -139
  502. package/esm/CheckPicker/index.js +1 -0
  503. package/esm/CheckTree/index.js +1 -0
  504. package/esm/CheckTreePicker/CheckTreeNode.js +28 -44
  505. package/esm/CheckTreePicker/CheckTreePicker.js +165 -232
  506. package/esm/CheckTreePicker/index.js +1 -0
  507. package/esm/CheckTreePicker/utils.js +12 -35
  508. package/esm/Checkbox/Checkbox.js +48 -66
  509. package/esm/Checkbox/index.js +1 -0
  510. package/esm/CheckboxGroup/CheckboxGroup.js +20 -25
  511. package/esm/CheckboxGroup/CheckboxGroupContext.js +1 -0
  512. package/esm/CheckboxGroup/index.js +1 -0
  513. package/esm/CloseButton/CloseButton.js +10 -13
  514. package/esm/CloseButton/index.js +1 -0
  515. package/esm/Col/Col.js +10 -13
  516. package/esm/Col/index.js +1 -0
  517. package/esm/Container/Container.js +11 -13
  518. package/esm/Container/index.js +1 -0
  519. package/esm/Content/Content.js +1 -1
  520. package/esm/Content/index.js +1 -0
  521. package/esm/CustomProvider/CustomProvider.js +13 -16
  522. package/esm/CustomProvider/FormattedDate.js +3 -6
  523. package/esm/CustomProvider/index.js +1 -0
  524. package/esm/DOMHelper/index.js +1 -2
  525. package/esm/DOMHelper/isElement.js +1 -1
  526. package/esm/DatePicker/DatePicker.js +108 -131
  527. package/esm/DatePicker/PredefinedRanges.js +12 -19
  528. package/esm/DatePicker/Toolbar.js +20 -26
  529. package/esm/DatePicker/index.js +1 -0
  530. package/esm/DatePicker/types.js +1 -0
  531. package/esm/DatePicker/utils.js +5 -8
  532. package/esm/DateRangePicker/Calendar.js +18 -18
  533. package/esm/DateRangePicker/DateRangePicker.js +128 -184
  534. package/esm/DateRangePicker/DateRangePickerContext.js +1 -0
  535. package/esm/DateRangePicker/disabledDateUtils.js +9 -24
  536. package/esm/DateRangePicker/index.js +1 -0
  537. package/esm/DateRangePicker/types.js +1 -0
  538. package/esm/DateRangePicker/utils.js +7 -12
  539. package/esm/Disclosure/Disclosure.js +13 -24
  540. package/esm/Disclosure/DisclosureButton.js +4 -7
  541. package/esm/Disclosure/DisclosureContent.js +1 -2
  542. package/esm/Disclosure/DisclosureContext.js +1 -2
  543. package/esm/Disclosure/index.js +1 -0
  544. package/esm/Disclosure/useDisclosureContext.js +1 -2
  545. package/esm/Divider/Divider.js +11 -12
  546. package/esm/Divider/index.js +1 -0
  547. package/esm/Drawer/Drawer.js +10 -11
  548. package/esm/Drawer/index.js +1 -0
  549. package/esm/Dropdown/Dropdown.js +35 -50
  550. package/esm/Dropdown/DropdownContext.js +1 -0
  551. package/esm/Dropdown/DropdownItem.js +22 -31
  552. package/esm/Dropdown/DropdownMenu.js +36 -49
  553. package/esm/Dropdown/DropdownSeparator.js +8 -10
  554. package/esm/Dropdown/DropdownState.js +1 -7
  555. package/esm/Dropdown/DropdownToggle.js +17 -17
  556. package/esm/Dropdown/index.js +1 -0
  557. package/esm/Dropdown/useRenderDropdownItem.js +1 -2
  558. package/esm/FlexboxGrid/FlexboxGrid.js +12 -13
  559. package/esm/FlexboxGrid/FlexboxGridItem.js +12 -14
  560. package/esm/FlexboxGrid/index.js +1 -0
  561. package/esm/Footer/Footer.js +1 -0
  562. package/esm/Footer/index.js +1 -0
  563. package/esm/Form/Form.js +38 -66
  564. package/esm/Form/FormContext.d.ts +2 -3
  565. package/esm/Form/FormContext.js +1 -0
  566. package/esm/Form/index.js +1 -0
  567. package/esm/Form/useFormClassNames.js +11 -13
  568. package/esm/Form/useSchemaModel.js +2 -4
  569. package/esm/FormControl/FormControl.js +46 -70
  570. package/esm/FormControl/index.js +1 -0
  571. package/esm/FormControl/useRegisterModel.js +1 -2
  572. package/esm/FormControlLabel/FormControlLabel.js +10 -12
  573. package/esm/FormControlLabel/index.js +1 -0
  574. package/esm/FormErrorMessage/FormErrorMessage.js +12 -18
  575. package/esm/FormErrorMessage/index.js +1 -0
  576. package/esm/FormGroup/FormGroup.js +9 -10
  577. package/esm/FormGroup/index.js +1 -0
  578. package/esm/FormHelpText/FormHelpText.js +11 -15
  579. package/esm/FormHelpText/index.js +1 -0
  580. package/esm/Grid/Grid.js +10 -11
  581. package/esm/Grid/index.js +1 -0
  582. package/esm/Header/Header.js +1 -0
  583. package/esm/Header/index.js +1 -0
  584. package/esm/IconButton/IconButton.js +11 -12
  585. package/esm/IconButton/index.js +1 -0
  586. package/esm/Input/Input.js +26 -32
  587. package/esm/Input/index.js +1 -0
  588. package/esm/InputGroup/InputGroup.js +23 -26
  589. package/esm/InputGroup/InputGroupAddon.js +9 -10
  590. package/esm/InputGroup/InputGroupButton.js +7 -9
  591. package/esm/InputGroup/index.js +1 -0
  592. package/esm/InputNumber/InputNumber.js +42 -72
  593. package/esm/InputNumber/index.js +1 -0
  594. package/esm/InputPicker/InputAutosize.js +17 -37
  595. package/esm/InputPicker/InputPicker.d.ts +2 -0
  596. package/esm/InputPicker/InputPicker.js +152 -226
  597. package/esm/InputPicker/InputSearch.js +15 -20
  598. package/esm/InputPicker/index.js +1 -0
  599. package/esm/List/List.js +37 -39
  600. package/esm/List/ListContext.js +1 -0
  601. package/esm/List/ListItem.js +26 -30
  602. package/esm/List/helper/AutoScroller.js +11 -21
  603. package/esm/List/helper/useManager.js +1 -6
  604. package/esm/List/helper/useSortHelper.js +58 -74
  605. package/esm/List/helper/utils.js +6 -11
  606. package/esm/List/index.js +1 -0
  607. package/esm/Loader/Loader.js +17 -19
  608. package/esm/Loader/index.js +1 -0
  609. package/esm/MaskedInput/MaskedInput.js +2 -1
  610. package/esm/MaskedInput/TextMask.js +12 -14
  611. package/esm/MaskedInput/adjustCaretPosition.js +99 -69
  612. package/esm/MaskedInput/conformToMask.js +79 -70
  613. package/esm/MaskedInput/createTextMaskInputElement.js +65 -62
  614. package/esm/MaskedInput/index.js +1 -0
  615. package/esm/MaskedInput/types.js +1 -0
  616. package/esm/MaskedInput/utilities.js +1 -6
  617. package/esm/Menu/Menu.js +35 -66
  618. package/esm/Menu/MenuContext.js +1 -4
  619. package/esm/Menu/MenuItem.js +15 -19
  620. package/esm/Menu/Menubar.js +13 -23
  621. package/esm/Menu/index.js +1 -0
  622. package/esm/Menu/useMenu.js +4 -27
  623. package/esm/Message/Message.js +23 -34
  624. package/esm/Message/index.js +1 -0
  625. package/esm/Modal/Modal.js +70 -69
  626. package/esm/Modal/ModalBody.js +11 -13
  627. package/esm/Modal/ModalContext.js +1 -0
  628. package/esm/Modal/ModalDialog.js +14 -18
  629. package/esm/Modal/ModalFooter.js +1 -0
  630. package/esm/Modal/ModalHeader.js +14 -16
  631. package/esm/Modal/ModalTitle.js +9 -10
  632. package/esm/Modal/index.js +1 -0
  633. package/esm/Modal/utils.js +8 -12
  634. package/esm/MultiCascader/DropdownMenu.js +38 -48
  635. package/esm/MultiCascader/MultiCascader.js +129 -174
  636. package/esm/MultiCascader/index.js +1 -0
  637. package/esm/MultiCascader/utils.js +44 -87
  638. package/esm/Nav/Nav.js +27 -45
  639. package/esm/Nav/NavContext.js +1 -0
  640. package/esm/Nav/NavDropdown.js +28 -44
  641. package/esm/Nav/NavDropdownItem.js +20 -31
  642. package/esm/Nav/NavDropdownMenu.js +26 -42
  643. package/esm/Nav/NavDropdownToggle.js +12 -15
  644. package/esm/Nav/NavItem.js +20 -28
  645. package/esm/Nav/NavMenu.js +2 -13
  646. package/esm/Nav/index.js +1 -0
  647. package/esm/Navbar/Navbar.js +10 -11
  648. package/esm/Navbar/NavbarBody.js +1 -0
  649. package/esm/Navbar/NavbarBrand.js +1 -0
  650. package/esm/Navbar/NavbarDropdown.js +25 -33
  651. package/esm/Navbar/NavbarDropdownItem.js +18 -30
  652. package/esm/Navbar/NavbarDropdownMenu.js +22 -37
  653. package/esm/Navbar/NavbarDropdownToggle.js +12 -14
  654. package/esm/Navbar/NavbarHeader.js +1 -0
  655. package/esm/Navbar/NavbarItem.js +19 -23
  656. package/esm/Navbar/index.js +1 -0
  657. package/esm/Notification/Notification.js +20 -32
  658. package/esm/Notification/index.js +1 -0
  659. package/esm/Overlay/Modal.js +40 -64
  660. package/esm/Overlay/ModalManager.js +1 -19
  661. package/esm/Overlay/Overlay.js +28 -37
  662. package/esm/Overlay/OverlayContext.js +1 -0
  663. package/esm/Overlay/OverlayTrigger.js +68 -101
  664. package/esm/Overlay/Position.js +25 -47
  665. package/esm/Overlay/index.js +1 -0
  666. package/esm/Overlay/positionUtils.js +25 -73
  667. package/esm/Pagination/Pagination.js +30 -55
  668. package/esm/Pagination/PaginationButton.js +15 -19
  669. package/esm/Pagination/PaginationGroup.js +38 -49
  670. package/esm/Pagination/index.js +1 -0
  671. package/esm/Panel/Panel.js +37 -49
  672. package/esm/Panel/index.js +1 -0
  673. package/esm/PanelGroup/PanelGroup.js +16 -18
  674. package/esm/PanelGroup/index.js +1 -0
  675. package/esm/Picker/DropdownMenu.js +50 -72
  676. package/esm/Picker/DropdownMenuCheckItem.js +22 -24
  677. package/esm/Picker/DropdownMenuGroup.js +10 -13
  678. package/esm/Picker/DropdownMenuItem.js +15 -18
  679. package/esm/Picker/PickerOverlay.js +12 -17
  680. package/esm/Picker/PickerToggle.js +57 -71
  681. package/esm/Picker/PickerToggleTrigger.js +8 -10
  682. package/esm/Picker/SearchBar.js +14 -15
  683. package/esm/Picker/SelectedElement.js +9 -14
  684. package/esm/Picker/ToggleButton.js +1 -0
  685. package/esm/Picker/index.js +1 -0
  686. package/esm/Picker/propTypes.js +1 -1
  687. package/esm/Picker/types.js +1 -0
  688. package/esm/Picker/utils.js +94 -182
  689. package/esm/Placeholder/Placeholder.js +1 -0
  690. package/esm/Placeholder/PlaceholderGraph.js +13 -16
  691. package/esm/Placeholder/PlaceholderGrid.js +18 -25
  692. package/esm/Placeholder/PlaceholderParagraph.js +17 -20
  693. package/esm/Placeholder/index.js +1 -0
  694. package/esm/Plaintext/Plaintext.js +14 -17
  695. package/esm/Plaintext/index.js +1 -0
  696. package/esm/Popover/Popover.js +16 -21
  697. package/esm/Popover/index.js +1 -0
  698. package/esm/Progress/Progress.js +1 -0
  699. package/esm/Progress/ProgressCircle.js +30 -39
  700. package/esm/Progress/ProgressLine.js +19 -21
  701. package/esm/Progress/index.js +1 -0
  702. package/esm/Radio/Radio.js +42 -52
  703. package/esm/Radio/index.js +1 -0
  704. package/esm/RadioGroup/RadioGroup.js +22 -25
  705. package/esm/RadioGroup/index.js +1 -0
  706. package/esm/RadioTile/RadioTile.js +30 -34
  707. package/esm/RadioTile/index.js +1 -0
  708. package/esm/RadioTileGroup/RadioTileGroup.js +17 -20
  709. package/esm/RadioTileGroup/index.js +1 -0
  710. package/esm/RangeSlider/RangeSlider.js +63 -86
  711. package/esm/RangeSlider/index.js +1 -0
  712. package/esm/Rate/Character.js +16 -21
  713. package/esm/Rate/Rate.js +35 -48
  714. package/esm/Rate/index.js +1 -0
  715. package/esm/Rate/utils.js +1 -2
  716. package/esm/Ripple/Ripple.js +16 -30
  717. package/esm/Ripple/index.js +1 -0
  718. package/esm/Row/Row.js +11 -14
  719. package/esm/Row/index.js +1 -0
  720. package/esm/SafeAnchor/SafeAnchor.js +8 -13
  721. package/esm/SafeAnchor/index.js +1 -0
  722. package/esm/Schema/Schema.js +1 -0
  723. package/esm/Schema/index.js +1 -0
  724. package/esm/SelectPicker/SelectPicker.js +137 -157
  725. package/esm/SelectPicker/index.js +1 -0
  726. package/esm/Sidebar/Sidebar.js +13 -18
  727. package/esm/Sidebar/index.js +1 -0
  728. package/esm/Sidenav/ExpandedSidenavDropdown.js +32 -35
  729. package/esm/Sidenav/ExpandedSidenavDropdownItem.js +19 -27
  730. package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +22 -29
  731. package/esm/Sidenav/Node.js +1 -10
  732. package/esm/Sidenav/Sidenav.js +22 -28
  733. package/esm/Sidenav/SidenavBody.js +1 -0
  734. package/esm/Sidenav/SidenavDropdown.js +39 -52
  735. package/esm/Sidenav/SidenavDropdownCollapse.js +9 -13
  736. package/esm/Sidenav/SidenavDropdownItem.js +19 -31
  737. package/esm/Sidenav/SidenavDropdownMenu.js +26 -41
  738. package/esm/Sidenav/SidenavDropdownToggle.js +12 -14
  739. package/esm/Sidenav/SidenavHeader.js +1 -0
  740. package/esm/Sidenav/SidenavItem.js +27 -37
  741. package/esm/Sidenav/SidenavToggle.js +11 -18
  742. package/esm/Sidenav/index.js +1 -0
  743. package/esm/Slider/Graduated.js +14 -21
  744. package/esm/Slider/Handle.js +27 -39
  745. package/esm/Slider/Input.js +2 -2
  746. package/esm/Slider/Mark.js +11 -14
  747. package/esm/Slider/ProgressBar.js +14 -18
  748. package/esm/Slider/Slider.js +51 -67
  749. package/esm/Slider/index.js +1 -0
  750. package/esm/Slider/utils.js +1 -5
  751. package/esm/Stack/Stack.js +22 -27
  752. package/esm/Stack/StackItem.js +11 -11
  753. package/esm/Stack/index.js +1 -0
  754. package/esm/Steps/StepItem.js +16 -22
  755. package/esm/Steps/Steps.js +18 -22
  756. package/esm/Steps/index.js +1 -0
  757. package/esm/Table/Table.js +6 -7
  758. package/esm/Table/index.js +1 -0
  759. package/esm/Tag/Tag.js +16 -19
  760. package/esm/Tag/index.js +1 -0
  761. package/esm/TagGroup/TagGroup.js +1 -0
  762. package/esm/TagGroup/index.js +1 -0
  763. package/esm/TagInput/index.d.ts +3 -0
  764. package/esm/TagInput/index.js +11 -9
  765. package/esm/TagPicker/index.d.ts +3 -0
  766. package/esm/TagPicker/index.js +9 -7
  767. package/esm/Timeline/Timeline.js +14 -19
  768. package/esm/Timeline/TimelineItem.js +14 -15
  769. package/esm/Timeline/index.js +1 -0
  770. package/esm/Toggle/Toggle.js +26 -35
  771. package/esm/Toggle/index.js +1 -0
  772. package/esm/Tooltip/Tooltip.js +13 -16
  773. package/esm/Tooltip/index.js +1 -0
  774. package/esm/Tree/Tree.js +1 -3
  775. package/esm/Tree/TreeContext.js +1 -0
  776. package/esm/Tree/index.js +1 -0
  777. package/esm/TreePicker/TreeNode.js +37 -49
  778. package/esm/TreePicker/TreePicker.js +155 -218
  779. package/esm/TreePicker/index.js +1 -0
  780. package/esm/Uploader/UploadFileItem.js +37 -68
  781. package/esm/Uploader/UploadTrigger.js +24 -38
  782. package/esm/Uploader/Uploader.js +90 -132
  783. package/esm/Uploader/index.js +1 -0
  784. package/esm/Whisper/Whisper.js +8 -10
  785. package/esm/Whisper/index.js +1 -0
  786. package/esm/Windowing/AutoSizer.js +13 -24
  787. package/esm/Windowing/List.d.ts +2 -2
  788. package/esm/Windowing/List.js +6 -15
  789. package/esm/Windowing/index.js +1 -0
  790. package/esm/index.js +3 -0
  791. package/esm/locales/ar_EG.js +1 -0
  792. package/esm/locales/da_DK.js +1 -1
  793. package/esm/locales/de_DE.js +1 -1
  794. package/esm/locales/default.js +1 -1
  795. package/esm/locales/en_GB.js +1 -0
  796. package/esm/locales/en_US.js +1 -0
  797. package/esm/locales/es_AR.js +1 -1
  798. package/esm/locales/es_ES.js +1 -1
  799. package/esm/locales/fa_IR.js +1 -0
  800. package/esm/locales/fi_FI.js +1 -1
  801. package/esm/locales/fr_FR.js +1 -0
  802. package/esm/locales/hu_HU.js +1 -1
  803. package/esm/locales/index.js +1 -0
  804. package/esm/locales/it_IT.js +1 -1
  805. package/esm/locales/ja_JP.js +1 -1
  806. package/esm/locales/kk_KZ.js +1 -0
  807. package/esm/locales/ko_KR.js +1 -1
  808. package/esm/locales/ne_NP.js +1 -1
  809. package/esm/locales/nl_NL.js +1 -0
  810. package/esm/locales/pt_BR.js +1 -0
  811. package/esm/locales/ru_RU.js +1 -0
  812. package/esm/locales/sv_SE.js +1 -1
  813. package/esm/locales/tr_TR.js +1 -0
  814. package/esm/locales/zh_CN.js +1 -0
  815. package/esm/locales/zh_TW.js +1 -0
  816. package/esm/toaster/ToastContainer.js +29 -42
  817. package/esm/toaster/ToastContext.js +1 -0
  818. package/esm/toaster/index.js +1 -0
  819. package/esm/toaster/toaster.js +4 -22
  820. package/esm/toaster/useToaster.js +3 -5
  821. package/esm/utils/BrowserDetection.js +9 -9
  822. package/esm/utils/ReactChildren.js +2 -8
  823. package/esm/utils/ajaxUpload.js +15 -32
  824. package/esm/utils/appendTooltip.js +3 -3
  825. package/esm/utils/attachParent.js +1 -0
  826. package/esm/utils/clone.js +1 -1
  827. package/esm/utils/composeFunctions.js +1 -1
  828. package/esm/utils/constants.js +4 -7
  829. package/esm/utils/createChainedFunction.js +2 -5
  830. package/esm/utils/createComponent.js +12 -16
  831. package/esm/utils/dateUtils.js +7 -23
  832. package/esm/utils/deprecateComponent.js +2 -2
  833. package/esm/utils/deprecatePropType.js +4 -6
  834. package/esm/utils/dom.js +3 -1
  835. package/esm/utils/events.js +2 -1
  836. package/esm/utils/getDOMNode.js +15 -8
  837. package/esm/utils/getDataGroupBy.d.ts +0 -23
  838. package/esm/utils/getDataGroupBy.js +5 -39
  839. package/esm/utils/getSafeRegExpString.js +1 -0
  840. package/esm/utils/guid.js +1 -0
  841. package/esm/utils/htmlPropsUtils.js +23 -14
  842. package/esm/utils/index.js +2 -1
  843. package/esm/utils/isOneOf.js +1 -1
  844. package/esm/utils/mergeRefs.js +1 -1
  845. package/esm/utils/placementPolyfill.js +2 -4
  846. package/esm/utils/prefix.js +4 -4
  847. package/esm/utils/previewFile.js +1 -3
  848. package/esm/utils/propTypeChecker.js +1 -3
  849. package/esm/utils/reactToString.js +1 -2
  850. package/esm/utils/render.js +3 -5
  851. package/esm/utils/scrollTopAnimation.js +1 -5
  852. package/esm/utils/shallowEqual.js +8 -13
  853. package/esm/utils/shallowEqualArray.js +1 -5
  854. package/esm/utils/statusIcons.js +1 -0
  855. package/esm/utils/stringToObject.js +3 -4
  856. package/esm/utils/tplTransform.js +2 -4
  857. package/esm/utils/treeUtils.js +113 -265
  858. package/esm/utils/useClassNames.js +9 -9
  859. package/esm/utils/useClickOutside.js +4 -6
  860. package/esm/utils/useControlled.js +12 -6
  861. package/esm/utils/useCustom.js +12 -20
  862. package/esm/utils/useElementResize.js +2 -4
  863. package/esm/utils/useEnsuredRef.js +2 -3
  864. package/esm/utils/useEventCallback.js +2 -3
  865. package/esm/utils/useEventListener.js +2 -2
  866. package/esm/utils/useFocus.js +5 -4
  867. package/esm/utils/useInternalId.js +2 -3
  868. package/esm/utils/useIsMounted.js +1 -2
  869. package/esm/utils/useMap.js +5 -5
  870. package/esm/utils/useMount.js +1 -3
  871. package/esm/utils/usePortal.js +7 -13
  872. package/esm/utils/useRootClose.js +9 -13
  873. package/esm/utils/useTimeout.js +3 -7
  874. package/esm/utils/useToggleCaret.js +2 -7
  875. package/esm/utils/useUniqueId.js +2 -4
  876. package/esm/utils/useUpdateEffect.js +3 -4
  877. package/esm/utils/useUpdatedRef.js +2 -1
  878. package/esm/utils/useWillUnmount.js +4 -2
  879. package/esm/utils/warnOnce.js +2 -2
  880. package/package.json +2 -2
  881. package/styles/color-modes/light.less +4 -4
  882. package/styles/mixins/listbox.less +0 -2
  883. package/cjs/SelectPicker/Listbox.d.ts +0 -34
  884. package/cjs/SelectPicker/Listbox.js +0 -263
  885. package/cjs/SelectPicker/ListboxOption.d.ts +0 -11
  886. package/cjs/SelectPicker/ListboxOption.js +0 -50
  887. package/cjs/SelectPicker/ListboxOptionGroup.d.ts +0 -9
  888. package/cjs/SelectPicker/ListboxOptionGroup.js +0 -69
  889. package/esm/SelectPicker/Listbox.d.ts +0 -34
  890. package/esm/SelectPicker/Listbox.js +0 -240
  891. package/esm/SelectPicker/ListboxOption.d.ts +0 -11
  892. package/esm/SelectPicker/ListboxOption.js +0 -37
  893. package/esm/SelectPicker/ListboxOptionGroup.d.ts +0 -9
  894. package/esm/SelectPicker/ListboxOptionGroup.js +0 -53
@@ -1,9 +1,8 @@
1
+ 'use client';
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
6
  exports.__esModule = true;
8
7
  exports.createConcatChildrenFunction = createConcatChildrenFunction;
9
8
  exports.shouldDisplay = shouldDisplay;
@@ -12,101 +11,78 @@ exports.onMenuKeyDown = onMenuKeyDown;
12
11
  exports.useSearch = useSearch;
13
12
  exports.usePublicMethods = usePublicMethods;
14
13
  exports.useToggleKeyDownEvent = exports.useFocusItemValue = void 0;
15
-
16
14
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
17
-
18
15
  var _react = _interopRequireWildcard(require("react"));
19
-
20
16
  var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
21
-
22
17
  var _trim = _interopRequireDefault(require("lodash/trim"));
23
-
24
18
  var _isFunction = _interopRequireDefault(require("lodash/isFunction"));
25
-
26
19
  var _isUndefined = _interopRequireDefault(require("lodash/isUndefined"));
27
-
28
20
  var _omit = _interopRequireDefault(require("lodash/omit"));
29
-
30
21
  var _find = _interopRequireDefault(require("lodash/find"));
31
-
32
22
  var _treeUtils = require("../utils/treeUtils");
33
-
34
23
  var _utils = require("../utils");
35
-
36
24
  var _domLib = require("dom-lib");
37
-
38
25
  var defaultNodeKeys = {
39
26
  valueKey: 'value',
40
27
  childrenKey: 'children'
41
28
  };
42
-
43
29
  function createConcatChildrenFunction(node, nodeValue, nodeKeys) {
44
30
  if (nodeKeys === void 0) {
45
31
  nodeKeys = defaultNodeKeys;
46
32
  }
47
-
48
33
  var _nodeKeys = nodeKeys,
49
- valueKey = _nodeKeys.valueKey,
50
- childrenKey = _nodeKeys.childrenKey;
34
+ valueKey = _nodeKeys.valueKey,
35
+ childrenKey = _nodeKeys.childrenKey;
51
36
  return function (data, children) {
52
37
  if (nodeValue) {
53
38
  node = (0, _treeUtils.findNodeOfTree)(data, function (item) {
54
39
  return nodeValue === item[valueKey];
55
40
  });
56
41
  }
57
-
58
42
  node[childrenKey] = children;
59
43
  return data.concat([]);
60
44
  };
61
45
  }
62
-
63
46
  function shouldDisplay(label, searchKeyword) {
64
47
  if (!(0, _trim.default)(searchKeyword)) {
65
48
  return true;
66
49
  }
67
-
68
50
  var keyword = searchKeyword.toLocaleLowerCase();
69
-
70
51
  if (typeof label === 'string' || typeof label === 'number') {
71
52
  return ("" + label).toLocaleLowerCase().indexOf(keyword) >= 0;
72
53
  } else if ( /*#__PURE__*/_react.default.isValidElement(label)) {
73
54
  var nodes = (0, _utils.reactToString)(label);
74
55
  return nodes.join('').toLocaleLowerCase().indexOf(keyword) >= 0;
75
56
  }
76
-
77
57
  return false;
78
58
  }
79
-
80
59
  /**
81
60
  * The className of the assembled Toggle is on the Picker.
82
61
  */
83
62
  function usePickerClassName(props) {
84
63
  var _withClassPrefix;
85
-
86
64
  var name = props.name,
87
- classPrefix = props.classPrefix,
88
- className = props.className,
89
- placement = props.placement,
90
- appearance = props.appearance,
91
- cleanable = props.cleanable,
92
- block = props.block,
93
- disabled = props.disabled,
94
- countable = props.countable,
95
- readOnly = props.readOnly,
96
- plaintext = props.plaintext,
97
- hasValue = props.hasValue,
98
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["name", "classPrefix", "className", "placement", "appearance", "cleanable", "block", "disabled", "countable", "readOnly", "plaintext", "hasValue"]);
99
-
65
+ classPrefix = props.classPrefix,
66
+ className = props.className,
67
+ placement = props.placement,
68
+ appearance = props.appearance,
69
+ cleanable = props.cleanable,
70
+ block = props.block,
71
+ disabled = props.disabled,
72
+ countable = props.countable,
73
+ readOnly = props.readOnly,
74
+ plaintext = props.plaintext,
75
+ hasValue = props.hasValue,
76
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["name", "classPrefix", "className", "placement", "appearance", "cleanable", "block", "disabled", "countable", "readOnly", "plaintext", "hasValue"]);
100
77
  var _useClassNames = (0, _utils.useClassNames)(classPrefix),
101
- withClassPrefix = _useClassNames.withClassPrefix,
102
- merge = _useClassNames.merge;
103
-
104
- var classes = merge(className, withClassPrefix(name, appearance, 'toggle-wrapper', (_withClassPrefix = {}, _withClassPrefix["placement-" + (0, _kebabCase.default)((0, _utils.placementPolyfill)(placement))] = placement, _withClassPrefix['read-only'] = readOnly, _withClassPrefix['has-value'] = hasValue, _withClassPrefix.cleanable = cleanable, _withClassPrefix.block = block, _withClassPrefix.disabled = disabled, _withClassPrefix.countable = countable, _withClassPrefix.plaintext = plaintext, _withClassPrefix))); // Those props that're used for composing the className
78
+ withClassPrefix = _useClassNames.withClassPrefix,
79
+ merge = _useClassNames.merge;
80
+ var classes = merge(className, withClassPrefix(name, appearance, 'toggle-wrapper', (_withClassPrefix = {}, _withClassPrefix["placement-" + (0, _kebabCase.default)((0, _utils.placementPolyfill)(placement))] = placement, _withClassPrefix['read-only'] = readOnly, _withClassPrefix['has-value'] = hasValue, _withClassPrefix.cleanable = cleanable, _withClassPrefix.block = block, _withClassPrefix.disabled = disabled, _withClassPrefix.countable = countable, _withClassPrefix.plaintext = plaintext, _withClassPrefix)));
105
81
 
82
+ // Those props that're used for composing the className
106
83
  var usedClassNamePropKeys = Object.keys((0, _omit.default)(props, [].concat(Object.keys(rest || {}), ['disabled', 'readOnly', 'plaintext', 'name'])));
107
84
  return [classes, usedClassNamePropKeys];
108
85
  }
109
-
110
86
  /**
111
87
  * Handling keyboard events...
112
88
  * @param event Keyboard event object
@@ -114,13 +90,12 @@ function usePickerClassName(props) {
114
90
  */
115
91
  function onMenuKeyDown(event, events) {
116
92
  var down = events.down,
117
- up = events.up,
118
- enter = events.enter,
119
- del = events.del,
120
- esc = events.esc,
121
- right = events.right,
122
- left = events.left;
123
-
93
+ up = events.up,
94
+ enter = events.enter,
95
+ del = events.del,
96
+ esc = events.esc,
97
+ right = events.right,
98
+ left = events.left;
124
99
  switch (event.key) {
125
100
  // down
126
101
  case _utils.KEY_VALUES.DOWN:
@@ -128,199 +103,168 @@ function onMenuKeyDown(event, events) {
128
103
  event.preventDefault();
129
104
  break;
130
105
  // up
131
-
132
106
  case _utils.KEY_VALUES.UP:
133
107
  up === null || up === void 0 ? void 0 : up(event);
134
108
  event.preventDefault();
135
109
  break;
136
110
  // enter
137
-
138
111
  case _utils.KEY_VALUES.ENTER:
139
112
  enter === null || enter === void 0 ? void 0 : enter(event);
140
113
  event.preventDefault();
141
114
  break;
142
115
  // delete
143
-
144
116
  case _utils.KEY_VALUES.BACKSPACE:
145
117
  del === null || del === void 0 ? void 0 : del(event);
146
118
  break;
147
119
  // esc | tab
148
-
149
120
  case _utils.KEY_VALUES.ESC:
150
121
  case _utils.KEY_VALUES.TAB:
151
122
  esc === null || esc === void 0 ? void 0 : esc(event);
152
123
  break;
153
124
  // left arrow
154
-
155
125
  case _utils.KEY_VALUES.LEFT:
156
126
  left === null || left === void 0 ? void 0 : left(event);
157
127
  break;
158
128
  // right arrow
159
-
160
129
  case _utils.KEY_VALUES.RIGHT:
161
130
  right === null || right === void 0 ? void 0 : right(event);
162
131
  break;
163
-
164
132
  default:
165
133
  }
166
134
  }
167
-
168
135
  /**
169
136
  * Checks if the element has a vertical scrollbar.
170
137
  */
171
138
  function hasVerticalScroll(element) {
172
139
  var scrollHeight = element.scrollHeight,
173
- clientHeight = element.clientHeight;
140
+ clientHeight = element.clientHeight;
174
141
  return scrollHeight > clientHeight;
175
142
  }
143
+
176
144
  /**
177
145
  * Checks if the element is within the visible area of the container
178
146
  */
179
-
180
-
181
147
  function isVisible(element, container, direction) {
182
148
  if (!hasVerticalScroll(container)) {
183
149
  return true;
184
150
  }
185
-
186
151
  var _element$getBoundingC = element.getBoundingClientRect(),
187
- top = _element$getBoundingC.top,
188
- bottom = _element$getBoundingC.bottom,
189
- height = _element$getBoundingC.height;
190
-
152
+ top = _element$getBoundingC.top,
153
+ bottom = _element$getBoundingC.bottom,
154
+ height = _element$getBoundingC.height;
191
155
  var _container$getBoundin = container.getBoundingClientRect(),
192
- containerTop = _container$getBoundin.top,
193
- containerBottom = _container$getBoundin.bottom;
194
-
156
+ containerTop = _container$getBoundin.top,
157
+ containerBottom = _container$getBoundin.bottom;
195
158
  if (direction === 'top') {
196
159
  return top + height > containerTop;
197
160
  }
198
-
199
161
  return bottom - height < containerBottom;
200
162
  }
201
-
202
163
  function scrollTo(container, direction, step) {
203
164
  var scrollTop = container.scrollTop;
204
165
  container.scrollTop = direction === 'top' ? scrollTop - step : scrollTop + step;
205
166
  }
167
+
206
168
  /**
207
169
  * A hook that manages the focus state of the option.
208
170
  * @param defaultFocusItemValue
209
171
  * @param props
210
172
  */
211
-
212
-
213
173
  var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props) {
214
174
  var _props$valueKey = props.valueKey,
215
- valueKey = _props$valueKey === void 0 ? 'value' : _props$valueKey,
216
- _props$focusableQuery = props.focusableQueryKey,
217
- focusableQueryKey = _props$focusableQuery === void 0 ? '[data-key][aria-disabled="false"]' : _props$focusableQuery,
218
- _props$defaultLayer = props.defaultLayer,
219
- defaultLayer = _props$defaultLayer === void 0 ? 0 : _props$defaultLayer,
220
- data = props.data,
221
- target = props.target,
222
- rtl = props.rtl,
223
- callback = props.callback,
224
- _props$getParent = props.getParent,
225
- getParent = _props$getParent === void 0 ? function (item) {
226
- return item === null || item === void 0 ? void 0 : item.parent;
227
- } : _props$getParent;
228
-
175
+ valueKey = _props$valueKey === void 0 ? 'value' : _props$valueKey,
176
+ _props$focusableQuery = props.focusableQueryKey,
177
+ focusableQueryKey = _props$focusableQuery === void 0 ? '[data-key][aria-disabled="false"]' : _props$focusableQuery,
178
+ _props$defaultLayer = props.defaultLayer,
179
+ defaultLayer = _props$defaultLayer === void 0 ? 0 : _props$defaultLayer,
180
+ data = props.data,
181
+ target = props.target,
182
+ rtl = props.rtl,
183
+ callback = props.callback,
184
+ _props$getParent = props.getParent,
185
+ getParent = _props$getParent === void 0 ? function (item) {
186
+ return item === null || item === void 0 ? void 0 : item.parent;
187
+ } : _props$getParent;
229
188
  var _useState = (0, _react.useState)(defaultFocusItemValue),
230
- focusItemValue = _useState[0],
231
- setFocusItemValue = _useState[1];
232
-
189
+ focusItemValue = _useState[0],
190
+ setFocusItemValue = _useState[1];
233
191
  var _useState2 = (0, _react.useState)(defaultLayer),
234
- layer = _useState2[0],
235
- setLayer = _useState2[1];
236
-
192
+ layer = _useState2[0],
193
+ setLayer = _useState2[1];
237
194
  var _useState3 = (0, _react.useState)([]),
238
- keys = _useState3[0],
239
- setKeys = _useState3[1];
240
-
195
+ keys = _useState3[0],
196
+ setKeys = _useState3[1];
241
197
  var getScrollContainer = (0, _react.useCallback)(function () {
242
- var menu = (0, _isFunction.default)(target) ? target() : target; // For Cascader and MutiCascader
198
+ var menu = (0, _isFunction.default)(target) ? target() : target;
243
199
 
200
+ // For Cascader and MutiCascader
244
201
  var subMenu = menu === null || menu === void 0 ? void 0 : menu.querySelector("[data-layer=\"" + layer + "\"]");
245
-
246
202
  if (subMenu) {
247
203
  return subMenu;
248
- } // For SelectPicker、CheckPicker、Autocomplete、InputPicker、TagPicker
249
-
204
+ }
250
205
 
206
+ // For SelectPicker、CheckPicker、Autocomplete、InputPicker、TagPicker
251
207
  return menu === null || menu === void 0 ? void 0 : menu.querySelector('[role="listbox"]');
252
208
  }, [layer, target]);
209
+
253
210
  /**
254
211
  * Get the elements visible in all options.
255
212
  */
256
-
257
213
  var getFocusableMenuItems = (0, _react.useCallback)(function () {
258
214
  if (!target) {
259
215
  return [];
260
216
  }
261
-
262
217
  var currentKeys = keys;
263
-
264
218
  if (layer < 1) {
265
219
  var popup = (0, _isFunction.default)(target) ? target() : target;
266
220
  var rootMenu = popup === null || popup === void 0 ? void 0 : popup.querySelector('[data-layer="0"]');
267
-
268
221
  if (rootMenu) {
269
222
  var _rootMenu$querySelect;
270
-
271
223
  currentKeys = Array.from((_rootMenu$querySelect = rootMenu.querySelectorAll(focusableQueryKey)) !== null && _rootMenu$querySelect !== void 0 ? _rootMenu$querySelect : []).map(function (item) {
272
224
  var _item$dataset;
273
-
274
225
  return (_item$dataset = item.dataset) === null || _item$dataset === void 0 ? void 0 : _item$dataset.key;
275
226
  });
276
227
  } else {
277
228
  var _popup$querySelectorA;
278
-
279
229
  currentKeys = Array.from((_popup$querySelectorA = popup === null || popup === void 0 ? void 0 : popup.querySelectorAll(focusableQueryKey)) !== null && _popup$querySelectorA !== void 0 ? _popup$querySelectorA : []).map(function (item) {
280
230
  var _item$dataset2;
281
-
282
231
  return (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.key;
283
232
  });
284
233
  }
285
- } // 1. It is necessary to traverse the `keys` instead of `data` here to preserve the order of the array.
286
- // 2. The values ​​in `keys` are all string, so the corresponding value of `data` should also be converted to string
287
-
234
+ }
288
235
 
236
+ // 1. It is necessary to traverse the `keys` instead of `data` here to preserve the order of the array.
237
+ // 2. The values ​​in `keys` are all string, so the corresponding value of `data` should also be converted to string
289
238
  return currentKeys.map(function (key) {
290
239
  return (0, _find.default)(data, function (i) {
291
240
  return "" + i[valueKey] === key;
292
241
  });
293
242
  });
294
243
  }, [data, focusableQueryKey, keys, target, valueKey, layer]);
244
+
295
245
  /**
296
246
  * Get the index of the focus item.
297
247
  */
298
-
299
248
  var findFocusItemIndex = (0, _react.useCallback)(function (callback) {
300
249
  var items = getFocusableMenuItems();
301
-
302
250
  for (var i = 0; i < items.length; i += 1) {
303
251
  var _items$i;
304
-
305
252
  if ((0, _utils.shallowEqual)(focusItemValue, (_items$i = items[i]) === null || _items$i === void 0 ? void 0 : _items$i[valueKey])) {
306
253
  callback(items, i);
307
254
  return;
308
255
  }
309
256
  }
310
-
311
257
  callback(items, -1);
312
258
  }, [focusItemValue, getFocusableMenuItems, valueKey]);
313
259
  var scrollListItem = (0, _react.useCallback)(function (direction, itemValue, willOverflow) {
314
260
  var container = getScrollContainer();
315
261
  var item = container === null || container === void 0 ? void 0 : container.querySelector("[data-key=\"" + itemValue + "\"]");
316
-
317
262
  if (willOverflow && container) {
318
263
  var scrollHeight = container.scrollHeight,
319
- clientHeight = container.clientHeight;
264
+ clientHeight = container.clientHeight;
320
265
  container.scrollTop = direction === 'top' ? scrollHeight - clientHeight : 0;
321
266
  return;
322
267
  }
323
-
324
268
  if (item && container) {
325
269
  if (!isVisible(item, container, direction)) {
326
270
  var height = (0, _domLib.getHeight)(item);
@@ -333,7 +277,6 @@ var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props)
333
277
  var willOverflow = index + 2 > items.length;
334
278
  var nextIndex = willOverflow ? 0 : index + 1;
335
279
  var focusItem = items[nextIndex];
336
-
337
280
  if (!(0, _isUndefined.default)(focusItem)) {
338
281
  setFocusItemValue(focusItem[valueKey]);
339
282
  callback === null || callback === void 0 ? void 0 : callback(focusItem[valueKey], event);
@@ -346,7 +289,6 @@ var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props)
346
289
  var willOverflow = index === 0;
347
290
  var nextIndex = willOverflow ? items.length - 1 : index - 1;
348
291
  var focusItem = items[nextIndex];
349
-
350
292
  if (!(0, _isUndefined.default)(focusItem)) {
351
293
  setFocusItemValue(focusItem[valueKey]);
352
294
  callback === null || callback === void 0 ? void 0 : callback(focusItem[valueKey], event);
@@ -357,23 +299,18 @@ var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props)
357
299
  var getSubMenuKeys = (0, _react.useCallback)(function (nextLayer) {
358
300
  var menu = (0, _isFunction.default)(target) ? target() : target;
359
301
  var subMenu = menu === null || menu === void 0 ? void 0 : menu.querySelector("[data-layer=\"" + nextLayer + "\"]");
360
-
361
302
  if (subMenu) {
362
303
  var _Array$from;
363
-
364
304
  return (_Array$from = Array.from(subMenu.querySelectorAll(focusableQueryKey))) === null || _Array$from === void 0 ? void 0 : _Array$from.map(function (item) {
365
305
  var _item$dataset3;
366
-
367
306
  return (_item$dataset3 = item.dataset) === null || _item$dataset3 === void 0 ? void 0 : _item$dataset3.key;
368
307
  });
369
308
  }
370
-
371
309
  return null;
372
310
  }, [focusableQueryKey, target]);
373
311
  var focusNextLevelMenu = (0, _react.useCallback)(function (event) {
374
312
  var nextLayer = layer + 1;
375
313
  var nextKeys = getSubMenuKeys(nextLayer);
376
-
377
314
  if (nextKeys) {
378
315
  setKeys(nextKeys);
379
316
  setLayer(nextLayer);
@@ -384,17 +321,14 @@ var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props)
384
321
  var focusPrevLevelMenu = (0, _react.useCallback)(function (event) {
385
322
  var nextLayer = layer - 1;
386
323
  var nextKeys = getSubMenuKeys(nextLayer);
387
-
388
324
  if (nextKeys) {
389
325
  var _getParent;
390
-
391
326
  setKeys(nextKeys);
392
327
  setLayer(nextLayer);
393
328
  var focusItem = (0, _treeUtils.findNodeOfTree)(data, function (item) {
394
329
  return item[valueKey] === focusItemValue;
395
330
  });
396
331
  var parentItemValue = (_getParent = getParent(focusItem)) === null || _getParent === void 0 ? void 0 : _getParent[valueKey];
397
-
398
332
  if (parentItemValue) {
399
333
  setFocusItemValue(parentItemValue);
400
334
  callback === null || callback === void 0 ? void 0 : callback(parentItemValue, event);
@@ -403,7 +337,6 @@ var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props)
403
337
  }, [callback, data, focusItemValue, getParent, getSubMenuKeys, layer, valueKey]);
404
338
  var handleKeyDown = (0, _react.useCallback)(function (event) {
405
339
  var _onMenuKeyDown;
406
-
407
340
  onMenuKeyDown(event, (_onMenuKeyDown = {
408
341
  down: focusNextMenuItem,
409
342
  up: focusPrevMenuItem
@@ -419,39 +352,35 @@ var useFocusItemValue = function useFocusItemValue(defaultFocusItemValue, props)
419
352
  onKeyDown: handleKeyDown
420
353
  };
421
354
  };
422
-
423
355
  exports.useFocusItemValue = useFocusItemValue;
424
-
425
356
  /**
426
357
  * A hook to control the toggle keyboard operation
427
358
  * @param props
428
359
  */
429
360
  var useToggleKeyDownEvent = function useToggleKeyDownEvent(props) {
430
361
  var _props$toggle = props.toggle,
431
- toggle = _props$toggle === void 0 ? true : _props$toggle,
432
- triggerRef = props.triggerRef,
433
- targetRef = props.targetRef,
434
- overlayRef = props.overlayRef,
435
- searchInputRef = props.searchInputRef,
436
- active = props.active,
437
- readOnly = props.readOnly,
438
- disabled = props.disabled,
439
- onExit = props.onExit,
440
- onOpen = props.onOpen,
441
- onClose = props.onClose,
442
- onKeyDown = props.onKeyDown,
443
- onMenuKeyDown = props.onMenuKeyDown,
444
- onMenuPressEnter = props.onMenuPressEnter,
445
- onMenuPressBackspace = props.onMenuPressBackspace;
362
+ toggle = _props$toggle === void 0 ? true : _props$toggle,
363
+ triggerRef = props.triggerRef,
364
+ targetRef = props.targetRef,
365
+ overlayRef = props.overlayRef,
366
+ searchInputRef = props.searchInputRef,
367
+ active = props.active,
368
+ readOnly = props.readOnly,
369
+ disabled = props.disabled,
370
+ onExit = props.onExit,
371
+ onOpen = props.onOpen,
372
+ onClose = props.onClose,
373
+ onKeyDown = props.onKeyDown,
374
+ onMenuKeyDown = props.onMenuKeyDown,
375
+ onMenuPressEnter = props.onMenuPressEnter,
376
+ onMenuPressBackspace = props.onMenuPressBackspace;
446
377
  var handleClose = (0, _react.useCallback)(function () {
447
378
  var _triggerRef$current, _triggerRef$current$c;
448
-
449
379
  (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : (_triggerRef$current$c = _triggerRef$current.close) === null || _triggerRef$current$c === void 0 ? void 0 : _triggerRef$current$c.call(_triggerRef$current);
450
380
  onClose === null || onClose === void 0 ? void 0 : onClose();
451
381
  }, [onClose, triggerRef]);
452
382
  var handleOpen = (0, _react.useCallback)(function () {
453
383
  var _triggerRef$current2, _triggerRef$current2$;
454
-
455
384
  (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : (_triggerRef$current2$ = _triggerRef$current2.open) === null || _triggerRef$current2$ === void 0 ? void 0 : _triggerRef$current2$.call(_triggerRef$current2);
456
385
  onOpen === null || onOpen === void 0 ? void 0 : onOpen();
457
386
  }, [onOpen, triggerRef]);
@@ -460,7 +389,6 @@ var useToggleKeyDownEvent = function useToggleKeyDownEvent(props) {
460
389
  handleClose();
461
390
  return;
462
391
  }
463
-
464
392
  handleOpen();
465
393
  }, [active, handleOpen, handleClose]);
466
394
  var onToggle = (0, _react.useCallback)(function (event) {
@@ -468,91 +396,77 @@ var useToggleKeyDownEvent = function useToggleKeyDownEvent(props) {
468
396
  if (readOnly || disabled) {
469
397
  return;
470
398
  }
471
-
472
399
  if (event.target === (targetRef === null || targetRef === void 0 ? void 0 : targetRef.current)) {
473
400
  // enter
474
401
  if (toggle && event.key === _utils.KEY_VALUES.ENTER) {
475
402
  handleToggleDropdown();
476
- } // delete
477
-
403
+ }
478
404
 
405
+ // delete
479
406
  if (event.key === _utils.KEY_VALUES.BACKSPACE) {
480
407
  onExit === null || onExit === void 0 ? void 0 : onExit(event);
481
408
  }
482
409
  }
483
-
484
410
  if (overlayRef !== null && overlayRef !== void 0 && overlayRef.current) {
485
411
  // The keyboard operation callback on the menu.
486
412
  onMenuKeyDown === null || onMenuKeyDown === void 0 ? void 0 : onMenuKeyDown(event);
487
-
488
413
  if (event.key === _utils.KEY_VALUES.ENTER) {
489
414
  onMenuPressEnter === null || onMenuPressEnter === void 0 ? void 0 : onMenuPressEnter(event);
490
415
  }
416
+
491
417
  /**
492
418
  * There is no callback when typing the Backspace key in the search box.
493
419
  * The default is to remove search keywords
494
420
  */
495
-
496
-
497
421
  if (event.key === _utils.KEY_VALUES.BACKSPACE && event.target !== (searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current)) {
498
422
  onMenuPressBackspace === null || onMenuPressBackspace === void 0 ? void 0 : onMenuPressBackspace(event);
499
- } // The search box gets focus when typing characters and numbers.
500
-
423
+ }
501
424
 
425
+ // The search box gets focus when typing characters and numbers.
502
426
  if (event.key.length === 1 && /\w/.test(event.key)) {
503
427
  var _event$target;
504
-
505
428
  // Exclude Input
506
429
  // eg: <SelectPicker renderExtraFooter={() => <Input />} />
507
430
  if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.tagName) !== 'INPUT') {
508
431
  var _searchInputRef$curre;
509
-
510
432
  searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
511
433
  }
512
434
  }
513
435
  }
514
-
515
436
  if (event.key === _utils.KEY_VALUES.ESC || event.key === _utils.KEY_VALUES.TAB) {
516
437
  handleClose();
517
- } // Native event callback
518
-
438
+ }
519
439
 
440
+ // Native event callback
520
441
  onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
521
442
  }, [readOnly, disabled, targetRef, overlayRef, onKeyDown, toggle, handleToggleDropdown, onExit, onMenuKeyDown, searchInputRef, onMenuPressEnter, onMenuPressBackspace, handleClose]);
522
443
  return onToggle;
523
444
  };
524
-
525
445
  exports.useToggleKeyDownEvent = useToggleKeyDownEvent;
526
-
527
446
  /**
528
447
  * A hook that handles search filter options
529
448
  */
530
449
  function useSearch(data, props) {
531
450
  var labelKey = props.labelKey,
532
- searchBy = props.searchBy,
533
- callback = props.callback; // Use search keywords to filter options.
534
-
451
+ searchBy = props.searchBy,
452
+ callback = props.callback; // Use search keywords to filter options.
535
453
  var _useState4 = (0, _react.useState)(''),
536
- searchKeyword = _useState4[0],
537
- setSearchKeyword = _useState4[1];
538
-
454
+ searchKeyword = _useState4[0],
455
+ setSearchKeyword = _useState4[1];
539
456
  var resetSearch = (0, _react.useCallback)(function () {
540
457
  setSearchKeyword('');
541
458
  }, []);
459
+
542
460
  /**
543
461
  * Index of keyword in `label`
544
462
  * @param {node} label
545
463
  */
546
-
547
464
  var checkShouldDisplay = (0, _react.useCallback)(function (item, keyword) {
548
465
  var checkValue = typeof item === 'object' ? item === null || item === void 0 ? void 0 : item[labelKey] : String(item);
549
-
550
466
  var _keyword = (0, _isUndefined.default)(keyword) ? searchKeyword : keyword;
551
-
552
467
  if (typeof searchBy === 'function') {
553
468
  return searchBy(_keyword, checkValue, item);
554
469
  }
555
-
556
470
  return shouldDisplay(checkValue, _keyword);
557
471
  }, [labelKey, searchBy, searchKeyword]);
558
472
  var filteredData = (0, _react.useMemo)(function () {
@@ -560,7 +474,6 @@ function useSearch(data, props) {
560
474
  return checkShouldDisplay(item, searchKeyword);
561
475
  });
562
476
  }, [checkShouldDisplay, data, searchKeyword]);
563
-
564
477
  var handleSearch = function handleSearch(searchKeyword, event) {
565
478
  var filteredData = data.filter(function (item) {
566
479
  return checkShouldDisplay(item, searchKeyword);
@@ -568,7 +481,6 @@ function useSearch(data, props) {
568
481
  setSearchKeyword(searchKeyword);
569
482
  callback === null || callback === void 0 ? void 0 : callback(searchKeyword, filteredData, event);
570
483
  };
571
-
572
484
  return {
573
485
  searchKeyword: searchKeyword,
574
486
  filteredData: filteredData,
@@ -577,30 +489,26 @@ function useSearch(data, props) {
577
489
  resetSearch: resetSearch
578
490
  };
579
491
  }
580
-
581
492
  /**
582
493
  * A hook of the exposed method of Picker
583
494
  */
584
495
  function usePublicMethods(ref, parmas) {
585
496
  var triggerRef = parmas.triggerRef,
586
- overlayRef = parmas.overlayRef,
587
- targetRef = parmas.targetRef,
588
- rootRef = parmas.rootRef,
589
- listRef = parmas.listRef,
590
- inline = parmas.inline;
497
+ overlayRef = parmas.overlayRef,
498
+ targetRef = parmas.targetRef,
499
+ rootRef = parmas.rootRef,
500
+ listRef = parmas.listRef,
501
+ inline = parmas.inline;
591
502
  var handleOpen = (0, _react.useCallback)(function () {
592
503
  var _triggerRef$current3;
593
-
594
504
  triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current3 = triggerRef.current) === null || _triggerRef$current3 === void 0 ? void 0 : _triggerRef$current3.open();
595
505
  }, [triggerRef]);
596
506
  var handleClose = (0, _react.useCallback)(function () {
597
507
  var _triggerRef$current4;
598
-
599
508
  triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current4 = triggerRef.current) === null || _triggerRef$current4 === void 0 ? void 0 : _triggerRef$current4.close();
600
509
  }, [triggerRef]);
601
510
  var handleUpdatePosition = (0, _react.useCallback)(function () {
602
511
  var _triggerRef$current5;
603
-
604
512
  triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current5 = triggerRef.current) === null || _triggerRef$current5 === void 0 ? void 0 : _triggerRef$current5.updatePosition();
605
513
  }, [triggerRef]);
606
514
  (0, _react.useImperativeHandle)(ref, function () {
@@ -609,52 +517,38 @@ function usePublicMethods(ref, parmas) {
609
517
  return {
610
518
  get root() {
611
519
  var _triggerRef$current$r, _triggerRef$current6;
612
-
613
520
  return rootRef !== null && rootRef !== void 0 && rootRef.current ? rootRef === null || rootRef === void 0 ? void 0 : rootRef.current : (_triggerRef$current$r = triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current6 = triggerRef.current) === null || _triggerRef$current6 === void 0 ? void 0 : _triggerRef$current6.root) !== null && _triggerRef$current$r !== void 0 ? _triggerRef$current$r : null;
614
521
  },
615
-
616
522
  get list() {
617
523
  if (!(listRef !== null && listRef !== void 0 && listRef.current)) {
618
524
  throw new Error('The list is not found, please set `virtualized` for the component.');
619
525
  }
620
-
621
526
  return listRef === null || listRef === void 0 ? void 0 : listRef.current;
622
527
  }
623
-
624
528
  };
625
529
  }
626
-
627
530
  return {
628
531
  get root() {
629
532
  var _ref, _triggerRef$current7;
630
-
631
533
  return (_ref = (rootRef === null || rootRef === void 0 ? void 0 : rootRef.current) || (triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current7 = triggerRef.current) === null || _triggerRef$current7 === void 0 ? void 0 : _triggerRef$current7.root)) !== null && _ref !== void 0 ? _ref : null;
632
534
  },
633
-
634
535
  get overlay() {
635
536
  var _overlayRef$current;
636
-
637
537
  if (!(overlayRef !== null && overlayRef !== void 0 && overlayRef.current)) {
638
538
  throw new Error('The overlay is not found. Please confirm whether the picker is open.');
639
539
  }
640
-
641
540
  return (_overlayRef$current = overlayRef === null || overlayRef === void 0 ? void 0 : overlayRef.current) !== null && _overlayRef$current !== void 0 ? _overlayRef$current : null;
642
541
  },
643
-
644
542
  get target() {
645
543
  var _targetRef$current;
646
-
647
544
  return (_targetRef$current = targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) !== null && _targetRef$current !== void 0 ? _targetRef$current : null;
648
545
  },
649
-
650
546
  get list() {
651
547
  if (!(listRef !== null && listRef !== void 0 && listRef.current)) {
652
548
  throw new Error("\n The list is not found.\n 1.Please set virtualized for the component.\n 2.Please confirm whether the picker is open.\n ");
653
549
  }
654
-
655
550
  return listRef === null || listRef === void 0 ? void 0 : listRef.current;
656
551
  },
657
-
658
552
  updatePosition: handleUpdatePosition,
659
553
  open: handleOpen,
660
554
  close: handleClose