rsuite 6.1.2 → 6.1.3

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 (631) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/cjs/Affix/Affix.js +4 -4
  3. package/cjs/Animation/Collapse.js +4 -5
  4. package/cjs/Animation/Transition.d.ts +2 -2
  5. package/cjs/Animation/Transition.js +17 -20
  6. package/cjs/AutoComplete/AutoComplete.js +9 -9
  7. package/cjs/Avatar/useImage.js +1 -1
  8. package/cjs/AvatarGroup/AvatarGroup.d.ts +2 -2
  9. package/cjs/Badge/Badge.js +1 -4
  10. package/cjs/Breadcrumb/Breadcrumb.js +4 -4
  11. package/cjs/Button/Button.js +6 -6
  12. package/cjs/Calendar/Calendar.js +5 -5
  13. package/cjs/Calendar/CalendarBody.js +1 -1
  14. package/cjs/Calendar/CalendarContainer.js +14 -33
  15. package/cjs/Calendar/CalendarHeader.js +7 -8
  16. package/cjs/Calendar/Grid/GridCell.js +2 -2
  17. package/cjs/Calendar/Grid/GridHeaderRow.js +1 -1
  18. package/cjs/Calendar/Grid/GridRow.js +5 -6
  19. package/cjs/Calendar/MonthDropdown/MonthDropdown.js +1 -1
  20. package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
  21. package/cjs/Calendar/TimeDropdown/TimeDropdown.js +12 -14
  22. package/cjs/Calendar/hooks/useCalendar.d.ts +16 -17
  23. package/cjs/Calendar/hooks/useCalendar.js +2 -4
  24. package/cjs/Calendar/hooks/useCalendarDate.js +5 -9
  25. package/cjs/Calendar/hooks/useCalendarState.js +6 -12
  26. package/cjs/Calendar/types.d.ts +0 -1
  27. package/cjs/Carousel/Carousel.js +5 -6
  28. package/cjs/CascadeTree/CascadeTree.js +6 -16
  29. package/cjs/CascadeTree/TreeView.js +5 -7
  30. package/cjs/CascadeTree/hooks/useSearch.d.ts +0 -1
  31. package/cjs/CascadeTree/hooks/useSearch.js +1 -1
  32. package/cjs/CascadeTree/hooks/useSelect.d.ts +0 -1
  33. package/cjs/CascadeTree/hooks/useSelect.js +3 -4
  34. package/cjs/CascadeTree/types.d.ts +0 -1
  35. package/cjs/CascadeTree/utils.js +1 -2
  36. package/cjs/Cascader/Cascader.js +18 -29
  37. package/cjs/Cascader/useActive.d.ts +0 -1
  38. package/cjs/Cascader/useActive.js +4 -6
  39. package/cjs/CheckPicker/CheckPicker.js +14 -15
  40. package/cjs/CheckTree/CheckTree.js +1 -1
  41. package/cjs/CheckTree/CheckTreeNode.js +3 -4
  42. package/cjs/CheckTree/CheckTreeView.js +5 -5
  43. package/cjs/CheckTree/hooks/useTreeCheckState.js +2 -2
  44. package/cjs/CheckTree/utils.js +7 -16
  45. package/cjs/CheckTreePicker/CheckTreePicker.js +7 -7
  46. package/cjs/CheckTreePicker/hooks/useFocusState.d.ts +0 -1
  47. package/cjs/CheckTreePicker/hooks/useFocusState.js +3 -6
  48. package/cjs/Checkbox/Checkbox.js +4 -5
  49. package/cjs/Checkbox/hooks/useIndeterminateCheckbox.d.ts +0 -1
  50. package/cjs/Checkbox/hooks/useIndeterminateCheckbox.js +1 -1
  51. package/cjs/CheckboxGroup/CheckboxGroup.js +2 -2
  52. package/cjs/DOMHelper/index.d.ts +1 -2
  53. package/cjs/DOMHelper/isElement.js +1 -1
  54. package/cjs/DateInput/DateField.d.ts +122 -3
  55. package/cjs/DateInput/DateField.js +12 -15
  56. package/cjs/DateInput/DateInput.js +3 -4
  57. package/cjs/DateInput/hooks/useDateInputState.d.ts +124 -4
  58. package/cjs/DateInput/hooks/useDateInputState.js +2 -2
  59. package/cjs/DateInput/hooks/useIsFocused.js +2 -2
  60. package/cjs/DateInput/hooks/useKeyboardInputEvent.d.ts +0 -1
  61. package/cjs/DateInput/hooks/useKeyboardInputEvent.js +8 -9
  62. package/cjs/DateInput/hooks/useSelectedState.d.ts +0 -1
  63. package/cjs/DateInput/utils.d.ts +0 -1
  64. package/cjs/DateInput/utils.js +2 -3
  65. package/cjs/DatePicker/DatePicker.js +18 -25
  66. package/cjs/DatePicker/PredefinedRanges.js +3 -3
  67. package/cjs/DatePicker/Toolbar.js +4 -4
  68. package/cjs/DatePicker/hooks/useCustomizedInput.d.ts +0 -1
  69. package/cjs/DatePicker/hooks/useFocus.js +5 -8
  70. package/cjs/DatePicker/hooks/useMonthView.d.ts +0 -1
  71. package/cjs/DatePicker/hooks/useMonthView.js +1 -1
  72. package/cjs/DatePicker/utils.d.ts +1 -2
  73. package/cjs/DatePicker/utils.js +2 -2
  74. package/cjs/DateRangeInput/DateRangeInput.js +8 -9
  75. package/cjs/DateRangePicker/Calendar.js +2 -2
  76. package/cjs/DateRangePicker/DateRangePicker.js +25 -29
  77. package/cjs/DateRangePicker/Header.js +3 -3
  78. package/cjs/DateRangePicker/disabledDateUtils.js +2 -2
  79. package/cjs/DateRangePicker/hooks/useCalendarHandlers.d.ts +0 -1
  80. package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
  81. package/cjs/DateRangePicker/utils.js +1 -2
  82. package/cjs/Dropdown/Dropdown.js +3 -3
  83. package/cjs/Dropdown/DropdownItem.js +4 -5
  84. package/cjs/Dropdown/DropdownMenu.d.ts +1 -1
  85. package/cjs/Dropdown/DropdownMenu.js +1 -1
  86. package/cjs/Form/Form.d.ts +1 -3
  87. package/cjs/Form/Form.js +9 -11
  88. package/cjs/Form/hooks/useFormRef.d.ts +0 -1
  89. package/cjs/Form/hooks/useFormValidate.d.ts +0 -1
  90. package/cjs/Form/hooks/useFormValidate.js +19 -19
  91. package/cjs/Form/hooks/useFormValue.d.ts +0 -1
  92. package/cjs/FormControl/FormControl.js +5 -5
  93. package/cjs/FormGroup/FormGroupContext.d.ts +1 -1
  94. package/cjs/Highlight/utils/highlightText.js +1 -1
  95. package/cjs/InlineEdit/renderChildren.js +5 -6
  96. package/cjs/InlineEdit/useEditState.js +9 -12
  97. package/cjs/InlineEdit/useFocusEvent.d.ts +0 -1
  98. package/cjs/InlineEdit/useFocusEvent.js +7 -11
  99. package/cjs/Input/Input.js +1 -1
  100. package/cjs/InputGroup/InputGroupContext.d.ts +2 -1
  101. package/cjs/InputNumber/index.d.ts +0 -1
  102. package/cjs/InputPicker/InputAutosize.js +1 -1
  103. package/cjs/InputPicker/InputPicker.js +30 -35
  104. package/cjs/InputPicker/InputSearch.js +1 -2
  105. package/cjs/InputPicker/hooks/useData.d.ts +0 -1
  106. package/cjs/InputPicker/hooks/useData.js +1 -1
  107. package/cjs/InputPicker/hooks/useInput.js +3 -6
  108. package/cjs/InputPicker/hooks/useMaxWidth.js +2 -4
  109. package/cjs/List/helper/AutoScroller.js +2 -4
  110. package/cjs/List/helper/useSortHelper.d.ts +4 -4
  111. package/cjs/List/helper/useSortHelper.js +13 -19
  112. package/cjs/MaskedInput/TextMask.d.ts +5 -5
  113. package/cjs/MaskedInput/TextMask.js +3 -5
  114. package/cjs/MaskedInput/conformToMask.d.ts +1 -1
  115. package/cjs/MaskedInput/createTextMaskInputElement.js +2 -3
  116. package/cjs/Menu/MenuItem.js +3 -4
  117. package/cjs/Message/Message.js +1 -1
  118. package/cjs/Modal/Modal.js +8 -10
  119. package/cjs/Modal/ModalBody.js +1 -1
  120. package/cjs/Modal/utils.d.ts +2 -3
  121. package/cjs/Modal/utils.js +2 -3
  122. package/cjs/MultiCascadeTree/SearchView.js +1 -1
  123. package/cjs/MultiCascadeTree/TreeView.js +2 -2
  124. package/cjs/MultiCascadeTree/hooks/useCascadeValue.d.ts +0 -1
  125. package/cjs/MultiCascadeTree/hooks/useCascadeValue.js +5 -8
  126. package/cjs/MultiCascadeTree/hooks/useColumnData.d.ts +0 -1
  127. package/cjs/MultiCascadeTree/hooks/useSearch.d.ts +0 -1
  128. package/cjs/MultiCascadeTree/hooks/useSearch.js +2 -2
  129. package/cjs/MultiCascadeTree/hooks/useSelect.js +3 -4
  130. package/cjs/MultiCascadeTree/types.d.ts +0 -1
  131. package/cjs/MultiCascadeTree/utils.d.ts +4 -4
  132. package/cjs/MultiCascadeTree/utils.js +2 -3
  133. package/cjs/MultiCascader/MultiCascader.js +13 -16
  134. package/cjs/Nav/AdaptiveNavItem.js +2 -3
  135. package/cjs/Nav/Nav.d.ts +1 -1
  136. package/cjs/Nav/Nav.js +4 -4
  137. package/cjs/Nav/NavDropdown.d.ts +1 -1
  138. package/cjs/Nav/NavDropdown.js +3 -3
  139. package/cjs/Nav/NavDropdownItem.js +2 -2
  140. package/cjs/Nav/NavDropdownMenu.d.ts +1 -1
  141. package/cjs/Nav/NavDropdownMenu.js +1 -1
  142. package/cjs/Nav/NavItem.js +4 -4
  143. package/cjs/Navbar/Navbar.js +1 -1
  144. package/cjs/Navbar/NavbarContent.js +1 -1
  145. package/cjs/Navbar/NavbarDrawer.js +1 -1
  146. package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
  147. package/cjs/Navbar/NavbarDropdown.js +3 -3
  148. package/cjs/Navbar/NavbarDropdownItem.js +5 -6
  149. package/cjs/Navbar/NavbarDropdownMenu.d.ts +1 -1
  150. package/cjs/Navbar/NavbarDropdownMenu.js +1 -1
  151. package/cjs/Navbar/NavbarItem.js +4 -4
  152. package/cjs/Navbar/NavbarToggle.js +2 -2
  153. package/cjs/Notification/Notification.js +1 -1
  154. package/cjs/NumberInput/NumberInput.js +3 -3
  155. package/cjs/NumberInput/hooks/useEvents.d.ts +0 -1
  156. package/cjs/NumberInput/hooks/useEvents.js +2 -3
  157. package/cjs/NumberInput/hooks/useWheelHandler.js +1 -2
  158. package/cjs/Pagination/Pagination.js +1 -1
  159. package/cjs/Pagination/PaginationButton.js +1 -1
  160. package/cjs/Pagination/PaginationGroup.js +3 -4
  161. package/cjs/Panel/Panel.js +2 -2
  162. package/cjs/PanelGroup/PanelGroup.js +1 -1
  163. package/cjs/PasswordInput/PasswordInput.js +2 -2
  164. package/cjs/PinInput/PinInput.js +1 -1
  165. package/cjs/PinInput/hooks/usePinInputRefs.d.ts +0 -1
  166. package/cjs/PinInput/hooks/usePinInputRefs.js +2 -4
  167. package/cjs/PinInput/hooks/usePinValue.d.ts +1 -1
  168. package/cjs/PinInput/hooks/usePinValue.js +2 -2
  169. package/cjs/Progress/ProgressLine.js +1 -1
  170. package/cjs/Progress/types.d.ts +0 -1
  171. package/cjs/ProgressCircle/hooks/useProgressCirclePath.d.ts +0 -1
  172. package/cjs/Radio/Radio.js +3 -3
  173. package/cjs/RadioGroup/RadioGroup.js +1 -1
  174. package/cjs/RadioTile/RadioTile.js +2 -2
  175. package/cjs/RadioTileGroup/RadioTileGroup.js +1 -1
  176. package/cjs/RangeSlider/RangeSlider.js +6 -6
  177. package/cjs/Rate/Character.js +2 -2
  178. package/cjs/Rate/Rate.js +3 -3
  179. package/cjs/Rate/useRatingStates.d.ts +0 -1
  180. package/cjs/SegmentedControl/SegmentedControl.js +3 -3
  181. package/cjs/SegmentedControl/hooks/useIndicatorPosition.js +1 -1
  182. package/cjs/SelectPicker/SelectPicker.js +13 -16
  183. package/cjs/Sidebar/Sidebar.js +1 -1
  184. package/cjs/Sidenav/ExpandedSidenavDropdown.js +6 -6
  185. package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +4 -5
  186. package/cjs/Sidenav/Node.js +9 -16
  187. package/cjs/Sidenav/Sidenav.js +2 -2
  188. package/cjs/Sidenav/SidenavDropdown.d.ts +1 -1
  189. package/cjs/Sidenav/SidenavDropdown.js +4 -4
  190. package/cjs/Sidenav/SidenavDropdownItem.js +3 -4
  191. package/cjs/Sidenav/SidenavItem.js +5 -6
  192. package/cjs/Sidenav/SidenavToggle.js +2 -2
  193. package/cjs/Slider/Slider.js +3 -3
  194. package/cjs/Slider/useDrag.d.ts +0 -1
  195. package/cjs/Slider/useDrag.js +7 -12
  196. package/cjs/Slider/utils.d.ts +1 -2
  197. package/cjs/Slider/utils.js +2 -3
  198. package/cjs/Steps/StepItem.js +1 -2
  199. package/cjs/Table/Table.d.ts +3 -3
  200. package/cjs/Tabs/Tabs.js +3 -4
  201. package/cjs/TimePicker/TimePicker.js +2 -2
  202. package/cjs/Timeline/Timeline.d.ts +1 -1
  203. package/cjs/Timeline/Timeline.js +1 -4
  204. package/cjs/Toggle/Toggle.js +2 -2
  205. package/cjs/Tree/Tree.js +2 -2
  206. package/cjs/Tree/TreeNode.js +10 -11
  207. package/cjs/Tree/TreeView.js +5 -5
  208. package/cjs/Tree/hooks/useExpandTree.js +1 -1
  209. package/cjs/Tree/hooks/useFlattenTree.js +1 -1
  210. package/cjs/Tree/hooks/useFocusTree.d.ts +1 -2
  211. package/cjs/Tree/hooks/useFocusTree.js +12 -14
  212. package/cjs/Tree/hooks/useTreeDrag.d.ts +0 -1
  213. package/cjs/Tree/hooks/useTreeDrag.js +10 -12
  214. package/cjs/Tree/hooks/useTreeNodeProps.js +1 -1
  215. package/cjs/Tree/hooks/useTreeSearch.js +4 -4
  216. package/cjs/Tree/hooks/useVirtualizedTreeData.js +2 -2
  217. package/cjs/Tree/types.d.ts +2 -3
  218. package/cjs/Tree/utils/flattenTree.d.ts +1 -1
  219. package/cjs/Tree/utils/focusableTree.js +5 -8
  220. package/cjs/Tree/utils/getNodeParentKeys.js +2 -4
  221. package/cjs/Tree/utils/hasVisibleChildren.d.ts +1 -1
  222. package/cjs/Tree/utils/treeKeyboardInteractions.js +3 -3
  223. package/cjs/TreePicker/TreePicker.js +8 -9
  224. package/cjs/TreePicker/hooks/useFocusState.d.ts +0 -1
  225. package/cjs/TreePicker/hooks/useFocusState.js +4 -8
  226. package/cjs/Uploader/UploadFileItem.js +8 -10
  227. package/cjs/Uploader/UploadTrigger.js +8 -10
  228. package/cjs/Uploader/Uploader.js +18 -24
  229. package/cjs/Uploader/utils/ajaxUpload.js +5 -5
  230. package/cjs/Uploader/utils/previewFile.js +1 -1
  231. package/cjs/internals/Disclosure/Disclosure.js +5 -8
  232. package/cjs/internals/Disclosure/DisclosureButton.js +2 -2
  233. package/cjs/internals/InputBase/InputBase.js +5 -6
  234. package/cjs/internals/Menu/Menu.js +16 -20
  235. package/cjs/internals/Menu/MenuItem.js +4 -5
  236. package/cjs/internals/Menu/Menubar.js +5 -7
  237. package/cjs/internals/Menu/useMenu.js +5 -10
  238. package/cjs/internals/Overlay/Modal.js +8 -11
  239. package/cjs/internals/Overlay/ModalManager.js +3 -5
  240. package/cjs/internals/Overlay/Overlay.js +1 -1
  241. package/cjs/internals/Overlay/OverlayTrigger.d.ts +0 -1
  242. package/cjs/internals/Overlay/OverlayTrigger.js +5 -7
  243. package/cjs/internals/Overlay/Position.js +6 -8
  244. package/cjs/internals/Picker/ListCheckItem.js +3 -3
  245. package/cjs/internals/Picker/ListItem.js +1 -1
  246. package/cjs/internals/Picker/Listbox.js +9 -10
  247. package/cjs/internals/Picker/PickerPopup.js +4 -5
  248. package/cjs/internals/Picker/PickerToggle.js +3 -4
  249. package/cjs/internals/Picker/SelectedElement.js +1 -1
  250. package/cjs/internals/Picker/hooks/useFocusItemValue.d.ts +0 -1
  251. package/cjs/internals/Picker/hooks/useFocusItemValue.js +14 -28
  252. package/cjs/internals/Picker/hooks/usePickerRef.d.ts +0 -1
  253. package/cjs/internals/Picker/hooks/usePickerRef.js +9 -15
  254. package/cjs/internals/Picker/hooks/useSearch.d.ts +0 -1
  255. package/cjs/internals/Picker/hooks/useSearch.js +2 -2
  256. package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.d.ts +0 -1
  257. package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.js +13 -17
  258. package/cjs/internals/Picker/utils.js +9 -9
  259. package/cjs/internals/Ripple/Ripple.js +3 -4
  260. package/cjs/internals/SafeAnchor/SafeAnchor.js +1 -1
  261. package/cjs/internals/ScrollView/hooks/useScrollState.d.ts +0 -1
  262. package/cjs/internals/ScrollView/hooks/useScrollState.js +2 -3
  263. package/cjs/internals/Tree/TreeProvider.d.ts +4 -4
  264. package/cjs/internals/Tree/TreeProvider.js +2 -8
  265. package/cjs/internals/Tree/types.d.ts +0 -1
  266. package/cjs/internals/Tree/utils/getParentMap.d.ts +0 -1
  267. package/cjs/internals/Windowing/AutoSizer.js +2 -3
  268. package/cjs/internals/Windowing/List.js +4 -8
  269. package/cjs/internals/constants/index.d.ts +2 -2
  270. package/cjs/internals/hooks/useClickOutside.js +2 -4
  271. package/cjs/internals/hooks/useCustom.d.ts +0 -1
  272. package/cjs/internals/hooks/useCustom.js +5 -7
  273. package/cjs/internals/hooks/useElementResize.d.ts +0 -1
  274. package/cjs/internals/hooks/useEventCallback.js +1 -2
  275. package/cjs/internals/hooks/useEventListener.js +1 -1
  276. package/cjs/internals/hooks/useFocus.js +2 -4
  277. package/cjs/internals/hooks/useFocusVirtualListItem.d.ts +0 -1
  278. package/cjs/internals/hooks/useMount.js +1 -2
  279. package/cjs/internals/hooks/useRootClose.js +6 -6
  280. package/cjs/internals/hooks/useTimeout.js +1 -2
  281. package/cjs/internals/hooks/useToggleCaret.d.ts +0 -1
  282. package/cjs/internals/hooks/useUniqueId.js +1 -1
  283. package/cjs/internals/hooks/useUpdatedRef.d.ts +0 -1
  284. package/cjs/internals/styled-system/style-manager.js +1 -1
  285. package/cjs/internals/styled-system/useStyled.js +2 -2
  286. package/cjs/internals/types/utils.d.ts +0 -1
  287. package/cjs/internals/utils/colours.d.ts +4 -4
  288. package/cjs/internals/utils/colours.js +1 -1
  289. package/cjs/internals/utils/date/disableTime.js +6 -12
  290. package/cjs/internals/utils/date/omitHideDisabledProps.d.ts +1 -1
  291. package/cjs/internals/utils/date/useDateMode.d.ts +1 -1
  292. package/cjs/internals/utils/react/ReactChildren.js +1 -2
  293. package/cjs/internals/utils/react/deprecateComponent.js +1 -2
  294. package/cjs/internals/utils/react/getDOMNode.js +4 -5
  295. package/cjs/internals/utils/sizes.d.ts +2 -2
  296. package/cjs/internals/utils/style-sheet/css.d.ts +0 -1
  297. package/cjs/internals/utils/style-sheet/css.js +1 -1
  298. package/cjs/internals/utils/style-sheet/prefix.d.ts +0 -1
  299. package/cjs/internals/utils/style-sheet/responsive.d.ts +1 -1
  300. package/cjs/internals/utils/style-sheet/styles.d.ts +3 -3
  301. package/cjs/internals/utils/style-sheet/styles.js +1 -1
  302. package/cjs/toaster/ToastContainer.js +3 -5
  303. package/cjs/toaster/hooks/useDelayedClosure.d.ts +0 -1
  304. package/cjs/toaster/hooks/useDelayedClosure.js +3 -4
  305. package/cjs/toaster/toaster.js +4 -12
  306. package/cjs/useDialog/Dialog.d.ts +1 -1
  307. package/cjs/useDialog/Dialog.js +1 -1
  308. package/cjs/useDialog/useDialog.d.ts +1 -1
  309. package/cjs/useDialog/useDialog.js +3 -3
  310. package/cjs/useFormControl/hooks/useField.d.ts +0 -1
  311. package/cjs/useFormControl/hooks/useField.js +5 -7
  312. package/cjs/useFormControl/hooks/useRegisterModel.js +2 -2
  313. package/cjs/useFormControl/useFormControl.js +8 -8
  314. package/cjs/useToaster/useToaster.js +4 -5
  315. package/dist/rsuite.js +223 -223
  316. package/dist/rsuite.min.js +1 -1
  317. package/dist/rsuite.min.js.map +1 -1
  318. package/esm/Affix/Affix.js +4 -4
  319. package/esm/Animation/Collapse.js +1 -2
  320. package/esm/Animation/Transition.d.ts +2 -2
  321. package/esm/Animation/Transition.js +17 -20
  322. package/esm/AutoComplete/AutoComplete.js +9 -9
  323. package/esm/Avatar/useImage.js +1 -1
  324. package/esm/AvatarGroup/AvatarGroup.d.ts +2 -2
  325. package/esm/Badge/Badge.js +1 -4
  326. package/esm/Breadcrumb/Breadcrumb.js +4 -4
  327. package/esm/Button/Button.js +6 -6
  328. package/esm/Calendar/Calendar.js +5 -5
  329. package/esm/Calendar/CalendarBody.js +1 -1
  330. package/esm/Calendar/CalendarContainer.js +14 -33
  331. package/esm/Calendar/CalendarHeader.js +7 -8
  332. package/esm/Calendar/Grid/GridCell.js +2 -2
  333. package/esm/Calendar/Grid/GridHeaderRow.js +1 -1
  334. package/esm/Calendar/Grid/GridRow.js +5 -6
  335. package/esm/Calendar/MonthDropdown/MonthDropdown.js +1 -1
  336. package/esm/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
  337. package/esm/Calendar/TimeDropdown/TimeDropdown.js +12 -14
  338. package/esm/Calendar/hooks/useCalendar.d.ts +16 -17
  339. package/esm/Calendar/hooks/useCalendar.js +2 -4
  340. package/esm/Calendar/hooks/useCalendarDate.js +5 -9
  341. package/esm/Calendar/hooks/useCalendarState.js +6 -12
  342. package/esm/Calendar/types.d.ts +0 -1
  343. package/esm/Carousel/Carousel.js +5 -6
  344. package/esm/CascadeTree/CascadeTree.js +6 -16
  345. package/esm/CascadeTree/TreeView.js +5 -7
  346. package/esm/CascadeTree/hooks/useSearch.d.ts +0 -1
  347. package/esm/CascadeTree/hooks/useSearch.js +1 -1
  348. package/esm/CascadeTree/hooks/useSelect.d.ts +0 -1
  349. package/esm/CascadeTree/hooks/useSelect.js +3 -4
  350. package/esm/CascadeTree/types.d.ts +0 -1
  351. package/esm/CascadeTree/utils.js +1 -2
  352. package/esm/Cascader/Cascader.js +18 -29
  353. package/esm/Cascader/useActive.d.ts +0 -1
  354. package/esm/Cascader/useActive.js +4 -6
  355. package/esm/CheckPicker/CheckPicker.js +14 -15
  356. package/esm/CheckTree/CheckTree.js +1 -1
  357. package/esm/CheckTree/CheckTreeNode.js +3 -4
  358. package/esm/CheckTree/CheckTreeView.js +5 -5
  359. package/esm/CheckTree/hooks/useTreeCheckState.js +2 -2
  360. package/esm/CheckTree/utils.js +7 -16
  361. package/esm/CheckTreePicker/CheckTreePicker.js +7 -7
  362. package/esm/CheckTreePicker/hooks/useFocusState.d.ts +0 -1
  363. package/esm/CheckTreePicker/hooks/useFocusState.js +3 -6
  364. package/esm/Checkbox/Checkbox.js +4 -5
  365. package/esm/Checkbox/hooks/useIndeterminateCheckbox.d.ts +0 -1
  366. package/esm/Checkbox/hooks/useIndeterminateCheckbox.js +1 -1
  367. package/esm/CheckboxGroup/CheckboxGroup.js +2 -2
  368. package/esm/DOMHelper/index.d.ts +1 -2
  369. package/esm/DOMHelper/isElement.js +1 -1
  370. package/esm/DateInput/DateField.d.ts +122 -3
  371. package/esm/DateInput/DateField.js +12 -15
  372. package/esm/DateInput/DateInput.js +3 -4
  373. package/esm/DateInput/hooks/useDateInputState.d.ts +124 -4
  374. package/esm/DateInput/hooks/useDateInputState.js +2 -2
  375. package/esm/DateInput/hooks/useIsFocused.js +2 -2
  376. package/esm/DateInput/hooks/useKeyboardInputEvent.d.ts +0 -1
  377. package/esm/DateInput/hooks/useKeyboardInputEvent.js +8 -9
  378. package/esm/DateInput/hooks/useSelectedState.d.ts +0 -1
  379. package/esm/DateInput/utils.d.ts +0 -1
  380. package/esm/DateInput/utils.js +2 -3
  381. package/esm/DatePicker/DatePicker.js +18 -25
  382. package/esm/DatePicker/PredefinedRanges.js +3 -3
  383. package/esm/DatePicker/Toolbar.js +4 -4
  384. package/esm/DatePicker/hooks/useCustomizedInput.d.ts +0 -1
  385. package/esm/DatePicker/hooks/useFocus.js +5 -8
  386. package/esm/DatePicker/hooks/useMonthView.d.ts +0 -1
  387. package/esm/DatePicker/hooks/useMonthView.js +1 -1
  388. package/esm/DatePicker/utils.d.ts +1 -2
  389. package/esm/DatePicker/utils.js +2 -2
  390. package/esm/DateRangeInput/DateRangeInput.js +8 -9
  391. package/esm/DateRangePicker/Calendar.js +2 -2
  392. package/esm/DateRangePicker/DateRangePicker.js +25 -29
  393. package/esm/DateRangePicker/Header.js +3 -3
  394. package/esm/DateRangePicker/disabledDateUtils.js +2 -2
  395. package/esm/DateRangePicker/hooks/useCalendarHandlers.d.ts +0 -1
  396. package/esm/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
  397. package/esm/DateRangePicker/utils.js +1 -2
  398. package/esm/Dropdown/Dropdown.js +3 -3
  399. package/esm/Dropdown/DropdownItem.js +4 -5
  400. package/esm/Dropdown/DropdownMenu.d.ts +1 -1
  401. package/esm/Dropdown/DropdownMenu.js +1 -1
  402. package/esm/Form/Form.d.ts +1 -3
  403. package/esm/Form/Form.js +9 -11
  404. package/esm/Form/hooks/useFormRef.d.ts +0 -1
  405. package/esm/Form/hooks/useFormValidate.d.ts +0 -1
  406. package/esm/Form/hooks/useFormValidate.js +19 -19
  407. package/esm/Form/hooks/useFormValue.d.ts +0 -1
  408. package/esm/FormControl/FormControl.js +5 -5
  409. package/esm/FormGroup/FormGroupContext.d.ts +1 -1
  410. package/esm/Highlight/utils/highlightText.js +1 -1
  411. package/esm/InlineEdit/renderChildren.js +5 -6
  412. package/esm/InlineEdit/useEditState.js +9 -12
  413. package/esm/InlineEdit/useFocusEvent.d.ts +0 -1
  414. package/esm/InlineEdit/useFocusEvent.js +7 -11
  415. package/esm/Input/Input.js +1 -1
  416. package/esm/InputGroup/InputGroupContext.d.ts +2 -1
  417. package/esm/InputNumber/index.d.ts +0 -1
  418. package/esm/InputPicker/InputAutosize.js +1 -1
  419. package/esm/InputPicker/InputPicker.js +30 -35
  420. package/esm/InputPicker/InputSearch.js +1 -2
  421. package/esm/InputPicker/hooks/useData.d.ts +0 -1
  422. package/esm/InputPicker/hooks/useData.js +1 -1
  423. package/esm/InputPicker/hooks/useInput.js +3 -6
  424. package/esm/InputPicker/hooks/useMaxWidth.js +2 -4
  425. package/esm/List/helper/AutoScroller.js +2 -4
  426. package/esm/List/helper/useSortHelper.d.ts +4 -4
  427. package/esm/List/helper/useSortHelper.js +13 -19
  428. package/esm/MaskedInput/TextMask.d.ts +5 -5
  429. package/esm/MaskedInput/TextMask.js +3 -5
  430. package/esm/MaskedInput/conformToMask.d.ts +1 -1
  431. package/esm/MaskedInput/createTextMaskInputElement.js +2 -3
  432. package/esm/Menu/MenuItem.js +3 -4
  433. package/esm/Message/Message.js +1 -1
  434. package/esm/Modal/Modal.js +8 -10
  435. package/esm/Modal/ModalBody.js +1 -1
  436. package/esm/Modal/utils.d.ts +2 -3
  437. package/esm/Modal/utils.js +2 -3
  438. package/esm/MultiCascadeTree/SearchView.js +1 -1
  439. package/esm/MultiCascadeTree/TreeView.js +2 -2
  440. package/esm/MultiCascadeTree/hooks/useCascadeValue.d.ts +0 -1
  441. package/esm/MultiCascadeTree/hooks/useCascadeValue.js +5 -8
  442. package/esm/MultiCascadeTree/hooks/useColumnData.d.ts +0 -1
  443. package/esm/MultiCascadeTree/hooks/useSearch.d.ts +0 -1
  444. package/esm/MultiCascadeTree/hooks/useSearch.js +2 -2
  445. package/esm/MultiCascadeTree/hooks/useSelect.js +3 -4
  446. package/esm/MultiCascadeTree/types.d.ts +0 -1
  447. package/esm/MultiCascadeTree/utils.d.ts +4 -4
  448. package/esm/MultiCascadeTree/utils.js +2 -3
  449. package/esm/MultiCascader/MultiCascader.js +13 -16
  450. package/esm/Nav/AdaptiveNavItem.js +2 -3
  451. package/esm/Nav/Nav.d.ts +1 -1
  452. package/esm/Nav/Nav.js +4 -4
  453. package/esm/Nav/NavDropdown.d.ts +1 -1
  454. package/esm/Nav/NavDropdown.js +3 -3
  455. package/esm/Nav/NavDropdownItem.js +2 -2
  456. package/esm/Nav/NavDropdownMenu.d.ts +1 -1
  457. package/esm/Nav/NavDropdownMenu.js +1 -1
  458. package/esm/Nav/NavItem.js +4 -4
  459. package/esm/Navbar/Navbar.js +1 -1
  460. package/esm/Navbar/NavbarContent.js +1 -1
  461. package/esm/Navbar/NavbarDrawer.js +1 -1
  462. package/esm/Navbar/NavbarDropdown.d.ts +1 -1
  463. package/esm/Navbar/NavbarDropdown.js +3 -3
  464. package/esm/Navbar/NavbarDropdownItem.js +5 -6
  465. package/esm/Navbar/NavbarDropdownMenu.d.ts +1 -1
  466. package/esm/Navbar/NavbarDropdownMenu.js +1 -1
  467. package/esm/Navbar/NavbarItem.js +4 -4
  468. package/esm/Navbar/NavbarToggle.js +2 -2
  469. package/esm/Notification/Notification.js +1 -1
  470. package/esm/NumberInput/NumberInput.js +3 -3
  471. package/esm/NumberInput/hooks/useEvents.d.ts +0 -1
  472. package/esm/NumberInput/hooks/useEvents.js +2 -3
  473. package/esm/NumberInput/hooks/useWheelHandler.js +1 -2
  474. package/esm/Pagination/Pagination.js +1 -1
  475. package/esm/Pagination/PaginationButton.js +1 -1
  476. package/esm/Pagination/PaginationGroup.js +3 -4
  477. package/esm/Panel/Panel.js +2 -2
  478. package/esm/PanelGroup/PanelGroup.js +1 -1
  479. package/esm/PasswordInput/PasswordInput.js +2 -2
  480. package/esm/PinInput/PinInput.js +1 -1
  481. package/esm/PinInput/hooks/usePinInputRefs.d.ts +0 -1
  482. package/esm/PinInput/hooks/usePinInputRefs.js +2 -4
  483. package/esm/PinInput/hooks/usePinValue.d.ts +1 -1
  484. package/esm/PinInput/hooks/usePinValue.js +2 -2
  485. package/esm/Progress/ProgressLine.js +1 -1
  486. package/esm/Progress/types.d.ts +0 -1
  487. package/esm/ProgressCircle/hooks/useProgressCirclePath.d.ts +0 -1
  488. package/esm/Radio/Radio.js +3 -3
  489. package/esm/RadioGroup/RadioGroup.js +1 -1
  490. package/esm/RadioTile/RadioTile.js +2 -2
  491. package/esm/RadioTileGroup/RadioTileGroup.js +1 -1
  492. package/esm/RangeSlider/RangeSlider.js +6 -6
  493. package/esm/Rate/Character.js +2 -2
  494. package/esm/Rate/Rate.js +3 -3
  495. package/esm/Rate/useRatingStates.d.ts +0 -1
  496. package/esm/SegmentedControl/SegmentedControl.js +3 -3
  497. package/esm/SegmentedControl/hooks/useIndicatorPosition.js +1 -1
  498. package/esm/SelectPicker/SelectPicker.js +13 -16
  499. package/esm/Sidebar/Sidebar.js +1 -1
  500. package/esm/Sidenav/ExpandedSidenavDropdown.js +6 -6
  501. package/esm/Sidenav/ExpandedSidenavDropdownItem.js +4 -5
  502. package/esm/Sidenav/Node.js +9 -16
  503. package/esm/Sidenav/Sidenav.js +2 -2
  504. package/esm/Sidenav/SidenavDropdown.d.ts +1 -1
  505. package/esm/Sidenav/SidenavDropdown.js +4 -4
  506. package/esm/Sidenav/SidenavDropdownItem.js +3 -4
  507. package/esm/Sidenav/SidenavItem.js +5 -6
  508. package/esm/Sidenav/SidenavToggle.js +2 -2
  509. package/esm/Slider/Slider.js +3 -3
  510. package/esm/Slider/useDrag.d.ts +0 -1
  511. package/esm/Slider/useDrag.js +7 -12
  512. package/esm/Slider/utils.d.ts +1 -2
  513. package/esm/Slider/utils.js +2 -3
  514. package/esm/Steps/StepItem.js +1 -2
  515. package/esm/Table/Table.d.ts +3 -3
  516. package/esm/Tabs/Tabs.js +3 -4
  517. package/esm/TimePicker/TimePicker.js +2 -2
  518. package/esm/Timeline/Timeline.d.ts +1 -1
  519. package/esm/Timeline/Timeline.js +1 -4
  520. package/esm/Toggle/Toggle.js +2 -2
  521. package/esm/Tree/Tree.js +2 -2
  522. package/esm/Tree/TreeNode.js +10 -11
  523. package/esm/Tree/TreeView.js +5 -5
  524. package/esm/Tree/hooks/useExpandTree.js +1 -1
  525. package/esm/Tree/hooks/useFlattenTree.js +1 -1
  526. package/esm/Tree/hooks/useFocusTree.d.ts +1 -2
  527. package/esm/Tree/hooks/useFocusTree.js +12 -14
  528. package/esm/Tree/hooks/useTreeDrag.d.ts +0 -1
  529. package/esm/Tree/hooks/useTreeDrag.js +10 -12
  530. package/esm/Tree/hooks/useTreeNodeProps.js +1 -1
  531. package/esm/Tree/hooks/useTreeSearch.js +4 -4
  532. package/esm/Tree/hooks/useVirtualizedTreeData.js +2 -2
  533. package/esm/Tree/types.d.ts +2 -3
  534. package/esm/Tree/utils/flattenTree.d.ts +1 -1
  535. package/esm/Tree/utils/focusableTree.js +5 -8
  536. package/esm/Tree/utils/getNodeParentKeys.js +2 -4
  537. package/esm/Tree/utils/hasVisibleChildren.d.ts +1 -1
  538. package/esm/Tree/utils/treeKeyboardInteractions.js +3 -3
  539. package/esm/TreePicker/TreePicker.js +8 -9
  540. package/esm/TreePicker/hooks/useFocusState.d.ts +0 -1
  541. package/esm/TreePicker/hooks/useFocusState.js +4 -8
  542. package/esm/Uploader/UploadFileItem.js +8 -10
  543. package/esm/Uploader/UploadTrigger.js +8 -10
  544. package/esm/Uploader/Uploader.js +18 -24
  545. package/esm/Uploader/utils/ajaxUpload.js +5 -5
  546. package/esm/Uploader/utils/previewFile.js +1 -1
  547. package/esm/internals/Disclosure/Disclosure.js +5 -8
  548. package/esm/internals/Disclosure/DisclosureButton.js +2 -2
  549. package/esm/internals/InputBase/InputBase.js +5 -6
  550. package/esm/internals/Menu/Menu.js +16 -20
  551. package/esm/internals/Menu/MenuItem.js +4 -5
  552. package/esm/internals/Menu/Menubar.js +5 -7
  553. package/esm/internals/Menu/useMenu.js +5 -10
  554. package/esm/internals/Overlay/Modal.js +8 -11
  555. package/esm/internals/Overlay/ModalManager.js +3 -5
  556. package/esm/internals/Overlay/Overlay.js +1 -1
  557. package/esm/internals/Overlay/OverlayTrigger.d.ts +0 -1
  558. package/esm/internals/Overlay/OverlayTrigger.js +5 -7
  559. package/esm/internals/Overlay/Position.js +6 -8
  560. package/esm/internals/Picker/ListCheckItem.js +3 -3
  561. package/esm/internals/Picker/ListItem.js +1 -1
  562. package/esm/internals/Picker/Listbox.js +9 -10
  563. package/esm/internals/Picker/PickerPopup.js +4 -5
  564. package/esm/internals/Picker/PickerToggle.js +3 -4
  565. package/esm/internals/Picker/SelectedElement.js +1 -1
  566. package/esm/internals/Picker/hooks/useFocusItemValue.d.ts +0 -1
  567. package/esm/internals/Picker/hooks/useFocusItemValue.js +14 -28
  568. package/esm/internals/Picker/hooks/usePickerRef.d.ts +0 -1
  569. package/esm/internals/Picker/hooks/usePickerRef.js +9 -15
  570. package/esm/internals/Picker/hooks/useSearch.d.ts +0 -1
  571. package/esm/internals/Picker/hooks/useSearch.js +2 -2
  572. package/esm/internals/Picker/hooks/useToggleKeyDownEvent.d.ts +0 -1
  573. package/esm/internals/Picker/hooks/useToggleKeyDownEvent.js +13 -17
  574. package/esm/internals/Picker/utils.js +9 -9
  575. package/esm/internals/Ripple/Ripple.js +3 -4
  576. package/esm/internals/SafeAnchor/SafeAnchor.js +1 -1
  577. package/esm/internals/ScrollView/hooks/useScrollState.d.ts +0 -1
  578. package/esm/internals/ScrollView/hooks/useScrollState.js +2 -3
  579. package/esm/internals/Tree/TreeProvider.d.ts +4 -4
  580. package/esm/internals/Tree/TreeProvider.js +2 -8
  581. package/esm/internals/Tree/types.d.ts +0 -1
  582. package/esm/internals/Tree/utils/getParentMap.d.ts +0 -1
  583. package/esm/internals/Windowing/AutoSizer.js +2 -3
  584. package/esm/internals/Windowing/List.js +4 -8
  585. package/esm/internals/constants/index.d.ts +2 -2
  586. package/esm/internals/hooks/useClickOutside.js +2 -4
  587. package/esm/internals/hooks/useCustom.d.ts +0 -1
  588. package/esm/internals/hooks/useCustom.js +5 -7
  589. package/esm/internals/hooks/useElementResize.d.ts +0 -1
  590. package/esm/internals/hooks/useEventCallback.js +1 -2
  591. package/esm/internals/hooks/useEventListener.js +1 -1
  592. package/esm/internals/hooks/useFocus.js +2 -4
  593. package/esm/internals/hooks/useFocusVirtualListItem.d.ts +0 -1
  594. package/esm/internals/hooks/useMount.js +1 -2
  595. package/esm/internals/hooks/useRootClose.js +6 -6
  596. package/esm/internals/hooks/useTimeout.js +1 -2
  597. package/esm/internals/hooks/useToggleCaret.d.ts +0 -1
  598. package/esm/internals/hooks/useUniqueId.js +1 -1
  599. package/esm/internals/hooks/useUpdatedRef.d.ts +0 -1
  600. package/esm/internals/styled-system/style-manager.js +1 -1
  601. package/esm/internals/styled-system/useStyled.js +2 -2
  602. package/esm/internals/types/utils.d.ts +0 -1
  603. package/esm/internals/utils/colours.d.ts +4 -4
  604. package/esm/internals/utils/colours.js +1 -1
  605. package/esm/internals/utils/date/disableTime.js +6 -12
  606. package/esm/internals/utils/date/omitHideDisabledProps.d.ts +1 -1
  607. package/esm/internals/utils/date/useDateMode.d.ts +1 -1
  608. package/esm/internals/utils/react/ReactChildren.js +1 -2
  609. package/esm/internals/utils/react/deprecateComponent.js +1 -2
  610. package/esm/internals/utils/react/getDOMNode.js +4 -5
  611. package/esm/internals/utils/sizes.d.ts +2 -2
  612. package/esm/internals/utils/style-sheet/css.d.ts +0 -1
  613. package/esm/internals/utils/style-sheet/css.js +1 -1
  614. package/esm/internals/utils/style-sheet/prefix.d.ts +0 -1
  615. package/esm/internals/utils/style-sheet/responsive.d.ts +1 -1
  616. package/esm/internals/utils/style-sheet/styles.d.ts +3 -3
  617. package/esm/internals/utils/style-sheet/styles.js +1 -1
  618. package/esm/toaster/ToastContainer.js +3 -5
  619. package/esm/toaster/hooks/useDelayedClosure.d.ts +0 -1
  620. package/esm/toaster/hooks/useDelayedClosure.js +3 -4
  621. package/esm/toaster/toaster.js +4 -12
  622. package/esm/useDialog/Dialog.d.ts +1 -1
  623. package/esm/useDialog/Dialog.js +1 -1
  624. package/esm/useDialog/useDialog.d.ts +1 -1
  625. package/esm/useDialog/useDialog.js +3 -3
  626. package/esm/useFormControl/hooks/useField.d.ts +0 -1
  627. package/esm/useFormControl/hooks/useField.js +5 -7
  628. package/esm/useFormControl/hooks/useRegisterModel.js +2 -2
  629. package/esm/useFormControl/useFormControl.js +8 -8
  630. package/esm/useToaster/useToaster.js +4 -5
  631. package/package.json +1 -1
@@ -24,18 +24,17 @@ const PickerPopup = forwardRef((props, ref) => {
24
24
  } = props;
25
25
  const overlayRef = useRef(null);
26
26
  const handleResize = useEventCallback(() => {
27
- const instance = target === null || target === void 0 ? void 0 : target.current;
27
+ const instance = target?.current;
28
28
  if (instance && placement && resizePlacement.includes(placement)) {
29
- var _instance$updatePosit;
30
- (_instance$updatePosit = instance.updatePosition) === null || _instance$updatePosit === void 0 || _instance$updatePosit.call(instance);
29
+ instance.updatePosition?.();
31
30
  }
32
31
  });
33
32
 
34
33
  // Use useElementResize hook to listen for element size changes
35
34
  useElementResize(useCallback(() => overlayRef.current, []), handleResize);
36
35
  useEffect(() => {
37
- const toggle = target === null || target === void 0 ? void 0 : target.current;
38
- if (autoWidth && toggle !== null && toggle !== void 0 && toggle.root) {
36
+ const toggle = target?.current;
37
+ if (autoWidth && toggle?.root) {
39
38
  // Get the width of the button and set it to the menu to make them consistent
40
39
  const width = getWidth(getDOMNode(toggle.root));
41
40
  if (overlayRef.current) {
@@ -59,13 +59,12 @@ const PickerToggle = forwardRef((props, ref) => {
59
59
  }, [inputValueProp]);
60
60
  const classes = merge(className, withPrefix());
61
61
  const handleClean = useEventCallback(event => {
62
- var _combobox$current;
63
62
  event.stopPropagation();
64
- onClean === null || onClean === void 0 || onClean(event);
65
- (_combobox$current = combobox.current) === null || _combobox$current === void 0 || _combobox$current.focus();
63
+ onClean?.(event);
64
+ combobox.current?.focus();
66
65
  });
67
66
  const ToggleCaret = useToggleCaret(placement);
68
- const Caret = caretAs !== null && caretAs !== void 0 ? caretAs : ToggleCaret;
67
+ const Caret = caretAs ?? ToggleCaret;
69
68
  if (plaintext) {
70
69
  return /*#__PURE__*/React.createElement(Plaintext, {
71
70
  ref: ref,
@@ -36,7 +36,7 @@ const SelectedElement = props => {
36
36
  key: item[valueKey]
37
37
  }, /*#__PURE__*/React.createElement("span", {
38
38
  className: prefix('value-item')
39
- }, item[labelKey], checkAll && locale !== null && locale !== void 0 && locale.checkAll ? ` (${locale.checkAll})` : ''), index === count - 1 ? null : /*#__PURE__*/React.createElement("span", {
39
+ }, item[labelKey], checkAll && locale?.checkAll ? ` (${locale.checkAll})` : ''), index === count - 1 ? null : /*#__PURE__*/React.createElement("span", {
40
40
  className: prefix('value-separator')
41
41
  }, ","));
42
42
  })), countable ? /*#__PURE__*/React.createElement(Badge, {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface FocusItemValueProps<T = unknown> {
3
2
  target: HTMLElement | null | (() => HTMLElement | null);
4
3
  data?: T[];
@@ -25,7 +25,7 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
25
25
  callback,
26
26
  // TODO-Doma This legacy behavior of using `.parent` property should be deprecated
27
27
  // Always explicitly pass `getParent` when there's need to traverse upwards
28
- getParent = item => item === null || item === void 0 ? void 0 : item.parent
28
+ getParent = item => item?.parent
29
29
  } = props;
30
30
  const [focusItemValue, setFocusItemValue] = useState(defaultFocusItemValue);
31
31
  const [layer, setLayer] = useState(defaultLayer);
@@ -33,22 +33,22 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
33
33
  const focusCallback = useEventCallback((value, event) => {
34
34
  if (focusToOption) {
35
35
  const menu = isFunction(target) ? target() : target;
36
- const focusElement = menu === null || menu === void 0 ? void 0 : menu.querySelector(`[data-key="${value}"]`);
37
- focusElement === null || focusElement === void 0 || focusElement.focus();
36
+ const focusElement = menu?.querySelector(`[data-key="${value}"]`);
37
+ focusElement?.focus();
38
38
  }
39
- callback === null || callback === void 0 || callback(value, event);
39
+ callback?.(value, event);
40
40
  });
41
41
  const getScrollContainer = useEventCallback(() => {
42
42
  const menu = isFunction(target) ? target() : target;
43
43
 
44
44
  // For Cascader and MutiCascader
45
- const subMenu = menu === null || menu === void 0 ? void 0 : menu.querySelector(`[data-layer="${layer}"]`);
45
+ const subMenu = menu?.querySelector(`[data-layer="${layer}"]`);
46
46
  if (subMenu) {
47
47
  return subMenu;
48
48
  }
49
49
 
50
50
  // For SelectPicker、CheckPicker、Autocomplete、InputPicker、TagPicker
51
- return menu === null || menu === void 0 ? void 0 : menu.querySelector('[role="listbox"]');
51
+ return menu?.querySelector('[role="listbox"]');
52
52
  });
53
53
 
54
54
  /**
@@ -61,19 +61,11 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
61
61
  let currentKeys = keys;
62
62
  if (layer < 1) {
63
63
  const popup = isFunction(target) ? target() : target;
64
- const rootMenu = popup === null || popup === void 0 ? void 0 : popup.querySelector('[data-layer="0"]');
64
+ const rootMenu = popup?.querySelector('[data-layer="0"]');
65
65
  if (rootMenu) {
66
- var _rootMenu$querySelect;
67
- currentKeys = Array.from((_rootMenu$querySelect = rootMenu.querySelectorAll(focusableQueryKey)) !== null && _rootMenu$querySelect !== void 0 ? _rootMenu$querySelect : []).map(item => {
68
- var _item$dataset;
69
- return (_item$dataset = item.dataset) === null || _item$dataset === void 0 ? void 0 : _item$dataset.key;
70
- });
66
+ currentKeys = Array.from(rootMenu.querySelectorAll(focusableQueryKey) ?? []).map(item => item.dataset?.key);
71
67
  } else {
72
- var _popup$querySelectorA;
73
- currentKeys = Array.from((_popup$querySelectorA = popup === null || popup === void 0 ? void 0 : popup.querySelectorAll(focusableQueryKey)) !== null && _popup$querySelectorA !== void 0 ? _popup$querySelectorA : []).map(item => {
74
- var _item$dataset2;
75
- return (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.key;
76
- });
68
+ currentKeys = Array.from(popup?.querySelectorAll(focusableQueryKey) ?? []).map(item => item.dataset?.key);
77
69
  }
78
70
  }
79
71
 
@@ -88,8 +80,7 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
88
80
  const findFocusItemIndex = useEventCallback(callback => {
89
81
  const items = getFocusableMenuItems();
90
82
  for (let i = 0; i < items.length; i += 1) {
91
- var _items$i;
92
- if (shallowEqual(focusItemValue, (_items$i = items[i]) === null || _items$i === void 0 ? void 0 : _items$i[valueKey])) {
83
+ if (shallowEqual(focusItemValue, items[i]?.[valueKey])) {
93
84
  callback(items, i);
94
85
  return;
95
86
  }
@@ -98,7 +89,7 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
98
89
  });
99
90
  const scrollListItem = useEventCallback((direction, itemValue, willOverflow) => {
100
91
  const container = getScrollContainer();
101
- const item = container === null || container === void 0 ? void 0 : container.querySelector(`[data-key="${itemValue}"]`);
92
+ const item = container?.querySelector(`[data-key="${itemValue}"]`);
102
93
  if (willOverflow && container) {
103
94
  const {
104
95
  scrollHeight,
@@ -140,13 +131,9 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
140
131
  });
141
132
  const getSubMenuKeys = nextLayer => {
142
133
  const menu = isFunction(target) ? target() : target;
143
- const subMenu = menu === null || menu === void 0 ? void 0 : menu.querySelector(`[data-layer="${nextLayer}"]`);
134
+ const subMenu = menu?.querySelector(`[data-layer="${nextLayer}"]`);
144
135
  if (subMenu) {
145
- var _Array$from;
146
- return (_Array$from = Array.from(subMenu.querySelectorAll(focusableQueryKey))) === null || _Array$from === void 0 ? void 0 : _Array$from.map(item => {
147
- var _item$dataset3;
148
- return (_item$dataset3 = item.dataset) === null || _item$dataset3 === void 0 ? void 0 : _item$dataset3.key;
149
- });
136
+ return Array.from(subMenu.querySelectorAll(focusableQueryKey))?.map(item => item.dataset?.key);
150
137
  }
151
138
  return null;
152
139
  };
@@ -164,11 +151,10 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
164
151
  const nextLayer = layer - 1;
165
152
  const nextKeys = getSubMenuKeys(nextLayer);
166
153
  if (nextKeys) {
167
- var _getParent;
168
154
  setKeys(nextKeys);
169
155
  setLayer(nextLayer);
170
156
  const focusItem = findNodeOfTree(data, item => item[valueKey] === focusItemValue);
171
- const parentItemValue = (_getParent = getParent(focusItem)) === null || _getParent === void 0 ? void 0 : _getParent[valueKey];
157
+ const parentItemValue = getParent(focusItem)?.[valueKey];
172
158
  if (parentItemValue) {
173
159
  setFocusItemValue(parentItemValue);
174
160
  focusCallback(parentItemValue, event);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { OverlayTriggerHandle } from '../../Overlay';
3
2
  import type { ListHandle } from '../../Windowing';
4
3
  /**
@@ -14,43 +14,37 @@ function usePickerRef(ref) {
14
14
  const searchInput = useRef(null);
15
15
  const treeView = useRef(null);
16
16
  const handleOpen = useEventCallback(() => {
17
- var _trigger$current;
18
- trigger === null || trigger === void 0 || (_trigger$current = trigger.current) === null || _trigger$current === void 0 || _trigger$current.open();
17
+ trigger?.current?.open();
19
18
  });
20
19
  const handleClose = useEventCallback(() => {
21
- var _trigger$current2;
22
- trigger === null || trigger === void 0 || (_trigger$current2 = trigger.current) === null || _trigger$current2 === void 0 || _trigger$current2.close();
20
+ trigger?.current?.close();
23
21
  });
24
22
  const handleUpdatePosition = useEventCallback(() => {
25
- var _trigger$current3;
26
- trigger === null || trigger === void 0 || (_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0 || _trigger$current3.updatePosition();
23
+ trigger?.current?.updatePosition();
27
24
  });
28
25
  useImperativeHandle(ref, () => {
29
26
  return {
30
27
  get root() {
31
- var _ref, _trigger$current4;
32
- return (_ref = (root === null || root === void 0 ? void 0 : root.current) || (trigger === null || trigger === void 0 || (_trigger$current4 = trigger.current) === null || _trigger$current4 === void 0 ? void 0 : _trigger$current4.root)) !== null && _ref !== void 0 ? _ref : null;
28
+ return (root?.current || trigger?.current?.root) ?? null;
33
29
  },
34
30
  get overlay() {
35
- var _overlay$current;
36
- if (!(overlay !== null && overlay !== void 0 && overlay.current)) {
31
+ if (!overlay?.current) {
37
32
  throw new Error('The overlay is not found. Please confirm whether the picker is open.');
38
33
  }
39
- return (_overlay$current = overlay === null || overlay === void 0 ? void 0 : overlay.current) !== null && _overlay$current !== void 0 ? _overlay$current : null;
34
+ return overlay?.current ?? null;
40
35
  },
41
36
  get target() {
42
- var _target$current;
43
- return (_target$current = target === null || target === void 0 ? void 0 : target.current) !== null && _target$current !== void 0 ? _target$current : null;
37
+ return target?.current ?? null;
44
38
  },
45
39
  get list() {
46
- if (!(list !== null && list !== void 0 && list.current)) {
40
+ if (!list?.current) {
47
41
  throw new Error(`
48
42
  The list is not found.
49
43
  1.Please set virtualized for the component.
50
44
  2.Please confirm whether the picker is open.
51
45
  `);
52
46
  }
53
- return list === null || list === void 0 ? void 0 : list.current;
47
+ return list?.current;
54
48
  },
55
49
  type: RSUITE_PICKER_TYPE,
56
50
  updatePosition: handleUpdatePosition,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface SearchOptions<T> {
3
2
  labelKey: string;
4
3
  searchBy?: (keyword: string, label: any, item: T) => boolean;
@@ -23,7 +23,7 @@ function useSearch(data, props) {
23
23
  * @param {node} label
24
24
  */
25
25
  const checkShouldDisplay = useCallback((item, keyword) => {
26
- const checkValue = typeof item === 'object' ? item === null || item === void 0 ? void 0 : item[labelKey] : String(item);
26
+ const checkValue = typeof item === 'object' ? item?.[labelKey] : String(item);
27
27
  const _keyword = isUndefined(keyword) ? searchKeyword : keyword;
28
28
  if (typeof searchBy === 'function') {
29
29
  return searchBy(_keyword, checkValue, item);
@@ -36,7 +36,7 @@ function useSearch(data, props) {
36
36
  const handleSearch = (searchKeyword, event) => {
37
37
  const filteredData = data.filter(item => checkShouldDisplay(item, searchKeyword));
38
38
  setSearchKeyword(searchKeyword);
39
- callback === null || callback === void 0 || callback(searchKeyword, filteredData, event);
39
+ callback?.(searchKeyword, filteredData, event);
40
40
  };
41
41
  return {
42
42
  searchKeyword,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface ToggleKeyDownEventProps {
3
2
  toggle?: boolean;
4
3
  trigger: React.RefObject<any>;
@@ -23,15 +23,13 @@ const useToggleKeyDownEvent = props => {
23
23
  onMenuPressBackspace
24
24
  } = props;
25
25
  const handleClose = useEventCallback(() => {
26
- var _trigger$current, _trigger$current$clos, _trigger$current2, _trigger$current2$foc;
27
- (_trigger$current = trigger.current) === null || _trigger$current === void 0 || (_trigger$current$clos = _trigger$current.close) === null || _trigger$current$clos === void 0 || _trigger$current$clos.call(_trigger$current);
26
+ trigger.current?.close?.();
28
27
 
29
28
  // The focus is on the trigger button after closing
30
- (_trigger$current2 = trigger.current) === null || _trigger$current2 === void 0 || (_trigger$current2$foc = _trigger$current2.focus) === null || _trigger$current2$foc === void 0 || _trigger$current2$foc.call(_trigger$current2);
29
+ trigger.current?.focus?.();
31
30
  });
32
31
  const handleOpen = useEventCallback(() => {
33
- var _trigger$current3, _trigger$current3$ope;
34
- (_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0 || (_trigger$current3$ope = _trigger$current3.open) === null || _trigger$current3$ope === void 0 || _trigger$current3$ope.call(_trigger$current3);
32
+ trigger.current?.open?.();
35
33
  });
36
34
  const handleToggleDropdown = useEventCallback(() => {
37
35
  if (active) {
@@ -45,7 +43,7 @@ const useToggleKeyDownEvent = props => {
45
43
  if (readOnly || disabled || loading) {
46
44
  return;
47
45
  }
48
- if (event.target === (target === null || target === void 0 ? void 0 : target.current)) {
46
+ if (event.target === target?.current) {
49
47
  // enter
50
48
  if (toggle && event.key === KEY_VALUES.ENTER) {
51
49
  handleToggleDropdown();
@@ -53,32 +51,30 @@ const useToggleKeyDownEvent = props => {
53
51
 
54
52
  // delete
55
53
  if (event.key === KEY_VALUES.BACKSPACE) {
56
- onExit === null || onExit === void 0 || onExit(event);
54
+ onExit?.(event);
57
55
  }
58
56
  }
59
- if (overlay !== null && overlay !== void 0 && overlay.current) {
57
+ if (overlay?.current) {
60
58
  // The keyboard operation callback on the menu.
61
- onMenuKeyDown === null || onMenuKeyDown === void 0 || onMenuKeyDown(event);
59
+ onMenuKeyDown?.(event);
62
60
  if (event.key === KEY_VALUES.ENTER) {
63
- onMenuPressEnter === null || onMenuPressEnter === void 0 || onMenuPressEnter(event);
61
+ onMenuPressEnter?.(event);
64
62
  }
65
63
 
66
64
  /**
67
65
  * There is no callback when typing the Backspace key in the search box.
68
66
  * The default is to remove search keywords
69
67
  */
70
- if (event.key === KEY_VALUES.BACKSPACE && event.target !== (searchInput === null || searchInput === void 0 ? void 0 : searchInput.current)) {
71
- onMenuPressBackspace === null || onMenuPressBackspace === void 0 || onMenuPressBackspace(event);
68
+ if (event.key === KEY_VALUES.BACKSPACE && event.target !== searchInput?.current) {
69
+ onMenuPressBackspace?.(event);
72
70
  }
73
71
 
74
72
  // The search box gets focus when typing characters and numbers.
75
73
  if (event.key.length === 1 && /\w/.test(event.key)) {
76
- var _event$target;
77
74
  // Exclude Input
78
75
  // eg: <SelectPicker renderExtraFooter={() => <Input />} />
79
- if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.tagName) !== 'INPUT') {
80
- var _searchInput$current;
81
- searchInput === null || searchInput === void 0 || (_searchInput$current = searchInput.current) === null || _searchInput$current === void 0 || _searchInput$current.focus();
76
+ if (event.target?.tagName !== 'INPUT') {
77
+ searchInput?.current?.focus();
82
78
  }
83
79
  }
84
80
  }
@@ -87,7 +83,7 @@ const useToggleKeyDownEvent = props => {
87
83
  }
88
84
 
89
85
  // Native event callback
90
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
86
+ onKeyDown?.(event);
91
87
  });
92
88
  return onToggle;
93
89
  };
@@ -54,44 +54,44 @@ export function onMenuKeyDown(event, events) {
54
54
  switch (event.key) {
55
55
  // down
56
56
  case KEY_VALUES.DOWN:
57
- down === null || down === void 0 || down(event);
57
+ down?.(event);
58
58
  event.preventDefault();
59
59
  break;
60
60
  // up
61
61
  case KEY_VALUES.UP:
62
- up === null || up === void 0 || up(event);
62
+ up?.(event);
63
63
  event.preventDefault();
64
64
  break;
65
65
  // enter
66
66
  case KEY_VALUES.ENTER:
67
- enter === null || enter === void 0 || enter(event);
67
+ enter?.(event);
68
68
  event.preventDefault();
69
69
  break;
70
70
  // delete
71
71
  case KEY_VALUES.BACKSPACE:
72
- del === null || del === void 0 || del(event);
72
+ del?.(event);
73
73
  break;
74
74
  // esc | tab
75
75
  case KEY_VALUES.ESC:
76
76
  case KEY_VALUES.TAB:
77
- esc === null || esc === void 0 || esc(event);
77
+ esc?.(event);
78
78
  break;
79
79
  // left arrow
80
80
  case KEY_VALUES.LEFT:
81
- left === null || left === void 0 || left(event);
81
+ left?.(event);
82
82
  break;
83
83
  // right arrow
84
84
  case KEY_VALUES.RIGHT:
85
- right === null || right === void 0 || right(event);
85
+ right?.(event);
86
86
  break;
87
87
  // home
88
88
  case KEY_VALUES.HOME:
89
- home === null || home === void 0 || home(event);
89
+ home?.(event);
90
90
  event.preventDefault();
91
91
  break;
92
92
  // end
93
93
  case KEY_VALUES.END:
94
- end === null || end === void 0 || end(event);
94
+ end?.(event);
95
95
  event.preventDefault();
96
96
  break;
97
97
  default:
@@ -53,16 +53,15 @@ const Ripple = forwardRef((props, ref) => {
53
53
  const position = getPosition(triggerRef.current, event);
54
54
  setRippling(true);
55
55
  setPosition(position);
56
- onMouseDown === null || onMouseDown === void 0 || onMouseDown(position, event);
56
+ onMouseDown?.(position, event);
57
57
  }
58
58
  }, [onMouseDown]);
59
59
  useEffect(() => {
60
- var _triggerRef$current;
61
- const parentNode = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.parentNode;
60
+ const parentNode = triggerRef.current?.parentNode;
62
61
  if (parentNode) {
63
62
  const mousedownListener = on(parentNode, 'mousedown', handleMouseDown);
64
63
  return () => {
65
- mousedownListener === null || mousedownListener === void 0 || mousedownListener.off();
64
+ mousedownListener?.off();
66
65
  };
67
66
  }
68
67
  }, [handleMouseDown]);
@@ -31,7 +31,7 @@ const SafeAnchor = forwardRef((props, ref) => {
31
31
  event.stopPropagation();
32
32
  return;
33
33
  }
34
- onClick === null || onClick === void 0 || onClick(event);
34
+ onClick?.(event);
35
35
  }, [disabled, href, onClick]);
36
36
 
37
37
  // There are default role and href attributes on the node to ensure Focus management and keyboard interactions.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function useScrollState(scrollShadow?: boolean): {
3
2
  scrollState: "top" | "bottom" | "middle" | null;
4
3
  handleScroll: ((...args: any[]) => any) | undefined;
@@ -27,7 +27,7 @@ export function useScrollState(scrollShadow) {
27
27
 
28
28
  // Listen for changes in scrollHeight
29
29
  observer = new MutationObserver(() => {
30
- const newScrollHeight = target === null || target === void 0 ? void 0 : target.scrollHeight;
30
+ const newScrollHeight = target?.scrollHeight;
31
31
  if (newScrollHeight && newScrollHeight !== lastScrollHeight) {
32
32
  setScrollState(getScrollState(target));
33
33
  lastScrollHeight = newScrollHeight;
@@ -40,8 +40,7 @@ export function useScrollState(scrollShadow) {
40
40
  });
41
41
  }
42
42
  return () => {
43
- var _observer;
44
- (_observer = observer) === null || _observer === void 0 || _observer.disconnect();
43
+ observer?.disconnect();
45
44
  };
46
45
  });
47
46
  const handleScroll = useEventCallback(event => {
@@ -38,10 +38,10 @@ export declare const useTreeContextProps: () => {
38
38
  labelKey: string;
39
39
  valueKey: string;
40
40
  childrenKey: string;
41
- virtualized?: boolean | undefined;
42
- scrollShadow?: boolean | undefined;
43
- renderTreeNode?: ((nodeData: TreeNode) => React.ReactNode) | undefined;
44
- renderTreeIcon?: ((nodeData: TreeNode, expanded?: boolean) => React.ReactNode) | undefined;
41
+ virtualized?: boolean;
42
+ scrollShadow?: boolean;
43
+ renderTreeNode?: (nodeData: TreeNode) => React.ReactNode;
44
+ renderTreeIcon?: (nodeData: TreeNode, expanded?: boolean) => React.ReactNode;
45
45
  };
46
46
  /**
47
47
  * Custom hook that provides imperative handle for the Tree component.
@@ -68,13 +68,7 @@ export const useTreeImperativeHandle = () => {
68
68
  }, []);
69
69
  return {
70
70
  register,
71
- focusFirstNode: () => {
72
- var _focusFirstNodeRef$cu;
73
- return (_focusFirstNodeRef$cu = focusFirstNodeRef.current) === null || _focusFirstNodeRef$cu === void 0 ? void 0 : _focusFirstNodeRef$cu.call(focusFirstNodeRef);
74
- },
75
- focusActiveNode: () => {
76
- var _focusActiveNodeRef$c;
77
- return (_focusActiveNodeRef$c = focusActiveNodeRef.current) === null || _focusActiveNodeRef$c === void 0 ? void 0 : _focusActiveNodeRef$c.call(focusActiveNodeRef);
78
- }
71
+ focusFirstNode: () => focusFirstNodeRef.current?.(),
72
+ focusActiveNode: () => focusActiveNodeRef.current?.()
79
73
  };
80
74
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CheckStateType } from '../constants';
3
2
  /**
4
3
  * Represents a single node in a tree.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Returns a WeakMap that maps each item in `items` to its parent
4
3
  * indicated by `getChildren` function
@@ -26,8 +26,7 @@ const AutoSizer = /*#__PURE__*/React.forwardRef((props, ref) => {
26
26
  const [width, setWidth] = useState(defaultWidth || 0);
27
27
  const rootRef = useRef(null);
28
28
  const getParentNode = useCallback(() => {
29
- var _rootRef$current;
30
- 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) {
29
+ if (rootRef.current?.parentNode && rootRef.current.parentNode.ownerDocument && rootRef.current.parentNode.ownerDocument.defaultView && rootRef.current.parentNode instanceof rootRef.current.parentNode.ownerDocument.defaultView.HTMLElement) {
31
30
  return rootRef.current.parentNode;
32
31
  }
33
32
  return null;
@@ -47,7 +46,7 @@ const AutoSizer = /*#__PURE__*/React.forwardRef((props, ref) => {
47
46
  if (!disableHeight && height !== newHeight || !disableWidth && width !== newWidth) {
48
47
  setHeight(offsetHeight - paddingTop - paddingBottom);
49
48
  setWidth(offsetWidth - paddingLeft - paddingRight);
50
- onResize === null || onResize === void 0 || onResize({
49
+ onResize?.({
51
50
  height: offsetHeight,
52
51
  width: offsetWidth
53
52
  });
@@ -32,20 +32,16 @@ const List = forwardRef((props, ref) => {
32
32
  } = useCustom();
33
33
  useImperativeHandle(ref, () => ({
34
34
  resetAfterIndex: (index, shouldForceUpdate) => {
35
- var _listRef$current, _listRef$current$rese;
36
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 || (_listRef$current$rese = _listRef$current.resetAfterIndex) === null || _listRef$current$rese === void 0 || _listRef$current$rese.call(_listRef$current, index, shouldForceUpdate);
35
+ listRef.current?.resetAfterIndex?.(index, shouldForceUpdate);
37
36
  },
38
37
  scrollTo: scrollOffset => {
39
- var _listRef$current2, _listRef$current2$scr;
40
- (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || (_listRef$current2$scr = _listRef$current2.scrollTo) === null || _listRef$current2$scr === void 0 || _listRef$current2$scr.call(_listRef$current2, scrollOffset);
38
+ listRef.current?.scrollTo?.(scrollOffset);
41
39
  },
42
40
  scrollToItem: (index, align) => {
43
- var _listRef$current3, _listRef$current3$scr;
44
- (_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || (_listRef$current3$scr = _listRef$current3.scrollToItem) === null || _listRef$current3$scr === void 0 || _listRef$current3$scr.call(_listRef$current3, index, align);
41
+ listRef.current?.scrollToItem?.(index, align);
45
42
  },
46
43
  scrollToRow: index => {
47
- var _listRef$current4, _listRef$current4$scr;
48
- (_listRef$current4 = listRef.current) === null || _listRef$current4 === void 0 || (_listRef$current4$scr = _listRef$current4.scrollToItem) === null || _listRef$current4$scr === void 0 || _listRef$current4$scr.call(_listRef$current4, index);
44
+ listRef.current?.scrollToItem?.(index);
49
45
  }
50
46
  }));
51
47
  const setRowHeight = useCallback(index => {
@@ -19,8 +19,8 @@ export type CheckStateType = CHECK_STATE.UNCHECK | CHECK_STATE.CHECK | CHECK_STA
19
19
  * Tree Node Drag Type
20
20
  */
21
21
  export declare enum TREE_NODE_DROP_POSITION {
22
- DRAG_OVER = 0,
23
- DRAG_OVER_TOP = 1,
22
+ DRAG_OVER = 0,// drag node in tree node
23
+ DRAG_OVER_TOP = 1,// drag node on tree node
24
24
  DRAG_OVER_BOTTOM = 2
25
25
  }
26
26
  /**
@@ -14,10 +14,8 @@ export function useClickOutside({
14
14
  useEffect(() => {
15
15
  if (enabled) {
16
16
  const eventHandler = event => {
17
- var _isOutsideRef$current;
18
- if ((_isOutsideRef$current = isOutsideRef.current) !== null && _isOutsideRef$current !== void 0 && _isOutsideRef$current.call(isOutsideRef, event)) {
19
- var _handleRef$current;
20
- (_handleRef$current = handleRef.current) === null || _handleRef$current === void 0 || _handleRef$current.call(handleRef, event);
17
+ if (isOutsideRef.current?.(event)) {
18
+ handleRef.current?.(event);
21
19
  }
22
20
  };
23
21
  window.addEventListener('mousedown', eventHandler);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import enGB from '../../locales/en_GB';
3
2
  import type { FormatDateOptions } from '../utils/date/types';
4
3
  import type { ReactSuiteComponents } from '../Provider/types';
@@ -38,7 +38,6 @@ function getComponentLocaleKey(componentName) {
38
38
  * @param componentProps - The props of the component
39
39
  */
40
40
  export function useCustom(componentName, componentProps) {
41
- var _globalLocale$DateTim;
42
41
  const {
43
42
  components = {},
44
43
  locale: globalLocale = enGB,
@@ -53,26 +52,25 @@ export function useCustom(componentName, componentProps) {
53
52
  locale: componentLocale,
54
53
  ...restProps
55
54
  } = componentProps || {};
56
- const dateLocale = globalLocale === null || globalLocale === void 0 || (_globalLocale$DateTim = globalLocale.DateTimeFormats) === null || _globalLocale$DateTim === void 0 ? void 0 : _globalLocale$DateTim.dateLocale;
57
- const code = globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale.code;
55
+ const dateLocale = globalLocale?.DateTimeFormats?.dateLocale;
56
+ const code = globalLocale?.code;
58
57
  const getLocale = useCallback((key, overrideLocale) => {
59
58
  // Initialize with common locale
60
- const publicLocale = (globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale.common) || {};
59
+ const publicLocale = globalLocale?.common || {};
61
60
 
62
61
  // Merge component-specific locale(s) based on key type
63
- const specificLocale = typeof key === 'string' ? globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale[key] : Array.isArray(key) ? assign({}, ...key.map(k => globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale[k])) : {};
62
+ const specificLocale = typeof key === 'string' ? globalLocale?.[key] : Array.isArray(key) ? assign({}, ...key.map(k => globalLocale?.[k])) : {};
64
63
 
65
64
  // Merge all parts: public locale, specific locale, custom component locale
66
65
  return assign({}, publicLocale, specificLocale, componentLocale, overrideLocale);
67
66
  }, [globalLocale, componentLocale]);
68
67
  const propsWithDefaults = useMemo(() => {
69
- var _components$component;
70
68
  if (!componentName) {
71
69
  return;
72
70
  }
73
71
 
74
72
  //Memoize the global default props based on component name
75
- const globalDefaultProps = ((_components$component = components[componentName]) === null || _components$component === void 0 ? void 0 : _components$component.defaultProps) || {};
73
+ const globalDefaultProps = components[componentName]?.defaultProps || {};
76
74
  const mergedProps = assign({}, globalDefaultProps, restProps);
77
75
  const localeKey = getComponentLocaleKey(componentName);
78
76
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Attach the event handler directly to the specified DOM element,
4
3
  * and it will be triggered when the size of the DOM element is changed.
@@ -17,8 +17,7 @@ export function useEventCallback(fn) {
17
17
  ref.current = fn;
18
18
  });
19
19
  return useCallback((...args) => {
20
- var _ref$current;
21
- return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.call(ref, ...args);
20
+ return ref.current?.(...args);
22
21
  }, []);
23
22
  }
24
23
  export default useEventCallback;
@@ -15,7 +15,7 @@ export function useEventListener(eventTarget, event, listener, capture = false)
15
15
  const target = typeof eventTarget === 'function' ? eventTarget() : eventTarget;
16
16
  const controller = target ? on(target, event, listener, capture) : null;
17
17
  return () => {
18
- controller === null || controller === void 0 || controller.off();
18
+ controller?.off();
19
19
  };
20
20
  }, [eventTarget, event, listener, capture]);
21
21
  }