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.
- package/CHANGELOG.md +9 -0
- package/cjs/Affix/Affix.js +4 -4
- package/cjs/Animation/Collapse.js +4 -5
- package/cjs/Animation/Transition.d.ts +2 -2
- package/cjs/Animation/Transition.js +17 -20
- package/cjs/AutoComplete/AutoComplete.js +9 -9
- package/cjs/Avatar/useImage.js +1 -1
- package/cjs/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/cjs/Badge/Badge.js +1 -4
- package/cjs/Breadcrumb/Breadcrumb.js +4 -4
- package/cjs/Button/Button.js +6 -6
- package/cjs/Calendar/Calendar.js +5 -5
- package/cjs/Calendar/CalendarBody.js +1 -1
- package/cjs/Calendar/CalendarContainer.js +14 -33
- package/cjs/Calendar/CalendarHeader.js +7 -8
- package/cjs/Calendar/Grid/GridCell.js +2 -2
- package/cjs/Calendar/Grid/GridHeaderRow.js +1 -1
- package/cjs/Calendar/Grid/GridRow.js +5 -6
- package/cjs/Calendar/MonthDropdown/MonthDropdown.js +1 -1
- package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/cjs/Calendar/TimeDropdown/TimeDropdown.js +12 -14
- package/cjs/Calendar/hooks/useCalendar.d.ts +16 -17
- package/cjs/Calendar/hooks/useCalendar.js +2 -4
- package/cjs/Calendar/hooks/useCalendarDate.js +5 -9
- package/cjs/Calendar/hooks/useCalendarState.js +6 -12
- package/cjs/Calendar/types.d.ts +0 -1
- package/cjs/Carousel/Carousel.js +5 -6
- package/cjs/CascadeTree/CascadeTree.js +6 -16
- package/cjs/CascadeTree/TreeView.js +5 -7
- package/cjs/CascadeTree/hooks/useSearch.d.ts +0 -1
- package/cjs/CascadeTree/hooks/useSearch.js +1 -1
- package/cjs/CascadeTree/hooks/useSelect.d.ts +0 -1
- package/cjs/CascadeTree/hooks/useSelect.js +3 -4
- package/cjs/CascadeTree/types.d.ts +0 -1
- package/cjs/CascadeTree/utils.js +1 -2
- package/cjs/Cascader/Cascader.js +18 -29
- package/cjs/Cascader/useActive.d.ts +0 -1
- package/cjs/Cascader/useActive.js +4 -6
- package/cjs/CheckPicker/CheckPicker.js +14 -15
- package/cjs/CheckTree/CheckTree.js +1 -1
- package/cjs/CheckTree/CheckTreeNode.js +3 -4
- package/cjs/CheckTree/CheckTreeView.js +5 -5
- package/cjs/CheckTree/hooks/useTreeCheckState.js +2 -2
- package/cjs/CheckTree/utils.js +7 -16
- package/cjs/CheckTreePicker/CheckTreePicker.js +7 -7
- package/cjs/CheckTreePicker/hooks/useFocusState.d.ts +0 -1
- package/cjs/CheckTreePicker/hooks/useFocusState.js +3 -6
- package/cjs/Checkbox/Checkbox.js +4 -5
- package/cjs/Checkbox/hooks/useIndeterminateCheckbox.d.ts +0 -1
- package/cjs/Checkbox/hooks/useIndeterminateCheckbox.js +1 -1
- package/cjs/CheckboxGroup/CheckboxGroup.js +2 -2
- package/cjs/DOMHelper/index.d.ts +1 -2
- package/cjs/DOMHelper/isElement.js +1 -1
- package/cjs/DateInput/DateField.d.ts +122 -3
- package/cjs/DateInput/DateField.js +12 -15
- package/cjs/DateInput/DateInput.js +3 -4
- package/cjs/DateInput/hooks/useDateInputState.d.ts +124 -4
- package/cjs/DateInput/hooks/useDateInputState.js +2 -2
- package/cjs/DateInput/hooks/useIsFocused.js +2 -2
- package/cjs/DateInput/hooks/useKeyboardInputEvent.d.ts +0 -1
- package/cjs/DateInput/hooks/useKeyboardInputEvent.js +8 -9
- package/cjs/DateInput/hooks/useSelectedState.d.ts +0 -1
- package/cjs/DateInput/utils.d.ts +0 -1
- package/cjs/DateInput/utils.js +2 -3
- package/cjs/DatePicker/DatePicker.js +18 -25
- package/cjs/DatePicker/PredefinedRanges.js +3 -3
- package/cjs/DatePicker/Toolbar.js +4 -4
- package/cjs/DatePicker/hooks/useCustomizedInput.d.ts +0 -1
- package/cjs/DatePicker/hooks/useFocus.js +5 -8
- package/cjs/DatePicker/hooks/useMonthView.d.ts +0 -1
- package/cjs/DatePicker/hooks/useMonthView.js +1 -1
- package/cjs/DatePicker/utils.d.ts +1 -2
- package/cjs/DatePicker/utils.js +2 -2
- package/cjs/DateRangeInput/DateRangeInput.js +8 -9
- package/cjs/DateRangePicker/Calendar.js +2 -2
- package/cjs/DateRangePicker/DateRangePicker.js +25 -29
- package/cjs/DateRangePicker/Header.js +3 -3
- package/cjs/DateRangePicker/disabledDateUtils.js +2 -2
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.d.ts +0 -1
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/cjs/DateRangePicker/utils.js +1 -2
- package/cjs/Dropdown/Dropdown.js +3 -3
- package/cjs/Dropdown/DropdownItem.js +4 -5
- package/cjs/Dropdown/DropdownMenu.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.js +1 -1
- package/cjs/Form/Form.d.ts +1 -3
- package/cjs/Form/Form.js +9 -11
- package/cjs/Form/hooks/useFormRef.d.ts +0 -1
- package/cjs/Form/hooks/useFormValidate.d.ts +0 -1
- package/cjs/Form/hooks/useFormValidate.js +19 -19
- package/cjs/Form/hooks/useFormValue.d.ts +0 -1
- package/cjs/FormControl/FormControl.js +5 -5
- package/cjs/FormGroup/FormGroupContext.d.ts +1 -1
- package/cjs/Highlight/utils/highlightText.js +1 -1
- package/cjs/InlineEdit/renderChildren.js +5 -6
- package/cjs/InlineEdit/useEditState.js +9 -12
- package/cjs/InlineEdit/useFocusEvent.d.ts +0 -1
- package/cjs/InlineEdit/useFocusEvent.js +7 -11
- package/cjs/Input/Input.js +1 -1
- package/cjs/InputGroup/InputGroupContext.d.ts +2 -1
- package/cjs/InputNumber/index.d.ts +0 -1
- package/cjs/InputPicker/InputAutosize.js +1 -1
- package/cjs/InputPicker/InputPicker.js +30 -35
- package/cjs/InputPicker/InputSearch.js +1 -2
- package/cjs/InputPicker/hooks/useData.d.ts +0 -1
- package/cjs/InputPicker/hooks/useData.js +1 -1
- package/cjs/InputPicker/hooks/useInput.js +3 -6
- package/cjs/InputPicker/hooks/useMaxWidth.js +2 -4
- package/cjs/List/helper/AutoScroller.js +2 -4
- package/cjs/List/helper/useSortHelper.d.ts +4 -4
- package/cjs/List/helper/useSortHelper.js +13 -19
- package/cjs/MaskedInput/TextMask.d.ts +5 -5
- package/cjs/MaskedInput/TextMask.js +3 -5
- package/cjs/MaskedInput/conformToMask.d.ts +1 -1
- package/cjs/MaskedInput/createTextMaskInputElement.js +2 -3
- package/cjs/Menu/MenuItem.js +3 -4
- package/cjs/Message/Message.js +1 -1
- package/cjs/Modal/Modal.js +8 -10
- package/cjs/Modal/ModalBody.js +1 -1
- package/cjs/Modal/utils.d.ts +2 -3
- package/cjs/Modal/utils.js +2 -3
- package/cjs/MultiCascadeTree/SearchView.js +1 -1
- package/cjs/MultiCascadeTree/TreeView.js +2 -2
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.d.ts +0 -1
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.js +5 -8
- package/cjs/MultiCascadeTree/hooks/useColumnData.d.ts +0 -1
- package/cjs/MultiCascadeTree/hooks/useSearch.d.ts +0 -1
- package/cjs/MultiCascadeTree/hooks/useSearch.js +2 -2
- package/cjs/MultiCascadeTree/hooks/useSelect.js +3 -4
- package/cjs/MultiCascadeTree/types.d.ts +0 -1
- package/cjs/MultiCascadeTree/utils.d.ts +4 -4
- package/cjs/MultiCascadeTree/utils.js +2 -3
- package/cjs/MultiCascader/MultiCascader.js +13 -16
- package/cjs/Nav/AdaptiveNavItem.js +2 -3
- package/cjs/Nav/Nav.d.ts +1 -1
- package/cjs/Nav/Nav.js +4 -4
- package/cjs/Nav/NavDropdown.d.ts +1 -1
- package/cjs/Nav/NavDropdown.js +3 -3
- package/cjs/Nav/NavDropdownItem.js +2 -2
- package/cjs/Nav/NavDropdownMenu.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.js +1 -1
- package/cjs/Nav/NavItem.js +4 -4
- package/cjs/Navbar/Navbar.js +1 -1
- package/cjs/Navbar/NavbarContent.js +1 -1
- package/cjs/Navbar/NavbarDrawer.js +1 -1
- package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.js +3 -3
- package/cjs/Navbar/NavbarDropdownItem.js +5 -6
- package/cjs/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownMenu.js +1 -1
- package/cjs/Navbar/NavbarItem.js +4 -4
- package/cjs/Navbar/NavbarToggle.js +2 -2
- package/cjs/Notification/Notification.js +1 -1
- package/cjs/NumberInput/NumberInput.js +3 -3
- package/cjs/NumberInput/hooks/useEvents.d.ts +0 -1
- package/cjs/NumberInput/hooks/useEvents.js +2 -3
- package/cjs/NumberInput/hooks/useWheelHandler.js +1 -2
- package/cjs/Pagination/Pagination.js +1 -1
- package/cjs/Pagination/PaginationButton.js +1 -1
- package/cjs/Pagination/PaginationGroup.js +3 -4
- package/cjs/Panel/Panel.js +2 -2
- package/cjs/PanelGroup/PanelGroup.js +1 -1
- package/cjs/PasswordInput/PasswordInput.js +2 -2
- package/cjs/PinInput/PinInput.js +1 -1
- package/cjs/PinInput/hooks/usePinInputRefs.d.ts +0 -1
- package/cjs/PinInput/hooks/usePinInputRefs.js +2 -4
- package/cjs/PinInput/hooks/usePinValue.d.ts +1 -1
- package/cjs/PinInput/hooks/usePinValue.js +2 -2
- package/cjs/Progress/ProgressLine.js +1 -1
- package/cjs/Progress/types.d.ts +0 -1
- package/cjs/ProgressCircle/hooks/useProgressCirclePath.d.ts +0 -1
- package/cjs/Radio/Radio.js +3 -3
- package/cjs/RadioGroup/RadioGroup.js +1 -1
- package/cjs/RadioTile/RadioTile.js +2 -2
- package/cjs/RadioTileGroup/RadioTileGroup.js +1 -1
- package/cjs/RangeSlider/RangeSlider.js +6 -6
- package/cjs/Rate/Character.js +2 -2
- package/cjs/Rate/Rate.js +3 -3
- package/cjs/Rate/useRatingStates.d.ts +0 -1
- package/cjs/SegmentedControl/SegmentedControl.js +3 -3
- package/cjs/SegmentedControl/hooks/useIndicatorPosition.js +1 -1
- package/cjs/SelectPicker/SelectPicker.js +13 -16
- package/cjs/Sidebar/Sidebar.js +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdown.js +6 -6
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +4 -5
- package/cjs/Sidenav/Node.js +9 -16
- package/cjs/Sidenav/Sidenav.js +2 -2
- package/cjs/Sidenav/SidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdown.js +4 -4
- package/cjs/Sidenav/SidenavDropdownItem.js +3 -4
- package/cjs/Sidenav/SidenavItem.js +5 -6
- package/cjs/Sidenav/SidenavToggle.js +2 -2
- package/cjs/Slider/Slider.js +3 -3
- package/cjs/Slider/useDrag.d.ts +0 -1
- package/cjs/Slider/useDrag.js +7 -12
- package/cjs/Slider/utils.d.ts +1 -2
- package/cjs/Slider/utils.js +2 -3
- package/cjs/Steps/StepItem.js +1 -2
- package/cjs/Table/Table.d.ts +3 -3
- package/cjs/Tabs/Tabs.js +3 -4
- package/cjs/TimePicker/TimePicker.js +2 -2
- package/cjs/Timeline/Timeline.d.ts +1 -1
- package/cjs/Timeline/Timeline.js +1 -4
- package/cjs/Toggle/Toggle.js +2 -2
- package/cjs/Tree/Tree.js +2 -2
- package/cjs/Tree/TreeNode.js +10 -11
- package/cjs/Tree/TreeView.js +5 -5
- package/cjs/Tree/hooks/useExpandTree.js +1 -1
- package/cjs/Tree/hooks/useFlattenTree.js +1 -1
- package/cjs/Tree/hooks/useFocusTree.d.ts +1 -2
- package/cjs/Tree/hooks/useFocusTree.js +12 -14
- package/cjs/Tree/hooks/useTreeDrag.d.ts +0 -1
- package/cjs/Tree/hooks/useTreeDrag.js +10 -12
- package/cjs/Tree/hooks/useTreeNodeProps.js +1 -1
- package/cjs/Tree/hooks/useTreeSearch.js +4 -4
- package/cjs/Tree/hooks/useVirtualizedTreeData.js +2 -2
- package/cjs/Tree/types.d.ts +2 -3
- package/cjs/Tree/utils/flattenTree.d.ts +1 -1
- package/cjs/Tree/utils/focusableTree.js +5 -8
- package/cjs/Tree/utils/getNodeParentKeys.js +2 -4
- package/cjs/Tree/utils/hasVisibleChildren.d.ts +1 -1
- package/cjs/Tree/utils/treeKeyboardInteractions.js +3 -3
- package/cjs/TreePicker/TreePicker.js +8 -9
- package/cjs/TreePicker/hooks/useFocusState.d.ts +0 -1
- package/cjs/TreePicker/hooks/useFocusState.js +4 -8
- package/cjs/Uploader/UploadFileItem.js +8 -10
- package/cjs/Uploader/UploadTrigger.js +8 -10
- package/cjs/Uploader/Uploader.js +18 -24
- package/cjs/Uploader/utils/ajaxUpload.js +5 -5
- package/cjs/Uploader/utils/previewFile.js +1 -1
- package/cjs/internals/Disclosure/Disclosure.js +5 -8
- package/cjs/internals/Disclosure/DisclosureButton.js +2 -2
- package/cjs/internals/InputBase/InputBase.js +5 -6
- package/cjs/internals/Menu/Menu.js +16 -20
- package/cjs/internals/Menu/MenuItem.js +4 -5
- package/cjs/internals/Menu/Menubar.js +5 -7
- package/cjs/internals/Menu/useMenu.js +5 -10
- package/cjs/internals/Overlay/Modal.js +8 -11
- package/cjs/internals/Overlay/ModalManager.js +3 -5
- package/cjs/internals/Overlay/Overlay.js +1 -1
- package/cjs/internals/Overlay/OverlayTrigger.d.ts +0 -1
- package/cjs/internals/Overlay/OverlayTrigger.js +5 -7
- package/cjs/internals/Overlay/Position.js +6 -8
- package/cjs/internals/Picker/ListCheckItem.js +3 -3
- package/cjs/internals/Picker/ListItem.js +1 -1
- package/cjs/internals/Picker/Listbox.js +9 -10
- package/cjs/internals/Picker/PickerPopup.js +4 -5
- package/cjs/internals/Picker/PickerToggle.js +3 -4
- package/cjs/internals/Picker/SelectedElement.js +1 -1
- package/cjs/internals/Picker/hooks/useFocusItemValue.d.ts +0 -1
- package/cjs/internals/Picker/hooks/useFocusItemValue.js +14 -28
- package/cjs/internals/Picker/hooks/usePickerRef.d.ts +0 -1
- package/cjs/internals/Picker/hooks/usePickerRef.js +9 -15
- package/cjs/internals/Picker/hooks/useSearch.d.ts +0 -1
- package/cjs/internals/Picker/hooks/useSearch.js +2 -2
- package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.d.ts +0 -1
- package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.js +13 -17
- package/cjs/internals/Picker/utils.js +9 -9
- package/cjs/internals/Ripple/Ripple.js +3 -4
- package/cjs/internals/SafeAnchor/SafeAnchor.js +1 -1
- package/cjs/internals/ScrollView/hooks/useScrollState.d.ts +0 -1
- package/cjs/internals/ScrollView/hooks/useScrollState.js +2 -3
- package/cjs/internals/Tree/TreeProvider.d.ts +4 -4
- package/cjs/internals/Tree/TreeProvider.js +2 -8
- package/cjs/internals/Tree/types.d.ts +0 -1
- package/cjs/internals/Tree/utils/getParentMap.d.ts +0 -1
- package/cjs/internals/Windowing/AutoSizer.js +2 -3
- package/cjs/internals/Windowing/List.js +4 -8
- package/cjs/internals/constants/index.d.ts +2 -2
- package/cjs/internals/hooks/useClickOutside.js +2 -4
- package/cjs/internals/hooks/useCustom.d.ts +0 -1
- package/cjs/internals/hooks/useCustom.js +5 -7
- package/cjs/internals/hooks/useElementResize.d.ts +0 -1
- package/cjs/internals/hooks/useEventCallback.js +1 -2
- package/cjs/internals/hooks/useEventListener.js +1 -1
- package/cjs/internals/hooks/useFocus.js +2 -4
- package/cjs/internals/hooks/useFocusVirtualListItem.d.ts +0 -1
- package/cjs/internals/hooks/useMount.js +1 -2
- package/cjs/internals/hooks/useRootClose.js +6 -6
- package/cjs/internals/hooks/useTimeout.js +1 -2
- package/cjs/internals/hooks/useToggleCaret.d.ts +0 -1
- package/cjs/internals/hooks/useUniqueId.js +1 -1
- package/cjs/internals/hooks/useUpdatedRef.d.ts +0 -1
- package/cjs/internals/styled-system/style-manager.js +1 -1
- package/cjs/internals/styled-system/useStyled.js +2 -2
- package/cjs/internals/types/utils.d.ts +0 -1
- package/cjs/internals/utils/colours.d.ts +4 -4
- package/cjs/internals/utils/colours.js +1 -1
- package/cjs/internals/utils/date/disableTime.js +6 -12
- package/cjs/internals/utils/date/omitHideDisabledProps.d.ts +1 -1
- package/cjs/internals/utils/date/useDateMode.d.ts +1 -1
- package/cjs/internals/utils/react/ReactChildren.js +1 -2
- package/cjs/internals/utils/react/deprecateComponent.js +1 -2
- package/cjs/internals/utils/react/getDOMNode.js +4 -5
- package/cjs/internals/utils/sizes.d.ts +2 -2
- package/cjs/internals/utils/style-sheet/css.d.ts +0 -1
- package/cjs/internals/utils/style-sheet/css.js +1 -1
- package/cjs/internals/utils/style-sheet/prefix.d.ts +0 -1
- package/cjs/internals/utils/style-sheet/responsive.d.ts +1 -1
- package/cjs/internals/utils/style-sheet/styles.d.ts +3 -3
- package/cjs/internals/utils/style-sheet/styles.js +1 -1
- package/cjs/toaster/ToastContainer.js +3 -5
- package/cjs/toaster/hooks/useDelayedClosure.d.ts +0 -1
- package/cjs/toaster/hooks/useDelayedClosure.js +3 -4
- package/cjs/toaster/toaster.js +4 -12
- package/cjs/useDialog/Dialog.d.ts +1 -1
- package/cjs/useDialog/Dialog.js +1 -1
- package/cjs/useDialog/useDialog.d.ts +1 -1
- package/cjs/useDialog/useDialog.js +3 -3
- package/cjs/useFormControl/hooks/useField.d.ts +0 -1
- package/cjs/useFormControl/hooks/useField.js +5 -7
- package/cjs/useFormControl/hooks/useRegisterModel.js +2 -2
- package/cjs/useFormControl/useFormControl.js +8 -8
- package/cjs/useToaster/useToaster.js +4 -5
- package/dist/rsuite.js +223 -223
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Affix/Affix.js +4 -4
- package/esm/Animation/Collapse.js +1 -2
- package/esm/Animation/Transition.d.ts +2 -2
- package/esm/Animation/Transition.js +17 -20
- package/esm/AutoComplete/AutoComplete.js +9 -9
- package/esm/Avatar/useImage.js +1 -1
- package/esm/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/esm/Badge/Badge.js +1 -4
- package/esm/Breadcrumb/Breadcrumb.js +4 -4
- package/esm/Button/Button.js +6 -6
- package/esm/Calendar/Calendar.js +5 -5
- package/esm/Calendar/CalendarBody.js +1 -1
- package/esm/Calendar/CalendarContainer.js +14 -33
- package/esm/Calendar/CalendarHeader.js +7 -8
- package/esm/Calendar/Grid/GridCell.js +2 -2
- package/esm/Calendar/Grid/GridHeaderRow.js +1 -1
- package/esm/Calendar/Grid/GridRow.js +5 -6
- package/esm/Calendar/MonthDropdown/MonthDropdown.js +1 -1
- package/esm/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/esm/Calendar/TimeDropdown/TimeDropdown.js +12 -14
- package/esm/Calendar/hooks/useCalendar.d.ts +16 -17
- package/esm/Calendar/hooks/useCalendar.js +2 -4
- package/esm/Calendar/hooks/useCalendarDate.js +5 -9
- package/esm/Calendar/hooks/useCalendarState.js +6 -12
- package/esm/Calendar/types.d.ts +0 -1
- package/esm/Carousel/Carousel.js +5 -6
- package/esm/CascadeTree/CascadeTree.js +6 -16
- package/esm/CascadeTree/TreeView.js +5 -7
- package/esm/CascadeTree/hooks/useSearch.d.ts +0 -1
- package/esm/CascadeTree/hooks/useSearch.js +1 -1
- package/esm/CascadeTree/hooks/useSelect.d.ts +0 -1
- package/esm/CascadeTree/hooks/useSelect.js +3 -4
- package/esm/CascadeTree/types.d.ts +0 -1
- package/esm/CascadeTree/utils.js +1 -2
- package/esm/Cascader/Cascader.js +18 -29
- package/esm/Cascader/useActive.d.ts +0 -1
- package/esm/Cascader/useActive.js +4 -6
- package/esm/CheckPicker/CheckPicker.js +14 -15
- package/esm/CheckTree/CheckTree.js +1 -1
- package/esm/CheckTree/CheckTreeNode.js +3 -4
- package/esm/CheckTree/CheckTreeView.js +5 -5
- package/esm/CheckTree/hooks/useTreeCheckState.js +2 -2
- package/esm/CheckTree/utils.js +7 -16
- package/esm/CheckTreePicker/CheckTreePicker.js +7 -7
- package/esm/CheckTreePicker/hooks/useFocusState.d.ts +0 -1
- package/esm/CheckTreePicker/hooks/useFocusState.js +3 -6
- package/esm/Checkbox/Checkbox.js +4 -5
- package/esm/Checkbox/hooks/useIndeterminateCheckbox.d.ts +0 -1
- package/esm/Checkbox/hooks/useIndeterminateCheckbox.js +1 -1
- package/esm/CheckboxGroup/CheckboxGroup.js +2 -2
- package/esm/DOMHelper/index.d.ts +1 -2
- package/esm/DOMHelper/isElement.js +1 -1
- package/esm/DateInput/DateField.d.ts +122 -3
- package/esm/DateInput/DateField.js +12 -15
- package/esm/DateInput/DateInput.js +3 -4
- package/esm/DateInput/hooks/useDateInputState.d.ts +124 -4
- package/esm/DateInput/hooks/useDateInputState.js +2 -2
- package/esm/DateInput/hooks/useIsFocused.js +2 -2
- package/esm/DateInput/hooks/useKeyboardInputEvent.d.ts +0 -1
- package/esm/DateInput/hooks/useKeyboardInputEvent.js +8 -9
- package/esm/DateInput/hooks/useSelectedState.d.ts +0 -1
- package/esm/DateInput/utils.d.ts +0 -1
- package/esm/DateInput/utils.js +2 -3
- package/esm/DatePicker/DatePicker.js +18 -25
- package/esm/DatePicker/PredefinedRanges.js +3 -3
- package/esm/DatePicker/Toolbar.js +4 -4
- package/esm/DatePicker/hooks/useCustomizedInput.d.ts +0 -1
- package/esm/DatePicker/hooks/useFocus.js +5 -8
- package/esm/DatePicker/hooks/useMonthView.d.ts +0 -1
- package/esm/DatePicker/hooks/useMonthView.js +1 -1
- package/esm/DatePicker/utils.d.ts +1 -2
- package/esm/DatePicker/utils.js +2 -2
- package/esm/DateRangeInput/DateRangeInput.js +8 -9
- package/esm/DateRangePicker/Calendar.js +2 -2
- package/esm/DateRangePicker/DateRangePicker.js +25 -29
- package/esm/DateRangePicker/Header.js +3 -3
- package/esm/DateRangePicker/disabledDateUtils.js +2 -2
- package/esm/DateRangePicker/hooks/useCalendarHandlers.d.ts +0 -1
- package/esm/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/esm/DateRangePicker/utils.js +1 -2
- package/esm/Dropdown/Dropdown.js +3 -3
- package/esm/Dropdown/DropdownItem.js +4 -5
- package/esm/Dropdown/DropdownMenu.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.js +1 -1
- package/esm/Form/Form.d.ts +1 -3
- package/esm/Form/Form.js +9 -11
- package/esm/Form/hooks/useFormRef.d.ts +0 -1
- package/esm/Form/hooks/useFormValidate.d.ts +0 -1
- package/esm/Form/hooks/useFormValidate.js +19 -19
- package/esm/Form/hooks/useFormValue.d.ts +0 -1
- package/esm/FormControl/FormControl.js +5 -5
- package/esm/FormGroup/FormGroupContext.d.ts +1 -1
- package/esm/Highlight/utils/highlightText.js +1 -1
- package/esm/InlineEdit/renderChildren.js +5 -6
- package/esm/InlineEdit/useEditState.js +9 -12
- package/esm/InlineEdit/useFocusEvent.d.ts +0 -1
- package/esm/InlineEdit/useFocusEvent.js +7 -11
- package/esm/Input/Input.js +1 -1
- package/esm/InputGroup/InputGroupContext.d.ts +2 -1
- package/esm/InputNumber/index.d.ts +0 -1
- package/esm/InputPicker/InputAutosize.js +1 -1
- package/esm/InputPicker/InputPicker.js +30 -35
- package/esm/InputPicker/InputSearch.js +1 -2
- package/esm/InputPicker/hooks/useData.d.ts +0 -1
- package/esm/InputPicker/hooks/useData.js +1 -1
- package/esm/InputPicker/hooks/useInput.js +3 -6
- package/esm/InputPicker/hooks/useMaxWidth.js +2 -4
- package/esm/List/helper/AutoScroller.js +2 -4
- package/esm/List/helper/useSortHelper.d.ts +4 -4
- package/esm/List/helper/useSortHelper.js +13 -19
- package/esm/MaskedInput/TextMask.d.ts +5 -5
- package/esm/MaskedInput/TextMask.js +3 -5
- package/esm/MaskedInput/conformToMask.d.ts +1 -1
- package/esm/MaskedInput/createTextMaskInputElement.js +2 -3
- package/esm/Menu/MenuItem.js +3 -4
- package/esm/Message/Message.js +1 -1
- package/esm/Modal/Modal.js +8 -10
- package/esm/Modal/ModalBody.js +1 -1
- package/esm/Modal/utils.d.ts +2 -3
- package/esm/Modal/utils.js +2 -3
- package/esm/MultiCascadeTree/SearchView.js +1 -1
- package/esm/MultiCascadeTree/TreeView.js +2 -2
- package/esm/MultiCascadeTree/hooks/useCascadeValue.d.ts +0 -1
- package/esm/MultiCascadeTree/hooks/useCascadeValue.js +5 -8
- package/esm/MultiCascadeTree/hooks/useColumnData.d.ts +0 -1
- package/esm/MultiCascadeTree/hooks/useSearch.d.ts +0 -1
- package/esm/MultiCascadeTree/hooks/useSearch.js +2 -2
- package/esm/MultiCascadeTree/hooks/useSelect.js +3 -4
- package/esm/MultiCascadeTree/types.d.ts +0 -1
- package/esm/MultiCascadeTree/utils.d.ts +4 -4
- package/esm/MultiCascadeTree/utils.js +2 -3
- package/esm/MultiCascader/MultiCascader.js +13 -16
- package/esm/Nav/AdaptiveNavItem.js +2 -3
- package/esm/Nav/Nav.d.ts +1 -1
- package/esm/Nav/Nav.js +4 -4
- package/esm/Nav/NavDropdown.d.ts +1 -1
- package/esm/Nav/NavDropdown.js +3 -3
- package/esm/Nav/NavDropdownItem.js +2 -2
- package/esm/Nav/NavDropdownMenu.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.js +1 -1
- package/esm/Nav/NavItem.js +4 -4
- package/esm/Navbar/Navbar.js +1 -1
- package/esm/Navbar/NavbarContent.js +1 -1
- package/esm/Navbar/NavbarDrawer.js +1 -1
- package/esm/Navbar/NavbarDropdown.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.js +3 -3
- package/esm/Navbar/NavbarDropdownItem.js +5 -6
- package/esm/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownMenu.js +1 -1
- package/esm/Navbar/NavbarItem.js +4 -4
- package/esm/Navbar/NavbarToggle.js +2 -2
- package/esm/Notification/Notification.js +1 -1
- package/esm/NumberInput/NumberInput.js +3 -3
- package/esm/NumberInput/hooks/useEvents.d.ts +0 -1
- package/esm/NumberInput/hooks/useEvents.js +2 -3
- package/esm/NumberInput/hooks/useWheelHandler.js +1 -2
- package/esm/Pagination/Pagination.js +1 -1
- package/esm/Pagination/PaginationButton.js +1 -1
- package/esm/Pagination/PaginationGroup.js +3 -4
- package/esm/Panel/Panel.js +2 -2
- package/esm/PanelGroup/PanelGroup.js +1 -1
- package/esm/PasswordInput/PasswordInput.js +2 -2
- package/esm/PinInput/PinInput.js +1 -1
- package/esm/PinInput/hooks/usePinInputRefs.d.ts +0 -1
- package/esm/PinInput/hooks/usePinInputRefs.js +2 -4
- package/esm/PinInput/hooks/usePinValue.d.ts +1 -1
- package/esm/PinInput/hooks/usePinValue.js +2 -2
- package/esm/Progress/ProgressLine.js +1 -1
- package/esm/Progress/types.d.ts +0 -1
- package/esm/ProgressCircle/hooks/useProgressCirclePath.d.ts +0 -1
- package/esm/Radio/Radio.js +3 -3
- package/esm/RadioGroup/RadioGroup.js +1 -1
- package/esm/RadioTile/RadioTile.js +2 -2
- package/esm/RadioTileGroup/RadioTileGroup.js +1 -1
- package/esm/RangeSlider/RangeSlider.js +6 -6
- package/esm/Rate/Character.js +2 -2
- package/esm/Rate/Rate.js +3 -3
- package/esm/Rate/useRatingStates.d.ts +0 -1
- package/esm/SegmentedControl/SegmentedControl.js +3 -3
- package/esm/SegmentedControl/hooks/useIndicatorPosition.js +1 -1
- package/esm/SelectPicker/SelectPicker.js +13 -16
- package/esm/Sidebar/Sidebar.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdown.js +6 -6
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +4 -5
- package/esm/Sidenav/Node.js +9 -16
- package/esm/Sidenav/Sidenav.js +2 -2
- package/esm/Sidenav/SidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdown.js +4 -4
- package/esm/Sidenav/SidenavDropdownItem.js +3 -4
- package/esm/Sidenav/SidenavItem.js +5 -6
- package/esm/Sidenav/SidenavToggle.js +2 -2
- package/esm/Slider/Slider.js +3 -3
- package/esm/Slider/useDrag.d.ts +0 -1
- package/esm/Slider/useDrag.js +7 -12
- package/esm/Slider/utils.d.ts +1 -2
- package/esm/Slider/utils.js +2 -3
- package/esm/Steps/StepItem.js +1 -2
- package/esm/Table/Table.d.ts +3 -3
- package/esm/Tabs/Tabs.js +3 -4
- package/esm/TimePicker/TimePicker.js +2 -2
- package/esm/Timeline/Timeline.d.ts +1 -1
- package/esm/Timeline/Timeline.js +1 -4
- package/esm/Toggle/Toggle.js +2 -2
- package/esm/Tree/Tree.js +2 -2
- package/esm/Tree/TreeNode.js +10 -11
- package/esm/Tree/TreeView.js +5 -5
- package/esm/Tree/hooks/useExpandTree.js +1 -1
- package/esm/Tree/hooks/useFlattenTree.js +1 -1
- package/esm/Tree/hooks/useFocusTree.d.ts +1 -2
- package/esm/Tree/hooks/useFocusTree.js +12 -14
- package/esm/Tree/hooks/useTreeDrag.d.ts +0 -1
- package/esm/Tree/hooks/useTreeDrag.js +10 -12
- package/esm/Tree/hooks/useTreeNodeProps.js +1 -1
- package/esm/Tree/hooks/useTreeSearch.js +4 -4
- package/esm/Tree/hooks/useVirtualizedTreeData.js +2 -2
- package/esm/Tree/types.d.ts +2 -3
- package/esm/Tree/utils/flattenTree.d.ts +1 -1
- package/esm/Tree/utils/focusableTree.js +5 -8
- package/esm/Tree/utils/getNodeParentKeys.js +2 -4
- package/esm/Tree/utils/hasVisibleChildren.d.ts +1 -1
- package/esm/Tree/utils/treeKeyboardInteractions.js +3 -3
- package/esm/TreePicker/TreePicker.js +8 -9
- package/esm/TreePicker/hooks/useFocusState.d.ts +0 -1
- package/esm/TreePicker/hooks/useFocusState.js +4 -8
- package/esm/Uploader/UploadFileItem.js +8 -10
- package/esm/Uploader/UploadTrigger.js +8 -10
- package/esm/Uploader/Uploader.js +18 -24
- package/esm/Uploader/utils/ajaxUpload.js +5 -5
- package/esm/Uploader/utils/previewFile.js +1 -1
- package/esm/internals/Disclosure/Disclosure.js +5 -8
- package/esm/internals/Disclosure/DisclosureButton.js +2 -2
- package/esm/internals/InputBase/InputBase.js +5 -6
- package/esm/internals/Menu/Menu.js +16 -20
- package/esm/internals/Menu/MenuItem.js +4 -5
- package/esm/internals/Menu/Menubar.js +5 -7
- package/esm/internals/Menu/useMenu.js +5 -10
- package/esm/internals/Overlay/Modal.js +8 -11
- package/esm/internals/Overlay/ModalManager.js +3 -5
- package/esm/internals/Overlay/Overlay.js +1 -1
- package/esm/internals/Overlay/OverlayTrigger.d.ts +0 -1
- package/esm/internals/Overlay/OverlayTrigger.js +5 -7
- package/esm/internals/Overlay/Position.js +6 -8
- package/esm/internals/Picker/ListCheckItem.js +3 -3
- package/esm/internals/Picker/ListItem.js +1 -1
- package/esm/internals/Picker/Listbox.js +9 -10
- package/esm/internals/Picker/PickerPopup.js +4 -5
- package/esm/internals/Picker/PickerToggle.js +3 -4
- package/esm/internals/Picker/SelectedElement.js +1 -1
- package/esm/internals/Picker/hooks/useFocusItemValue.d.ts +0 -1
- package/esm/internals/Picker/hooks/useFocusItemValue.js +14 -28
- package/esm/internals/Picker/hooks/usePickerRef.d.ts +0 -1
- package/esm/internals/Picker/hooks/usePickerRef.js +9 -15
- package/esm/internals/Picker/hooks/useSearch.d.ts +0 -1
- package/esm/internals/Picker/hooks/useSearch.js +2 -2
- package/esm/internals/Picker/hooks/useToggleKeyDownEvent.d.ts +0 -1
- package/esm/internals/Picker/hooks/useToggleKeyDownEvent.js +13 -17
- package/esm/internals/Picker/utils.js +9 -9
- package/esm/internals/Ripple/Ripple.js +3 -4
- package/esm/internals/SafeAnchor/SafeAnchor.js +1 -1
- package/esm/internals/ScrollView/hooks/useScrollState.d.ts +0 -1
- package/esm/internals/ScrollView/hooks/useScrollState.js +2 -3
- package/esm/internals/Tree/TreeProvider.d.ts +4 -4
- package/esm/internals/Tree/TreeProvider.js +2 -8
- package/esm/internals/Tree/types.d.ts +0 -1
- package/esm/internals/Tree/utils/getParentMap.d.ts +0 -1
- package/esm/internals/Windowing/AutoSizer.js +2 -3
- package/esm/internals/Windowing/List.js +4 -8
- package/esm/internals/constants/index.d.ts +2 -2
- package/esm/internals/hooks/useClickOutside.js +2 -4
- package/esm/internals/hooks/useCustom.d.ts +0 -1
- package/esm/internals/hooks/useCustom.js +5 -7
- package/esm/internals/hooks/useElementResize.d.ts +0 -1
- package/esm/internals/hooks/useEventCallback.js +1 -2
- package/esm/internals/hooks/useEventListener.js +1 -1
- package/esm/internals/hooks/useFocus.js +2 -4
- package/esm/internals/hooks/useFocusVirtualListItem.d.ts +0 -1
- package/esm/internals/hooks/useMount.js +1 -2
- package/esm/internals/hooks/useRootClose.js +6 -6
- package/esm/internals/hooks/useTimeout.js +1 -2
- package/esm/internals/hooks/useToggleCaret.d.ts +0 -1
- package/esm/internals/hooks/useUniqueId.js +1 -1
- package/esm/internals/hooks/useUpdatedRef.d.ts +0 -1
- package/esm/internals/styled-system/style-manager.js +1 -1
- package/esm/internals/styled-system/useStyled.js +2 -2
- package/esm/internals/types/utils.d.ts +0 -1
- package/esm/internals/utils/colours.d.ts +4 -4
- package/esm/internals/utils/colours.js +1 -1
- package/esm/internals/utils/date/disableTime.js +6 -12
- package/esm/internals/utils/date/omitHideDisabledProps.d.ts +1 -1
- package/esm/internals/utils/date/useDateMode.d.ts +1 -1
- package/esm/internals/utils/react/ReactChildren.js +1 -2
- package/esm/internals/utils/react/deprecateComponent.js +1 -2
- package/esm/internals/utils/react/getDOMNode.js +4 -5
- package/esm/internals/utils/sizes.d.ts +2 -2
- package/esm/internals/utils/style-sheet/css.d.ts +0 -1
- package/esm/internals/utils/style-sheet/css.js +1 -1
- package/esm/internals/utils/style-sheet/prefix.d.ts +0 -1
- package/esm/internals/utils/style-sheet/responsive.d.ts +1 -1
- package/esm/internals/utils/style-sheet/styles.d.ts +3 -3
- package/esm/internals/utils/style-sheet/styles.js +1 -1
- package/esm/toaster/ToastContainer.js +3 -5
- package/esm/toaster/hooks/useDelayedClosure.d.ts +0 -1
- package/esm/toaster/hooks/useDelayedClosure.js +3 -4
- package/esm/toaster/toaster.js +4 -12
- package/esm/useDialog/Dialog.d.ts +1 -1
- package/esm/useDialog/Dialog.js +1 -1
- package/esm/useDialog/useDialog.d.ts +1 -1
- package/esm/useDialog/useDialog.js +3 -3
- package/esm/useFormControl/hooks/useField.d.ts +0 -1
- package/esm/useFormControl/hooks/useField.js +5 -7
- package/esm/useFormControl/hooks/useRegisterModel.js +2 -2
- package/esm/useFormControl/useFormControl.js +8 -8
- package/esm/useToaster/useToaster.js +4 -5
- package/package.json +1 -1
|
@@ -9,9 +9,8 @@ export function useFocus(elementRef) {
|
|
|
9
9
|
const grab = useCallback(() => {
|
|
10
10
|
requestAnimationFrame(() => {
|
|
11
11
|
if (document.activeElement !== elementRef.current) {
|
|
12
|
-
var _elementRef$current;
|
|
13
12
|
previousActiveElementRef.current = document.activeElement;
|
|
14
|
-
|
|
13
|
+
elementRef.current?.focus();
|
|
15
14
|
}
|
|
16
15
|
});
|
|
17
16
|
}, [elementRef]);
|
|
@@ -19,8 +18,7 @@ export function useFocus(elementRef) {
|
|
|
19
18
|
// Return focus to previous active element
|
|
20
19
|
const release = useCallback(options => {
|
|
21
20
|
requestAnimationFrame(() => {
|
|
22
|
-
|
|
23
|
-
(_previousActiveElemen = previousActiveElementRef.current) === null || _previousActiveElemen === void 0 || _previousActiveElemen.focus(options);
|
|
21
|
+
previousActiveElementRef.current?.focus(options);
|
|
24
22
|
});
|
|
25
23
|
}, []);
|
|
26
24
|
return {
|
|
@@ -4,8 +4,7 @@ export const useMount = callback => {
|
|
|
4
4
|
const mountRef = useRef(callback);
|
|
5
5
|
mountRef.current = callback;
|
|
6
6
|
useEffect(() => {
|
|
7
|
-
|
|
8
|
-
(_mountRef$current = mountRef.current) === null || _mountRef$current === void 0 || _mountRef$current.call(mountRef);
|
|
7
|
+
mountRef.current?.();
|
|
9
8
|
}, []);
|
|
10
9
|
};
|
|
11
10
|
export default useMount;
|
|
@@ -6,10 +6,10 @@ import on from 'dom-lib/on';
|
|
|
6
6
|
import { getDOMNode } from "../utils/index.js";
|
|
7
7
|
import { KEY_VALUES } from "../constants/index.js";
|
|
8
8
|
function isLeftClickEvent(event) {
|
|
9
|
-
return
|
|
9
|
+
return event?.button === 0;
|
|
10
10
|
}
|
|
11
11
|
function isModifiedEvent(event) {
|
|
12
|
-
return !!(event.metaKey || event.altKey || event.ctrlKey || event
|
|
12
|
+
return !!(event.metaKey || event.altKey || event.ctrlKey || event?.shiftKey);
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* A hook that listens to the document click event and closes the overlay.
|
|
@@ -25,7 +25,7 @@ export function useRootClose(onRootClose, {
|
|
|
25
25
|
}) {
|
|
26
26
|
const handleDocumentKeyUp = useCallback(event => {
|
|
27
27
|
if (listenEscape && event.key === KEY_VALUES.ESC) {
|
|
28
|
-
onRootClose
|
|
28
|
+
onRootClose?.(event);
|
|
29
29
|
}
|
|
30
30
|
}, [listenEscape, onRootClose]);
|
|
31
31
|
const handleDocumentMouseDown = useCallback(event => {
|
|
@@ -44,7 +44,7 @@ export function useRootClose(onRootClose, {
|
|
|
44
44
|
if (isModifiedEvent(event) || !isLeftClickEvent(event)) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
onRootClose
|
|
47
|
+
onRootClose?.(event);
|
|
48
48
|
}, [onRootClose, triggerTarget, overlayTarget]);
|
|
49
49
|
useEffect(() => {
|
|
50
50
|
const currentTarget = getDOMNode(triggerTarget);
|
|
@@ -53,8 +53,8 @@ export function useRootClose(onRootClose, {
|
|
|
53
53
|
const onDocumentMouseDownListener = on(doc, 'mousedown', handleDocumentMouseDown, true);
|
|
54
54
|
const onDocumentKeyupListener = on(doc, 'keyup', handleDocumentKeyUp);
|
|
55
55
|
return () => {
|
|
56
|
-
onDocumentMouseDownListener
|
|
57
|
-
onDocumentKeyupListener
|
|
56
|
+
onDocumentMouseDownListener?.off();
|
|
57
|
+
onDocumentKeyupListener?.off();
|
|
58
58
|
};
|
|
59
59
|
}, [triggerTarget, disabled, onRootClose, handleDocumentMouseDown, handleDocumentKeyUp]);
|
|
60
60
|
}
|
|
@@ -16,8 +16,7 @@ export function useTimeout(fn, ms = 0, enabled = true) {
|
|
|
16
16
|
timeout.current && clearTimeout(timeout.current);
|
|
17
17
|
if (enabled) {
|
|
18
18
|
timeout.current = setTimeout(() => {
|
|
19
|
-
|
|
20
|
-
(_callback$current = callback.current) === null || _callback$current === void 0 || _callback$current.call(callback);
|
|
19
|
+
callback.current?.();
|
|
21
20
|
}, ms);
|
|
22
21
|
}
|
|
23
22
|
}, [ms, enabled]);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PlacementCorners, Placement } from '../types';
|
|
3
2
|
export declare function useToggleCaret(placement: PlacementCorners | Placement): import("react").ForwardRefExoticComponent<Omit<import("@rsuite/icons/esm/Icon").IconProps, "ref"> & import("react").RefAttributes<SVGElement>>;
|
|
4
3
|
export default useToggleCaret;
|
|
@@ -8,6 +8,6 @@ import { useId } from 'react';
|
|
|
8
8
|
*/
|
|
9
9
|
export function useUniqueId(prefix, idProp) {
|
|
10
10
|
const generatedId = useId();
|
|
11
|
-
return idProp
|
|
11
|
+
return idProp ?? `${prefix}${generatedId}`;
|
|
12
12
|
}
|
|
13
13
|
export default useUniqueId;
|
|
@@ -24,7 +24,7 @@ export const StyleManager = {
|
|
|
24
24
|
this.styleElement.setAttribute('data-rs-style-manager', '');
|
|
25
25
|
|
|
26
26
|
// Apply CSP nonce if provided
|
|
27
|
-
const nonce =
|
|
27
|
+
const nonce = options?.nonce || this.nonce;
|
|
28
28
|
if (nonce) {
|
|
29
29
|
this.styleElement.setAttribute('nonce', nonce);
|
|
30
30
|
this.nonce = nonce; // Store for future use
|
|
@@ -98,7 +98,7 @@ export function useStyled(options) {
|
|
|
98
98
|
|
|
99
99
|
// Add the base rule to the style manager
|
|
100
100
|
StyleManager.addRule(`.${componentId}`, baseCssRules, {
|
|
101
|
-
nonce: csp
|
|
101
|
+
nonce: csp?.nonce
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
// Process responsive variables
|
|
@@ -163,7 +163,7 @@ export function useStyled(options) {
|
|
|
163
163
|
const bp = breakpoint;
|
|
164
164
|
const minWidth = breakpointValues[bp];
|
|
165
165
|
StyleManager.addRule(`@media (min-width: ${minWidth}px)`, `.${componentId} { ${rules} }`, {
|
|
166
|
-
nonce: csp
|
|
166
|
+
nonce: csp?.nonce
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
});
|
|
@@ -6,9 +6,9 @@ import { Color } from '../types/colours';
|
|
|
6
6
|
* @returns The CSS variable if it's a valid color type, or the original value
|
|
7
7
|
*/
|
|
8
8
|
export declare const getColorValue: (color: Color | string | undefined) => string | undefined;
|
|
9
|
-
export declare const isPresetColor: (color?: Color | React.CSSProperties[
|
|
10
|
-
export declare const getColorStyle: (value?: import("csstype").Property.Color | undefined, name?: string
|
|
11
|
-
[x: string]: string |
|
|
9
|
+
export declare const isPresetColor: (color?: Color | React.CSSProperties["color"]) => boolean;
|
|
10
|
+
export declare const getColorStyle: (value?: import("csstype").Property.Color | undefined, name?: string, prop?: string) => {
|
|
11
|
+
[x: string]: string | undefined;
|
|
12
12
|
} | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* Convert short hex color to full hex color
|
|
@@ -28,4 +28,4 @@ export declare const getContrastText: (bgColor: string) => string;
|
|
|
28
28
|
* Create CSS color variables for custom colors
|
|
29
29
|
* Returns background and optional text color variables
|
|
30
30
|
*/
|
|
31
|
-
export declare const createColorVariables: (color?: Color | React.CSSProperties[
|
|
31
|
+
export declare const createColorVariables: (color?: Color | React.CSSProperties["color"], bgFieldName?: string, textFieldName?: string) => React.CSSProperties | undefined;
|
|
@@ -19,7 +19,7 @@ export const getColorValue = color => {
|
|
|
19
19
|
|
|
20
20
|
// Check if color is a color with shade (e.g., 'red.50', 'gray.900')
|
|
21
21
|
const colorWithShadeRegex = /^(red|orange|yellow|green|cyan|blue|violet|gray)\.([1-9]00|50)$/;
|
|
22
|
-
const match = color
|
|
22
|
+
const match = color?.match(colorWithShadeRegex);
|
|
23
23
|
if (match) {
|
|
24
24
|
const [, colorName, shade] = match;
|
|
25
25
|
return `var(--rs-${colorName}-${shade})`;
|
|
@@ -27,16 +27,13 @@ export function disableTime(props, date) {
|
|
|
27
27
|
const mapProps = new Map(Object.entries(calendarProps));
|
|
28
28
|
return Array.from(mapProps.keys()).some(key => {
|
|
29
29
|
if (HOURS_PATTERN.test(key)) {
|
|
30
|
-
|
|
31
|
-
return (_mapProps$get = mapProps.get(key)) === null || _mapProps$get === void 0 ? void 0 : _mapProps$get(getHours(date), date);
|
|
30
|
+
return mapProps.get(key)?.(getHours(date), date);
|
|
32
31
|
}
|
|
33
32
|
if (MINUTES_PATTERN.test(key)) {
|
|
34
|
-
|
|
35
|
-
return (_mapProps$get2 = mapProps.get(key)) === null || _mapProps$get2 === void 0 ? void 0 : _mapProps$get2(getMinutes(date), date);
|
|
33
|
+
return mapProps.get(key)?.(getMinutes(date), date);
|
|
36
34
|
}
|
|
37
35
|
if (SECONDS_PATTERN.test(key)) {
|
|
38
|
-
|
|
39
|
-
return (_mapProps$get3 = mapProps.get(key)) === null || _mapProps$get3 === void 0 ? void 0 : _mapProps$get3(getSeconds(date), date);
|
|
36
|
+
return mapProps.get(key)?.(getSeconds(date), date);
|
|
40
37
|
}
|
|
41
38
|
return false;
|
|
42
39
|
});
|
|
@@ -53,16 +50,13 @@ export function useIsDateTimeDisabled(timeDropdownProps) {
|
|
|
53
50
|
const date = pick(dateTime, ['year', 'month', 'day']);
|
|
54
51
|
return Array.from(mapProps.keys()).some(key => {
|
|
55
52
|
if (HOURS_PATTERN.test(key)) {
|
|
56
|
-
|
|
57
|
-
return (_mapProps$get4 = mapProps.get(key)) === null || _mapProps$get4 === void 0 ? void 0 : _mapProps$get4(dateTime.hour, date);
|
|
53
|
+
return mapProps.get(key)?.(dateTime.hour, date);
|
|
58
54
|
}
|
|
59
55
|
if (MINUTES_PATTERN.test(key)) {
|
|
60
|
-
|
|
61
|
-
return (_mapProps$get5 = mapProps.get(key)) === null || _mapProps$get5 === void 0 ? void 0 : _mapProps$get5(dateTime.minute, date);
|
|
56
|
+
return mapProps.get(key)?.(dateTime.minute, date);
|
|
62
57
|
}
|
|
63
58
|
if (SECONDS_PATTERN.test(key)) {
|
|
64
|
-
|
|
65
|
-
return (_mapProps$get6 = mapProps.get(key)) === null || _mapProps$get6 === void 0 ? void 0 : _mapProps$get6(dateTime.second, date);
|
|
59
|
+
return mapProps.get(key)?.(dateTime.second, date);
|
|
66
60
|
}
|
|
67
61
|
return false;
|
|
68
62
|
});
|
|
@@ -6,5 +6,5 @@ type CalendarOnlyPropsType = TimeProp;
|
|
|
6
6
|
* @param props - The object to omit props from.
|
|
7
7
|
* @returns The object with calendar-only props omitted.
|
|
8
8
|
*/
|
|
9
|
-
export declare const omitHideDisabledProps: <T extends Record<string, any>>(props: T) => Partial<Omit<T,
|
|
9
|
+
export declare const omitHideDisabledProps: <T extends Record<string, any>>(props: T) => Partial<Omit<T, CalendarOnlyPropsType>>;
|
|
10
10
|
export default omitHideDisabledProps;
|
|
@@ -10,8 +10,7 @@ import { isFragment } from "./ReactIs.js";
|
|
|
10
10
|
function flatChildren(children) {
|
|
11
11
|
return React.Children.toArray(React.Children.map(children, child => {
|
|
12
12
|
if (isFragment(child)) {
|
|
13
|
-
|
|
14
|
-
return React.Children.toArray(((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children) || []);
|
|
13
|
+
return React.Children.toArray(child.props?.children || []);
|
|
15
14
|
}
|
|
16
15
|
return child;
|
|
17
16
|
}));
|
|
@@ -8,8 +8,7 @@ import warnOnce from "../warnOnce.js";
|
|
|
8
8
|
* fixme: Only display deprecation message in non-production environment
|
|
9
9
|
*/
|
|
10
10
|
export function deprecateComponent(Component, message) {
|
|
11
|
-
|
|
12
|
-
const componentDisplayName = (_Component$displayNam = Component.displayName) !== null && _Component$displayNam !== void 0 ? _Component$displayNam : Component.name;
|
|
11
|
+
const componentDisplayName = Component.displayName ?? Component.name;
|
|
13
12
|
const Deprecated = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
14
13
|
warnOnce(message);
|
|
15
14
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
function safeFindDOMNode(componentOrElement) {
|
|
3
3
|
if (componentOrElement && 'setState' in componentOrElement) {
|
|
4
|
-
var _ref$current, _ref;
|
|
5
4
|
// Access the underlying DOM node through ref if available
|
|
6
|
-
return
|
|
5
|
+
return componentOrElement?.ref?.current ?? null;
|
|
7
6
|
}
|
|
8
|
-
return componentOrElement
|
|
7
|
+
return componentOrElement ?? null;
|
|
9
8
|
}
|
|
10
9
|
const getRefTarget = ref => {
|
|
11
10
|
return ref && ('current' in ref ? ref.current : ref);
|
|
12
11
|
};
|
|
13
12
|
export function getDOMNode(elementOrRef) {
|
|
14
13
|
// If elementOrRef is an instance of Position, child is returned. [PositionInstance]
|
|
15
|
-
const element =
|
|
14
|
+
const element = elementOrRef?.root || elementOrRef?.child || getRefTarget(elementOrRef);
|
|
16
15
|
|
|
17
16
|
// Native HTML elements
|
|
18
|
-
if (element
|
|
17
|
+
if (element?.nodeType && typeof element?.nodeName === 'string') {
|
|
19
18
|
return element;
|
|
20
19
|
}
|
|
21
20
|
return safeFindDOMNode(element);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SizeEnum } from '../types';
|
|
2
2
|
export declare const isPresetSize: (size?: SizeEnum | number | string | null) => boolean;
|
|
3
3
|
export declare const getSizeValue: (type: string, size: SizeEnum | number | string | null) => string | undefined;
|
|
4
|
-
export declare const getSizeStyle: (value?: string | number | undefined, name?: string
|
|
4
|
+
export declare const getSizeStyle: (value?: string | number | undefined, name?: string, prop?: string) => {
|
|
5
5
|
[x: string]: string | number | undefined;
|
|
6
6
|
} | undefined;
|
|
7
|
-
export declare const getLineHeightStyle: (value?: string | number | undefined, name?: string
|
|
7
|
+
export declare const getLineHeightStyle: (value?: string | number | undefined, name?: string, prop?: string) => {
|
|
8
8
|
[x: string]: string | number | undefined;
|
|
9
9
|
} | undefined;
|
|
@@ -28,7 +28,7 @@ export function getCssValue(value, unit = 'px') {
|
|
|
28
28
|
* Merge multiple style objects, filtering out undefined values
|
|
29
29
|
*/
|
|
30
30
|
export function mergeStyles(...styles) {
|
|
31
|
-
const mergedStyles = styles
|
|
31
|
+
const mergedStyles = styles?.filter(Boolean).reduce((acc, style) => {
|
|
32
32
|
if (!style) return acc;
|
|
33
33
|
return {
|
|
34
34
|
...acc,
|
|
@@ -14,4 +14,4 @@ import type { ResponsiveValue } from '../../types';
|
|
|
14
14
|
* // Returns: ['rs-row-xs-top', 'rs-row-md-bottom']
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
export declare const getResponsiveClasses: <T = string>(prefix: (...classes: any[]) => string, value?: T | ResponsiveValue<T>
|
|
17
|
+
export declare const getResponsiveClasses: <T = string>(prefix: (...classes: any[]) => string, value?: T | ResponsiveValue<T>) => string[];
|
|
@@ -9,8 +9,8 @@ interface StylePropConfig<T = StyleValue> {
|
|
|
9
9
|
presetChecker?: PresetChecker<T>;
|
|
10
10
|
valueTransformer?: ValueTransformer<T>;
|
|
11
11
|
}
|
|
12
|
-
export declare const createStyleValueSetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T
|
|
13
|
-
export declare const createStyleGetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T
|
|
14
|
-
[x: string]: string | T | undefined;
|
|
12
|
+
export declare const createStyleValueSetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T, name?: string, prop?: string) => string | (T & ({} | null)) | undefined;
|
|
13
|
+
export declare const createStyleGetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T, name?: string, prop?: string) => {
|
|
14
|
+
[x: string]: string | (T & ({} | null)) | undefined;
|
|
15
15
|
} | undefined;
|
|
16
16
|
export {};
|
|
@@ -9,7 +9,7 @@ export const createStyleValueSetter = config => {
|
|
|
9
9
|
if (typeof value === 'undefined' || !name) {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
if (presetChecker
|
|
12
|
+
if (presetChecker?.(value)) {
|
|
13
13
|
return useGlobalVar ? `var(--rs-${prop}-${value})` : `var(--rs-${name}-${prop}-${value})`;
|
|
14
14
|
} else if (Array.isArray(value)) {
|
|
15
15
|
// If value is an array, join it with spaces,
|
|
@@ -117,7 +117,6 @@ const ToastContainer = /*#__PURE__*/forwardRef(function ToastContainer(props, re
|
|
|
117
117
|
enteredClassName: rootPrefix('toast-fade-entered'),
|
|
118
118
|
timeout: 300
|
|
119
119
|
}, (transitionProps, ref) => {
|
|
120
|
-
var _node$props, _node$props2;
|
|
121
120
|
const {
|
|
122
121
|
className: transitionClassName,
|
|
123
122
|
...rest
|
|
@@ -126,8 +125,8 @@ const ToastContainer = /*#__PURE__*/forwardRef(function ToastContainer(props, re
|
|
|
126
125
|
...rest,
|
|
127
126
|
ref,
|
|
128
127
|
duration,
|
|
129
|
-
onClose: createChainedFunction(
|
|
130
|
-
className: merge(rootPrefix('toast'),
|
|
128
|
+
onClose: createChainedFunction(node.props?.onClose, () => remove(item.key)),
|
|
129
|
+
className: merge(rootPrefix('toast'), node.props?.className, transitionClassName)
|
|
131
130
|
});
|
|
132
131
|
}));
|
|
133
132
|
});
|
|
@@ -153,9 +152,8 @@ ToastContainer.getInstance = async props => {
|
|
|
153
152
|
// Render the ToastContainer component into the specified container
|
|
154
153
|
const containerId = render(/*#__PURE__*/React.createElement(ToastContainer, _extends({}, toastProps, {
|
|
155
154
|
ref: ref => {
|
|
156
|
-
var _resolveContainerRef;
|
|
157
155
|
toastContainerRef.current = ref;
|
|
158
|
-
|
|
156
|
+
resolveContainerRef?.();
|
|
159
157
|
}
|
|
160
158
|
})), container);
|
|
161
159
|
await containerRefReady;
|
|
@@ -24,16 +24,15 @@ function useDelayedClosure(props) {
|
|
|
24
24
|
reset
|
|
25
25
|
} = useTimeout(onClose, duration, usedToaster && duration > 0);
|
|
26
26
|
useMount(() => {
|
|
27
|
-
if (targetRef
|
|
27
|
+
if (targetRef?.current && mouseReset) {
|
|
28
28
|
if (mouseEnterRef.current || mouseLeaveRef.current) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
mouseEnterRef.current = on(targetRef.current, 'mouseenter', clear);
|
|
32
32
|
mouseLeaveRef.current = on(targetRef.current, 'mouseleave', reset);
|
|
33
33
|
return () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(_mouseLeaveRef$curren = mouseLeaveRef.current) === null || _mouseLeaveRef$curren === void 0 || _mouseLeaveRef$curren.off();
|
|
34
|
+
mouseEnterRef.current?.off();
|
|
35
|
+
mouseLeaveRef.current?.off();
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
38
|
});
|
package/esm/toaster/toaster.js
CHANGED
|
@@ -34,8 +34,7 @@ toaster.push = (message, options = {}) => {
|
|
|
34
34
|
if (containerElementId) {
|
|
35
35
|
const existedContainer = getContainer(containerElementId, placement);
|
|
36
36
|
if (existedContainer) {
|
|
37
|
-
|
|
38
|
-
return (_existedContainer$cur = existedContainer.current) === null || _existedContainer$cur === void 0 ? void 0 : _existedContainer$cur.push(message, restOptions);
|
|
37
|
+
return existedContainer.current?.push(message, restOptions);
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
const newOptions = {
|
|
@@ -44,20 +43,13 @@ toaster.push = (message, options = {}) => {
|
|
|
44
43
|
placement
|
|
45
44
|
};
|
|
46
45
|
return createContainer(placement, newOptions).then(ref => {
|
|
47
|
-
|
|
48
|
-
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.push(message, restOptions);
|
|
46
|
+
return ref.current?.push(message, restOptions);
|
|
49
47
|
});
|
|
50
48
|
};
|
|
51
49
|
toaster.remove = key => {
|
|
52
|
-
containers.forEach(c =>
|
|
53
|
-
var _c$current;
|
|
54
|
-
return (_c$current = c.current) === null || _c$current === void 0 ? void 0 : _c$current.remove(key);
|
|
55
|
-
});
|
|
50
|
+
containers.forEach(c => c.current?.remove(key));
|
|
56
51
|
};
|
|
57
52
|
toaster.clear = () => {
|
|
58
|
-
containers.forEach(c =>
|
|
59
|
-
var _c$current2;
|
|
60
|
-
return (_c$current2 = c.current) === null || _c$current2 === void 0 ? void 0 : _c$current2.clear();
|
|
61
|
-
});
|
|
53
|
+
containers.forEach(c => c.current?.clear());
|
|
62
54
|
};
|
|
63
55
|
export default toaster;
|
|
@@ -11,5 +11,5 @@ export interface DialogProps extends ModalProps {
|
|
|
11
11
|
validate?: (value: string) => [isValid: boolean, errorMessage?: string];
|
|
12
12
|
onClose?: (result?: any) => void;
|
|
13
13
|
}
|
|
14
|
-
declare const Dialog: import("../internals/types").InternalRefForwardingComponent<React.ElementType
|
|
14
|
+
declare const Dialog: import("../internals/types").InternalRefForwardingComponent<React.ElementType, DialogProps, never> & Record<string, never>;
|
|
15
15
|
export default Dialog;
|
package/esm/useDialog/Dialog.js
CHANGED
|
@@ -45,7 +45,7 @@ const Dialog = forwardRef((props, ref) => {
|
|
|
45
45
|
const handleCancel = useCallback(result => {
|
|
46
46
|
setIsOpen(false);
|
|
47
47
|
setTimeout(() => {
|
|
48
|
-
onClose
|
|
48
|
+
onClose?.(result);
|
|
49
49
|
}, 300);
|
|
50
50
|
}, [onClose]);
|
|
51
51
|
const handleConfirm = useCallback(() => {
|
|
@@ -10,6 +10,6 @@ export declare function useDialog(): {
|
|
|
10
10
|
prompt: (message: React.ReactNode, options?: PromptOptions) => Promise<any>;
|
|
11
11
|
open: <P extends object>(as: React.ComponentType<P & {
|
|
12
12
|
onClose: (result?: any) => void;
|
|
13
|
-
}>, payload?: P
|
|
13
|
+
}>, payload?: P, options?: OpenOptions) => Promise<any>;
|
|
14
14
|
};
|
|
15
15
|
export default useDialog;
|
|
@@ -11,14 +11,14 @@ const WAIT_FOR_CONTAINER_TIMEOUT = 2000;
|
|
|
11
11
|
const useDialogContainer = () => {
|
|
12
12
|
const context = useContext(CustomContext);
|
|
13
13
|
useEffect(() => {
|
|
14
|
-
if (canUseDOM && !
|
|
14
|
+
if (canUseDOM && !context?.dialogContainer) {
|
|
15
15
|
console.warn('Warning: useDialog is being used outside of a CustomProvider. ' + 'Please wrap your application with <CustomProvider> to ensure proper functionality.');
|
|
16
16
|
}
|
|
17
|
-
}, [context
|
|
17
|
+
}, [context?.dialogContainer]);
|
|
18
18
|
|
|
19
19
|
// Return the ref from context directly instead of copying to a local ref
|
|
20
20
|
// This ensures we always use the latest mounted DialogContainer instance
|
|
21
|
-
return
|
|
21
|
+
return context?.dialogContainer || {
|
|
22
22
|
current: null
|
|
23
23
|
};
|
|
24
24
|
};
|
|
@@ -4,7 +4,6 @@ import set from 'lodash/set';
|
|
|
4
4
|
import { isValidElement, useCallback, useMemo } from 'react';
|
|
5
5
|
import { nameToPath } from "../utils/nameToPath.js";
|
|
6
6
|
function getErrorMessage(error) {
|
|
7
|
-
var _error$array;
|
|
8
7
|
if (typeof error === 'string') {
|
|
9
8
|
return error;
|
|
10
9
|
}
|
|
@@ -13,14 +12,13 @@ function getErrorMessage(error) {
|
|
|
13
12
|
* When using some components as the field, such as TagInput, and using `ArrayType().of` as the validation rule,
|
|
14
13
|
* the error object won't contain the errorMessage directly. @see https://github.com/rsuite/rsuite/issues/3866
|
|
15
14
|
*/
|
|
16
|
-
if (error
|
|
17
|
-
|
|
18
|
-
return (_error$array$find = error.array.find(item => item.hasError)) === null || _error$array$find === void 0 ? void 0 : _error$array$find.errorMessage;
|
|
15
|
+
if (error?.array && error.array?.length > 0) {
|
|
16
|
+
return error.array.find(item => item.hasError)?.errorMessage;
|
|
19
17
|
}
|
|
20
18
|
if (/*#__PURE__*/isValidElement(error)) {
|
|
21
19
|
return error;
|
|
22
20
|
}
|
|
23
|
-
return error
|
|
21
|
+
return error?.errorMessage;
|
|
24
22
|
}
|
|
25
23
|
export function useField(props) {
|
|
26
24
|
const {
|
|
@@ -36,7 +34,7 @@ export function useField(props) {
|
|
|
36
34
|
if (typeof value !== 'undefined') {
|
|
37
35
|
return value;
|
|
38
36
|
}
|
|
39
|
-
return nestedField ? get(formValue, name) : formValue
|
|
37
|
+
return nestedField ? get(formValue, name) : formValue?.[name];
|
|
40
38
|
}, [formValue, name, nestedField, value]);
|
|
41
39
|
const fieldError = useMemo(() => {
|
|
42
40
|
if (typeof errorMessage !== 'undefined' || !errorFromContext) {
|
|
@@ -45,7 +43,7 @@ export function useField(props) {
|
|
|
45
43
|
if (nestedField) {
|
|
46
44
|
return getErrorMessage(get(formError, nameToPath(name)));
|
|
47
45
|
}
|
|
48
|
-
const fieldError = formError
|
|
46
|
+
const fieldError = formError?.[name];
|
|
49
47
|
if (typeof fieldError === 'string') {
|
|
50
48
|
return fieldError;
|
|
51
49
|
}
|
|
@@ -9,9 +9,9 @@ export function useRegisterModel(name, rule) {
|
|
|
9
9
|
const refRule = useRef(rule);
|
|
10
10
|
refRule.current = rule;
|
|
11
11
|
useEffect(() => {
|
|
12
|
-
pushFieldRule
|
|
12
|
+
pushFieldRule?.(name, refRule);
|
|
13
13
|
return () => {
|
|
14
|
-
removeFieldRule
|
|
14
|
+
removeFieldRule?.(name);
|
|
15
15
|
};
|
|
16
16
|
}, [name, pushFieldRule, removeFieldRule]);
|
|
17
17
|
}
|
|
@@ -48,8 +48,8 @@ export function useFormControl(props) {
|
|
|
48
48
|
// Cleanup on unmount if shouldResetWithUnmount is true
|
|
49
49
|
useWillUnmount(() => {
|
|
50
50
|
if (shouldResetWithUnmount) {
|
|
51
|
-
removeFieldValue
|
|
52
|
-
removeFieldError
|
|
51
|
+
removeFieldValue?.(name);
|
|
52
|
+
removeFieldError?.(name);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -77,9 +77,9 @@ export function useFormControl(props) {
|
|
|
77
77
|
}
|
|
78
78
|
const nextFormValue = setFieldValue(name, value);
|
|
79
79
|
if (checkAsync) {
|
|
80
|
-
checkFieldAsyncForNextValue
|
|
80
|
+
checkFieldAsyncForNextValue?.(name, nextFormValue);
|
|
81
81
|
} else {
|
|
82
|
-
checkFieldForNextValue
|
|
82
|
+
checkFieldForNextValue?.(name, nextFormValue);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
|
|
@@ -88,7 +88,7 @@ export function useFormControl(props) {
|
|
|
88
88
|
if (trigger === 'change') {
|
|
89
89
|
onCheck(value);
|
|
90
90
|
}
|
|
91
|
-
onFieldChange
|
|
91
|
+
onFieldChange?.(name, value, event);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
// Handler for field blur
|
|
@@ -106,12 +106,12 @@ export function useFormControl(props) {
|
|
|
106
106
|
*/
|
|
107
107
|
const setValue = useCallback((value, shouldValidate = false) => {
|
|
108
108
|
const nextFormValue = setFieldValue(name, value);
|
|
109
|
-
onFieldChange
|
|
109
|
+
onFieldChange?.(name, value);
|
|
110
110
|
if (shouldValidate && trigger !== null) {
|
|
111
111
|
if (checkAsync) {
|
|
112
|
-
checkFieldAsyncForNextValue
|
|
112
|
+
checkFieldAsyncForNextValue?.(name, nextFormValue);
|
|
113
113
|
} else {
|
|
114
|
-
checkFieldForNextValue
|
|
114
|
+
checkFieldForNextValue?.(name, nextFormValue);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}, [name, setFieldValue, trigger, checkAsync, checkFieldAsyncForNextValue, checkFieldForNextValue]);
|