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
@@ -27,40 +27,37 @@ const useEditState = props => {
27
27
  if (disabled) {
28
28
  return;
29
29
  }
30
- onClick === null || onClick === void 0 || onClick(event);
31
- onEdit === null || onEdit === void 0 || onEdit(event);
30
+ onClick?.(event);
31
+ onEdit?.(event);
32
32
  setIsEditing(true);
33
33
  setResetValue(value);
34
34
  });
35
35
  const handleFocus = (0, _hooks.useEventCallback)(event => {
36
36
  if (disabled || isEditing) return;
37
- onFocus === null || onFocus === void 0 || onFocus(event);
37
+ onFocus?.(event);
38
38
  setIsEditing(true);
39
39
  setResetValue(value);
40
40
  });
41
41
  const handleChange = (0, _hooks.useEventCallback)((value, event) => {
42
42
  setValue(value);
43
- onChange === null || onChange === void 0 || onChange(value, event);
43
+ onChange?.(value, event);
44
44
  });
45
45
  const handleCancel = (0, _hooks.useEventCallback)(event => {
46
- var _event$stopPropagatio;
47
46
  setIsEditing(false);
48
47
  setValue(resetValue);
49
- onCancel === null || onCancel === void 0 || onCancel(event);
50
- event === null || event === void 0 || (_event$stopPropagatio = event.stopPropagation) === null || _event$stopPropagatio === void 0 || _event$stopPropagatio.call(event);
48
+ onCancel?.(event);
49
+ event?.stopPropagation?.();
51
50
  });
52
51
  const handleSave = (0, _hooks.useEventCallback)(event => {
53
- var _event$stopPropagatio2;
54
52
  setIsEditing(false);
55
- onSave === null || onSave === void 0 || onSave(event);
56
- event === null || event === void 0 || (_event$stopPropagatio2 = event.stopPropagation) === null || _event$stopPropagatio2 === void 0 || _event$stopPropagatio2.call(event);
53
+ onSave?.(event);
54
+ event?.stopPropagation?.();
57
55
  });
58
56
  const handleKeyDown = (0, _hooks.useEventCallback)(event => {
59
- var _event$target;
60
57
  if (isEditing) {
61
58
  switch (event.key) {
62
59
  case 'Enter':
63
- if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.tagName) === 'INPUT') {
60
+ if (event.target?.tagName === 'INPUT') {
64
61
  handleSave(event);
65
62
  }
66
63
  break;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PickerHandle } from '../internals/Picker/types';
3
2
  interface FocusEventProps {
4
3
  isEditing: boolean;
@@ -13,38 +13,34 @@ const useFocusEvent = ({
13
13
  onSave,
14
14
  onCancel
15
15
  }) => {
16
- var _ref$current;
17
16
  const ref = (0, _react.useRef)(null);
18
17
  const rootRef = (0, _react.useRef)(null);
19
- const isPicker = ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.type) === _symbols.RSUITE_PICKER_TYPE;
18
+ const isPicker = ref.current?.type === _symbols.RSUITE_PICKER_TYPE;
20
19
  const focus = () => {
21
20
  if (isPicker) {
22
21
  setTimeout(() => {
23
- var _picker$target, _picker$target$focus, _picker$open;
24
22
  const picker = ref.current;
25
23
  // Auto focus the search input
26
- picker === null || picker === void 0 || (_picker$target = picker.target) === null || _picker$target === void 0 || (_picker$target$focus = _picker$target.focus) === null || _picker$target$focus === void 0 || _picker$target$focus.call(_picker$target);
24
+ picker?.target?.focus?.();
27
25
 
28
26
  // Open the picker
29
- picker === null || picker === void 0 || (_picker$open = picker.open) === null || _picker$open === void 0 || _picker$open.call(picker);
27
+ picker?.open?.();
30
28
  }, 100);
31
29
  } else {
32
- var _ref$current2, _ref$current2$focus;
33
- (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || (_ref$current2$focus = _ref$current2.focus) === null || _ref$current2$focus === void 0 || _ref$current2$focus.call(_ref$current2);
30
+ ref.current?.focus?.();
34
31
  }
35
32
  };
36
33
  const handleBlur = (0, _hooks.useEventCallback)(event => {
37
34
  if (event) {
38
- var _event$relatedTarget;
39
- const relatedTarget = (_event$relatedTarget = event.relatedTarget) !== null && _event$relatedTarget !== void 0 ? _event$relatedTarget : (0, _domLib.ownerDocument)(event.currentTarget).activeElement;
35
+ const relatedTarget = event.relatedTarget ?? (0, _domLib.ownerDocument)(event.currentTarget).activeElement;
40
36
  if (rootRef.current && (0, _domLib.contains)(rootRef.current, relatedTarget)) {
41
37
  return;
42
38
  }
43
39
  }
44
40
  if (stateOnBlur === 'save') {
45
- onSave === null || onSave === void 0 || onSave(event);
41
+ onSave?.(event);
46
42
  } else if (stateOnBlur === 'cancel') {
47
- onCancel === null || onCancel === void 0 || onCancel(event);
43
+ onCancel?.(event);
48
44
  }
49
45
  });
50
46
  (0, _hooks.useIsomorphicLayoutEffect)(() => {
@@ -24,7 +24,7 @@ const Input = (0, _utils.forwardRef)((props, ref) => {
24
24
  const {
25
25
  type = 'text',
26
26
  htmlSize,
27
- size = (inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.size) || 'md',
27
+ size = inputGroup?.size || 'md',
28
28
  classPrefix = 'input',
29
29
  ...rest
30
30
  } = propsWithDefaults;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import type { Size } from '../internals/types';
2
3
  export declare const InputGroupContext: React.Context<{
3
4
  onFocus: () => void;
4
5
  onBlur: () => void;
5
- size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
6
+ size?: Size;
6
7
  } | null>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NumberInputProps as InputNumberProps } from '../NumberInput';
3
2
  /**
4
3
  * The `InputNumber` component is used to enter a numerical value.
@@ -56,7 +56,7 @@ const useInputWidth = (props, sizerRef, placeholderRef) => {
56
56
  }
57
57
  if (width !== inputWidth) {
58
58
  setInputWidth(width);
59
- onAutosize === null || onAutosize === void 0 || onAutosize(width);
59
+ onAutosize?.(width);
60
60
  }
61
61
  }, [minWidth, placeholder, inputWidth, value, placeholderRef, sizerRef, onAutosize]);
62
62
  return inputWidth;
@@ -129,8 +129,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
129
129
  triggerRef
130
130
  });
131
131
  const handleDataChange = data => {
132
- var _data$;
133
- setFocusItemValue(data === null || data === void 0 || (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$[valueKey]);
132
+ setFocusItemValue(data?.[0]?.[valueKey]);
134
133
  };
135
134
  const {
136
135
  data,
@@ -145,11 +144,10 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
145
144
  const [value, setValue, isControlled] = (0, _hooks.useControlled)(valueProp, multi ? defaultValue || [] : defaultValue);
146
145
  const cloneValue = () => multi ? (0, _clone.default)(value) || [] : value;
147
146
  const handleClose = (0, _hooks.useEventCallback)(() => {
148
- var _triggerRef$current, _target$current, _target$current$focus;
149
- triggerRef === null || triggerRef === void 0 || (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.close();
147
+ triggerRef?.current?.close();
150
148
 
151
149
  // The focus is on the trigger button after closing
152
- (_target$current = target.current) === null || _target$current === void 0 || (_target$current$focus = _target$current.focus) === null || _target$current$focus === void 0 || _target$current$focus.call(_target$current);
150
+ target.current?.focus?.();
153
151
  });
154
152
  const focusItemValueOptions = {
155
153
  data: dataWithCache,
@@ -162,12 +160,11 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
162
160
  focusItemValue,
163
161
  setFocusItemValue,
164
162
  onKeyDown
165
- } = (0, _Picker.useFocusItemValue)(multi ? value === null || value === void 0 ? void 0 : value[0] : value, focusItemValueOptions);
163
+ } = (0, _Picker.useFocusItemValue)(multi ? value?.[0] : value, focusItemValueOptions);
166
164
  const onSearchCallback = (0, _hooks.useEventCallback)((searchKeyword, filteredData, event) => {
167
165
  if (!disabledOptions) {
168
- var _filteredData$;
169
166
  // The first option after filtering is the focus.
170
- let firstItemValue = filteredData === null || filteredData === void 0 || (_filteredData$ = filteredData[0]) === null || _filteredData$ === void 0 ? void 0 : _filteredData$[valueKey];
167
+ let firstItemValue = filteredData?.[0]?.[valueKey];
171
168
 
172
169
  // If there is no value in the option and new options are supported, the search keyword is the first option
173
170
  if (!firstItemValue && creatable) {
@@ -175,7 +172,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
175
172
  }
176
173
  setFocusItemValue(firstItemValue);
177
174
  }
178
- onSearch === null || onSearch === void 0 || onSearch(searchKeyword, event);
175
+ onSearch?.(searchKeyword, event);
179
176
  });
180
177
  const searchOptions = {
181
178
  labelKey,
@@ -193,15 +190,14 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
193
190
 
194
191
  // Update the position of the menu when the search keyword and value change
195
192
  (0, _react.useEffect)(() => {
196
- var _triggerRef$current2, _triggerRef$current2$;
197
- (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 || (_triggerRef$current2$ = _triggerRef$current2.updatePosition) === null || _triggerRef$current2$ === void 0 || _triggerRef$current2$.call(_triggerRef$current2);
193
+ triggerRef.current?.updatePosition?.();
198
194
  }, [searchKeyword, value]);
199
195
  const getDataItem = value => {
200
196
  // Find active `MenuItem` by `value`
201
197
  const activeItem = dataWithCache.find(item => (0, _utils3.shallowEqual)(item[valueKey], value));
202
198
  let itemNode = placeholder;
203
- if (activeItem !== null && activeItem !== void 0 && activeItem[labelKey]) {
204
- itemNode = activeItem === null || activeItem === void 0 ? void 0 : activeItem[labelKey];
199
+ if (activeItem?.[labelKey]) {
200
+ itemNode = activeItem?.[labelKey];
205
201
  }
206
202
  return {
207
203
  isValid: !!activeItem,
@@ -221,14 +217,14 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
221
217
  };
222
218
  if (groupBy) {
223
219
  return {
224
- [groupBy]: locale === null || locale === void 0 ? void 0 : locale.newItem,
220
+ [groupBy]: locale?.newItem,
225
221
  ...option
226
222
  };
227
223
  }
228
224
  return option;
229
225
  };
230
226
  const handleChange = (0, _hooks.useEventCallback)((value, event) => {
231
- onChange === null || onChange === void 0 || onChange(value, event);
227
+ onChange?.(value, event);
232
228
  });
233
229
  const handleRemoveItemByTag = (0, _hooks.useEventCallback)((tag, event) => {
234
230
  event.stopPropagation();
@@ -236,13 +232,13 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
236
232
  (0, _remove.default)(val, itemVal => (0, _utils3.shallowEqual)(itemVal, tag));
237
233
  setValue(val);
238
234
  handleChange(val, event);
239
- onTagRemove === null || onTagRemove === void 0 || onTagRemove(tag, event);
235
+ onTagRemove?.(tag, event);
240
236
  });
241
237
  const handleSelect = (0, _hooks.useEventCallback)((value, item, event) => {
242
- onSelect === null || onSelect === void 0 || onSelect(value, item, event);
238
+ onSelect?.(value, item, event);
243
239
  if (creatable && item.create) {
244
240
  delete item.create;
245
- onCreate === null || onCreate === void 0 || onCreate(value, item, event);
241
+ onCreate?.(value, item, event);
246
242
  setNewData(newData.concat(item));
247
243
  }
248
244
  });
@@ -300,7 +296,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
300
296
  }
301
297
 
302
298
  // If the value is disabled in this option, it is returned.
303
- if (disabledItemValues !== null && disabledItemValues !== void 0 && disabledItemValues.some(item => item === newItemValue)) {
299
+ if (disabledItemValues?.some(item => item === newItemValue)) {
304
300
  return;
305
301
  }
306
302
  if (!val.some(v => (0, _utils3.shallowEqual)(v, newItemValue))) {
@@ -308,7 +304,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
308
304
  } else if (!disabledOptions) {
309
305
  (0, _remove.default)(val, itemVal => (0, _utils3.shallowEqual)(itemVal, newItemValue));
310
306
  }
311
- let focusItem = data.find(item => (0, _utils3.shallowEqual)(item === null || item === void 0 ? void 0 : item[valueKey], newItemValue));
307
+ let focusItem = data.find(item => (0, _utils3.shallowEqual)(item?.[valueKey], newItemValue));
312
308
  if (!focusItem) {
313
309
  focusItem = createOption(newItemValue);
314
310
  }
@@ -323,7 +319,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
323
319
  }
324
320
 
325
321
  // If the value is disabled in this option, it is returned.
326
- if (disabledItemValues !== null && disabledItemValues !== void 0 && disabledItemValues.some(item => item === focusItemValue)) {
322
+ if (disabledItemValues?.some(item => item === focusItemValue)) {
327
323
  return;
328
324
  }
329
325
 
@@ -348,12 +344,12 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
348
344
  * @param event
349
345
  */
350
346
  const removeLastItem = (0, _hooks.useEventCallback)(event => {
351
- const target = event === null || event === void 0 ? void 0 : event.target;
352
- if ((target === null || target === void 0 ? void 0 : target.tagName) !== 'INPUT') {
347
+ const target = event?.target;
348
+ if (target?.tagName !== 'INPUT') {
353
349
  focus();
354
350
  return;
355
351
  }
356
- if ((target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' && target !== null && target !== void 0 && target.value) {
352
+ if (target?.tagName === 'INPUT' && target?.value) {
357
353
  return;
358
354
  }
359
355
  const val = cloneValue();
@@ -379,7 +375,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
379
375
  } else {
380
376
  handleChange(null, event);
381
377
  }
382
- onClean === null || onClean === void 0 || onClean(event);
378
+ onClean?.(event);
383
379
  });
384
380
  const events = {
385
381
  onMenuPressBackspace: multi ? removeLastItem : handleClean,
@@ -419,16 +415,15 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
419
415
  ...rest
420
416
  });
421
417
  const handleExited = (0, _hooks.useEventCallback)(() => {
422
- setFocusItemValue(multi ? value === null || value === void 0 ? void 0 : value[0] : value);
418
+ setFocusItemValue(multi ? value?.[0] : value);
423
419
  resetSearch();
424
420
  });
425
421
  const handleFocus = (0, _hooks.useEventCallback)(event => {
426
422
  if (!readOnly) {
427
- var _triggerRef$current3;
428
423
  setOpen(true);
429
- (_triggerRef$current3 = triggerRef.current) === null || _triggerRef$current3 === void 0 || _triggerRef$current3.open();
424
+ triggerRef.current?.open();
430
425
  }
431
- onFocus === null || onFocus === void 0 || onFocus(event);
426
+ onFocus?.(event);
432
427
  });
433
428
  const handleEnter = (0, _hooks.useEventCallback)(() => {
434
429
  focus();
@@ -440,7 +435,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
440
435
  });
441
436
  const renderListItem = (label, item) => {
442
437
  // 'Create option "{0}"' => Create option "xxxxx"
443
- const newLabel = item.create ? /*#__PURE__*/_react.default.createElement("span", null, (0, _utils3.tplTransform)((locale === null || locale === void 0 ? void 0 : locale.createOption) || '', label)) : label;
438
+ const newLabel = item.create ? /*#__PURE__*/_react.default.createElement("span", null, (0, _utils3.tplTransform)(locale?.createOption || '', label)) : label;
444
439
  return renderOption ? renderOption(newLabel, item) : newLabel;
445
440
  };
446
441
  const checkValue = () => {
@@ -545,7 +540,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
545
540
  virtualized: virtualized
546
541
  }) : /*#__PURE__*/_react.default.createElement("div", {
547
542
  className: prefix`none`
548
- }, locale === null || locale === void 0 ? void 0 : locale.noResultsText);
543
+ }, locale?.noResultsText);
549
544
  return /*#__PURE__*/_react.default.createElement(_Picker.PickerPopup, {
550
545
  ref: (0, _utils3.mergeRefs)(overlay, speakerRef),
551
546
  autoWidth: popupAutoWidth,
@@ -553,7 +548,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
553
548
  style: mergedPopupStyle,
554
549
  target: triggerRef,
555
550
  onKeyDown: onPickerKeyDown
556
- }, renderListbox ? renderListbox(listbox) : listbox, renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter());
551
+ }, renderListbox ? renderListbox(listbox) : listbox, renderExtraFooter?.());
557
552
  };
558
553
  const {
559
554
  isValid,
@@ -568,7 +563,7 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
568
563
  */
569
564
  const hasSingleValue = !(0, _isNil.default)(value) && (0, _isFunction.default)(renderValue) && !(0, _isNil.default)(itemNode);
570
565
  const hasMultiValue = (0, _isArray.default)(value) && value.length > 0 && (0, _isFunction.default)(renderValue) && !(0, _isNil.default)(tagElements);
571
- const hasValue = multi ? !!(tagElements !== null && tagElements !== void 0 && tagElements.length) || hasMultiValue : isValid || hasSingleValue;
566
+ const hasValue = multi ? !!tagElements?.length || hasMultiValue : isValid || hasSingleValue;
572
567
  const searching = !!searchKeyword && open;
573
568
  const editable = searchable && !disabled && !loading;
574
569
  if (plaintext) {
@@ -583,9 +578,9 @@ const InputPicker = (0, _utils3.forwardRef)((props, ref) => {
583
578
  return /*#__PURE__*/_react.default.createElement(_Plaintext.default, (0, _extends2.default)({
584
579
  localeKey: "notSelected",
585
580
  ref: target
586
- }, plaintextProps), itemNode || (tagElements !== null && tagElements !== void 0 && tagElements.length ? tagElements : null) || placeholder);
581
+ }, plaintextProps), itemNode || (tagElements?.length ? tagElements : null) || placeholder);
587
582
  }
588
- const placeholderNode = placeholder || (disabledOptions ? null : locale === null || locale === void 0 ? void 0 : locale.placeholder);
583
+ const placeholderNode = placeholder || (disabledOptions ? null : locale?.placeholder);
589
584
  const triggerProps = {
590
585
  ...(0, _pick.default)(props, _Picker.triggerPropKeys),
591
586
  onEnter: (0, _utils3.createChainedFunction)(handleEnter, onEnter),
@@ -22,8 +22,7 @@ const InputSearch = (0, _utils.forwardRef)((props, ref) => {
22
22
  ...rest
23
23
  } = props;
24
24
  const handleChange = (0, _hooks.useEventCallback)(event => {
25
- var _event$target;
26
- onChange === null || onChange === void 0 || onChange(event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, event);
25
+ onChange?.(event?.target?.value, event);
27
26
  });
28
27
  const {
29
28
  withPrefix,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Option } from '../../internals/types';
3
2
  export interface InputOption<T = number | string> extends Option<T> {
4
3
  create?: boolean;
@@ -25,7 +25,7 @@ function useData(props) {
25
25
  if (controlledData && !(0, _utils.shallowEqual)(controlledData, uncontrolledData)) {
26
26
  setData(controlledData);
27
27
  setNewData([]);
28
- onChange === null || onChange === void 0 || onChange(controlledData);
28
+ onChange?.(controlledData);
29
29
  }
30
30
  }, [controlledData, uncontrolledData, onChange]);
31
31
  return {
@@ -16,16 +16,13 @@ function useInput(props) {
16
16
  const inputRef = (0, _react.useRef)(null);
17
17
  const maxWidth = (0, _useMaxWidth.default)(triggerRef);
18
18
  const getInput = (0, _react.useCallback)(() => {
19
- var _inputRef$current;
20
- return multi ? (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.input : inputRef.current;
19
+ return multi ? inputRef.current?.input : inputRef.current;
21
20
  }, [multi]);
22
21
  const focus = (0, _react.useCallback)(() => {
23
- var _getInput;
24
- (_getInput = getInput()) === null || _getInput === void 0 || _getInput.focus();
22
+ getInput()?.focus();
25
23
  }, [getInput]);
26
24
  const blur = (0, _react.useCallback)(() => {
27
- var _getInput2;
28
- (_getInput2 = getInput()) === null || _getInput2 === void 0 || _getInput2.blur();
25
+ getInput()?.blur();
29
26
  }, [getInput]);
30
27
  const inputProps = (0, _react.useMemo)(() => {
31
28
  return multi ? {
@@ -9,11 +9,9 @@ var _getWidth = _interopRequireDefault(require("dom-lib/getWidth"));
9
9
  function useMaxWidth(triggerRef) {
10
10
  const [maxWidth, setMaxWidth] = (0, _react.useState)(100);
11
11
  (0, _react.useEffect)(() => {
12
- var _triggerRef$current;
13
12
  // In multiple selection, you need to set a maximum width for the input.
14
- if ((_triggerRef$current = triggerRef.current) !== null && _triggerRef$current !== void 0 && _triggerRef$current.root) {
15
- var _triggerRef$current2;
16
- setMaxWidth((0, _getWidth.default)((_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.root));
13
+ if (triggerRef.current?.root) {
14
+ setMaxWidth((0, _getWidth.default)(triggerRef.current?.root));
17
15
  }
18
16
  }, []);
19
17
  return maxWidth;
@@ -9,11 +9,9 @@ const ACCELERATION = 5; // for auto scroll
9
9
  * Auto scroll when approaching the edge
10
10
  * */
11
11
  class AutoScroller {
12
+ interval = null;
13
+ isAutoScrolling = true;
12
14
  constructor(container, onScrollCallback) {
13
- this.container = void 0;
14
- this.onScrollCallback = void 0;
15
- this.interval = null;
16
- this.isAutoScrolling = true;
17
15
  this.container = container;
18
16
  this.onScrollCallback = onScrollCallback;
19
17
  }
@@ -16,10 +16,10 @@ export type SortConfig = {
16
16
  onSort?(payload?: MovedItemInfo, event?: MouseEvent | TouchEvent): void;
17
17
  };
18
18
  declare const useSortHelper: (config: SortConfig) => {
19
- handleStart: MouseEventHandler<Element>;
20
- handleEnd: MouseEventHandler<Element>;
21
- handleTouchStart: TouchEventHandler<Element>;
22
- handleTouchEnd: TouchEventHandler<Element>;
19
+ handleStart: MouseEventHandler;
20
+ handleEnd: MouseEventHandler;
21
+ handleTouchStart: TouchEventHandler;
22
+ handleTouchEnd: TouchEventHandler;
23
23
  containerRef: import("react").RefObject<HTMLDivElement | null>;
24
24
  sorting: boolean;
25
25
  register: (item: ManagedItem) => {
@@ -36,13 +36,12 @@ const useSortHelper = config => {
36
36
  * start dragging
37
37
  * */
38
38
  const handlePress = (0, _react.useCallback)((event, _targetNode, curManagedItem) => {
39
- var _curManagedItem$info$, _curManagedItem$info$2, _activeNodeHelper;
40
39
  if (!isMounted()) return;
41
40
  // data
42
41
  const containerElement = containerRef.current;
43
42
  const activeNode = curManagedItem.node;
44
- const activeNodeOldIndex = (_curManagedItem$info$ = curManagedItem.info.index) !== null && _curManagedItem$info$ !== void 0 ? _curManagedItem$info$ : 0;
45
- let activeNodeNextIndex = (_curManagedItem$info$2 = curManagedItem.info.index) !== null && _curManagedItem$info$2 !== void 0 ? _curManagedItem$info$2 : 0;
43
+ const activeNodeOldIndex = curManagedItem.info.index ?? 0;
44
+ let activeNodeNextIndex = curManagedItem.info.index ?? 0;
46
45
  let activeNodeHolderTranslate = {
47
46
  x: 0,
48
47
  y: 0
@@ -70,7 +69,7 @@ const useSortHelper = config => {
70
69
  const activeNodeOffsetEdge = (0, _utils.getEdgeOffset)(activeNode, containerElement);
71
70
  const activeNodeStyle = getComputedStyle(activeNode);
72
71
  let activeNodeHelper = activeNode.cloneNode(true);
73
- (_activeNodeHelper = activeNodeHelper) === null || _activeNodeHelper === void 0 || _activeNodeHelper.classList.add(helperElementClass);
72
+ activeNodeHelper?.classList.add(helperElementClass);
74
73
  (0, _utils.setInlineStyles)(activeNodeHelper, {
75
74
  position: 'fixed',
76
75
  width: `${activeNodeBoundingClientRect.width}px`,
@@ -128,9 +127,8 @@ const useSortHelper = config => {
128
127
  const cTop = containerScrollDelta.top || 0;
129
128
  const sortingOffsetY = aTop + activeNodeHolderTranslate.y + cTop;
130
129
  for (let i = 0, len = listItemManagerRefs.length; i < len; i++) {
131
- var _listItemManagerRefs$;
132
130
  const currentNode = listItemManagerRefs[i].node;
133
- const currentNodeIndex = (_listItemManagerRefs$ = listItemManagerRefs[i].info.index) !== null && _listItemManagerRefs$ !== void 0 ? _listItemManagerRefs$ : 0;
131
+ const currentNodeIndex = listItemManagerRefs[i].info.index ?? 0;
134
132
  const offsetY = activeNodeBoundingClientRect.height > currentNode.offsetHeight ? currentNode.offsetHeight / 2 : activeNodeBoundingClientRect.height / 2;
135
133
  const translate = {
136
134
  x: 0,
@@ -159,8 +157,7 @@ const useSortHelper = config => {
159
157
  }
160
158
  const curEdgeOffsetTop = curEdgeOffset.top || 0;
161
159
  if (prvNode && currentNodeIndex > activeNodeOldIndex && sortingOffsetY + offsetY >= curEdgeOffsetTop) {
162
- var _prvNode$edgeOffset;
163
- const yOffset = (((_prvNode$edgeOffset = prvNode.edgeOffset) === null || _prvNode$edgeOffset === void 0 ? void 0 : _prvNode$edgeOffset.top) || 0) - curEdgeOffsetTop;
160
+ const yOffset = (prvNode.edgeOffset?.top || 0) - curEdgeOffsetTop;
164
161
  translate.y = yOffset;
165
162
  animatedNodesOffset[currentNodeIndex] = {
166
163
  x: 0,
@@ -168,8 +165,7 @@ const useSortHelper = config => {
168
165
  };
169
166
  activeNodeNextIndex = currentNodeIndex;
170
167
  } else if (nextNode && currentNodeIndex < activeNodeOldIndex && sortingOffsetY <= curEdgeOffsetTop + offsetY) {
171
- var _nextNode$edgeOffset;
172
- const yOffset = (((_nextNode$edgeOffset = nextNode.edgeOffset) === null || _nextNode$edgeOffset === void 0 ? void 0 : _nextNode$edgeOffset.top) || 0) - curEdgeOffsetTop;
168
+ const yOffset = (nextNode.edgeOffset?.top || 0) - curEdgeOffsetTop;
173
169
  translate.y = yOffset;
174
170
  animatedNodesOffset[currentNodeIndex] = {
175
171
  x: 0,
@@ -210,7 +206,7 @@ const useSortHelper = config => {
210
206
  }
211
207
  });
212
208
  }
213
- onSortMove === null || onSortMove === void 0 || onSortMove({
209
+ onSortMove?.({
214
210
  collection: curManagedItem.info.collection,
215
211
  node: activeNode,
216
212
  oldIndex: activeNodeOldIndex,
@@ -220,12 +216,11 @@ const useSortHelper = config => {
220
216
 
221
217
  // Common handler for both mouse and touch end events
222
218
  const handleSortEnd = endEvent => {
223
- var _sortTouchMoveListene, _sortTouchEndListener;
224
219
  // Remove the event listeners
225
220
  sortMouseMoveListener.off();
226
221
  sortMouseEndListener.off();
227
- (_sortTouchMoveListene = sortTouchMoveListener) === null || _sortTouchMoveListene === void 0 || _sortTouchMoveListene.off();
228
- (_sortTouchEndListener = sortTouchEndListener) === null || _sortTouchEndListener === void 0 || _sortTouchEndListener.off();
222
+ sortTouchMoveListener?.off();
223
+ sortTouchEndListener?.off();
229
224
 
230
225
  // Enable page scrolling again
231
226
  if (document.body.style.overflow === 'hidden') {
@@ -243,10 +238,9 @@ const useSortHelper = config => {
243
238
 
244
239
  // wait for animation
245
240
  setTimeout(() => {
246
- var _activeNodeHelper2;
247
241
  if (!isMounted()) return;
248
242
  // Remove the helper from the DOM
249
- (_activeNodeHelper2 = activeNodeHelper) === null || _activeNodeHelper2 === void 0 || (_activeNodeHelper2 = _activeNodeHelper2.parentNode) === null || _activeNodeHelper2 === void 0 || _activeNodeHelper2.removeChild(activeNodeHelper);
243
+ activeNodeHelper?.parentNode?.removeChild(activeNodeHelper);
250
244
  activeNodeHelper = null;
251
245
 
252
246
  // Remove redundant styles
@@ -276,8 +270,8 @@ const useSortHelper = config => {
276
270
  newIndex: activeNodeNextIndex,
277
271
  oldIndex: activeNodeOldIndex
278
272
  };
279
- onSortEnd === null || onSortEnd === void 0 || onSortEnd(callbackPayload, endEvent);
280
- onSort === null || onSort === void 0 || onSort(callbackPayload, endEvent);
273
+ onSortEnd?.(callbackPayload, endEvent);
274
+ onSort?.(callbackPayload, endEvent);
281
275
  }, transitionDuration);
282
276
  };
283
277
 
@@ -305,7 +299,7 @@ const useSortHelper = config => {
305
299
  }
306
300
  setSorting(true);
307
301
  // start callback
308
- onSortStart === null || onSortStart === void 0 || onSortStart({
302
+ onSortStart?.({
309
303
  collection: curManagedItem.info.collection,
310
304
  node: activeNode,
311
305
  oldIndex: activeNodeOldIndex,
@@ -38,10 +38,10 @@ export type TextMaskProps = TextMaskBaseProps & React.HTMLAttributes<HTMLInputEl
38
38
  */
39
39
  declare const TextMask: React.ForwardRefExoticComponent<TextMaskBaseProps & React.HTMLAttributes<HTMLInputElement> & {
40
40
  /** Custom rendering DOM */
41
- render?: ((ref: React.Ref<HTMLInputElement>, props: React.HTMLAttributes<HTMLInputElement>) => any) | undefined;
42
- onChange?: ((event: React.ChangeEvent<HTMLInputElement>) => void) | undefined;
43
- value?: string | number | undefined;
44
- readOnly?: boolean | undefined;
45
- disabled?: boolean | undefined;
41
+ render?: (ref: React.Ref<HTMLInputElement>, props: React.HTMLAttributes<HTMLInputElement>) => any;
42
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
43
+ value?: string | number;
44
+ readOnly?: boolean;
45
+ disabled?: boolean;
46
46
  } & React.RefAttributes<HTMLInputElement>>;
47
47
  export default TextMask;
@@ -37,17 +37,15 @@ const TextMask = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
37
37
  const inputRef = (0, _react.useRef)(null);
38
38
  const textMaskInputElement = (0, _react.useRef)(null);
39
39
  const initTextMask = (0, _react.useCallback)(() => {
40
- var _textMaskInputElement;
41
40
  textMaskInputElement.current = (0, _createTextMaskInputElement.default)({
42
41
  inputElement: inputRef.current,
43
42
  ...props
44
43
  });
45
- (_textMaskInputElement = textMaskInputElement.current) === null || _textMaskInputElement === void 0 || _textMaskInputElement.update(value);
44
+ textMaskInputElement.current?.update(value);
46
45
  }, [props, value]);
47
46
  const handleChange = (0, _react.useCallback)(event => {
48
- var _textMaskInputElement2;
49
- (_textMaskInputElement2 = textMaskInputElement.current) === null || _textMaskInputElement2 === void 0 || _textMaskInputElement2.update();
50
- onChange === null || onChange === void 0 || onChange(event);
47
+ textMaskInputElement.current?.update();
48
+ onChange?.(event);
51
49
  }, [onChange]);
52
50
  (0, _react.useEffect)(() => {
53
51
  initTextMask();
@@ -1,5 +1,5 @@
1
1
  import { MaskType, ConfigType, MaskFunctionType } from './types';
2
- export declare function isArray(value: any): boolean;
2
+ export declare function isArray(value: any): value is any[];
3
3
  export default function conformToMask(rawValue?: string, mask?: MaskType | MaskFunctionType | any, config?: ConfigType): {
4
4
  conformedValue: string;
5
5
  meta: {
@@ -32,7 +32,6 @@ function createTextMaskInputElement(config) {
32
32
  keepCharPositions = false,
33
33
  showMask = false
34
34
  } = config) {
35
- var _pipeResults, _pipeResults2;
36
35
  // if `rawValue` is `undefined`, read from the `inputElement`
37
36
  if (typeof rawValue === 'undefined') {
38
37
  rawValue = inputElement.value;
@@ -166,7 +165,7 @@ function createTextMaskInputElement(config) {
166
165
 
167
166
  // Before we proceed, we need to know which conformed value to use, the one returned by the pipe or the one
168
167
  // returned by `conformToMask`.
169
- const finalConformedValue = piped ? (_pipeResults = pipeResults) === null || _pipeResults === void 0 ? void 0 : _pipeResults.value : conformedValue;
168
+ const finalConformedValue = piped ? pipeResults?.value : conformedValue;
170
169
 
171
170
  // After determining the conformed value, we will need to know where to set
172
171
  // the caret position. `adjustCaretPosition` will tell us.
@@ -178,7 +177,7 @@ function createTextMaskInputElement(config) {
178
177
  rawValue: safeRawValue,
179
178
  currentCaretPosition,
180
179
  placeholderChar,
181
- indexesOfPipedChars: (_pipeResults2 = pipeResults) === null || _pipeResults2 === void 0 ? void 0 : _pipeResults2.indexesOfPipedChars,
180
+ indexesOfPipedChars: pipeResults?.indexesOfPipedChars,
182
181
  caretTrapIndexes
183
182
  });
184
183