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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [6.1.3](https://github.com/rsuite/rsuite/compare/v6.1.2...v6.1.3) (2026-04-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **TimeDropdown:** guard +12 hour offset on showMeridiem in 24h mode ([#4566](https://github.com/rsuite/rsuite/issues/4566)) ([338828f](https://github.com/rsuite/rsuite/commit/338828fd5096477e3b7ed0c6cbebf71d142a17ca)), closes [#4526](https://github.com/rsuite/rsuite/issues/4526)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [6.1.2](https://github.com/rsuite/rsuite/compare/v6.1.1...v6.1.2) (2026-01-28)
|
|
2
11
|
|
|
3
12
|
|
package/cjs/Affix/Affix.js
CHANGED
|
@@ -22,10 +22,10 @@ function useOffset(mountRef, onOffsetChange) {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
const newOffset = (0, _getOffset.default)(mountRef.current);
|
|
25
|
-
if (
|
|
25
|
+
if (newOffset?.height !== offset?.height || newOffset?.width !== offset?.width || newOffset?.top !== offset?.top || newOffset?.left !== offset?.left) {
|
|
26
26
|
setOffset(newOffset);
|
|
27
27
|
if (offset !== null && newOffset !== null) {
|
|
28
|
-
onOffsetChange
|
|
28
|
+
onOffsetChange?.(newOffset);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}, [mountRef, offset, onOffsetChange]);
|
|
@@ -76,7 +76,7 @@ function useFixed(offset, containerOffset, props) {
|
|
|
76
76
|
const scrollY = window.scrollY || window.pageYOffset;
|
|
77
77
|
|
|
78
78
|
// When the scroll distance exceeds the element's top value, it is fixed.
|
|
79
|
-
let nextFixed = scrollY - (Number(offset
|
|
79
|
+
let nextFixed = scrollY - (Number(offset?.top) - Number(top)) >= 0;
|
|
80
80
|
|
|
81
81
|
// If the current element is specified in the container,
|
|
82
82
|
// add to determine whether the current container is in the window range.
|
|
@@ -85,7 +85,7 @@ function useFixed(offset, containerOffset, props) {
|
|
|
85
85
|
}
|
|
86
86
|
if (nextFixed !== fixed) {
|
|
87
87
|
setFixed(nextFixed);
|
|
88
|
-
onChange
|
|
88
|
+
onChange?.(nextFixed);
|
|
89
89
|
}
|
|
90
90
|
}, [offset, top, containerOffset, fixed, onChange]);
|
|
91
91
|
|
|
@@ -8,7 +8,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _getStyle = _interopRequireDefault(require("dom-lib/getStyle"));
|
|
10
10
|
var _addStyle = _interopRequireDefault(require("dom-lib/addStyle"));
|
|
11
|
-
var
|
|
11
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
12
12
|
var _capitalize = _interopRequireDefault(require("lodash/capitalize"));
|
|
13
13
|
var _Transition = _interopRequireDefault(require("./Transition"));
|
|
14
14
|
var _hooks = require("../internals/hooks");
|
|
@@ -19,19 +19,18 @@ let DIMENSION = exports.DIMENSION = /*#__PURE__*/function (DIMENSION) {
|
|
|
19
19
|
DIMENSION["WIDTH"] = "width";
|
|
20
20
|
return DIMENSION;
|
|
21
21
|
}({});
|
|
22
|
-
const triggerBrowserReflow = node => (0,
|
|
22
|
+
const triggerBrowserReflow = node => (0, _get.default)(node, 'offsetHeight');
|
|
23
23
|
const MARGINS = {
|
|
24
24
|
height: ['marginTop', 'marginBottom'],
|
|
25
25
|
width: ['marginLeft', 'marginRight']
|
|
26
26
|
};
|
|
27
27
|
function defaultGetDimensionValue(dimension, elem) {
|
|
28
|
-
|
|
29
|
-
const value = (_get = (0, _get2.default)(elem, `offset${(0, _capitalize.default)(dimension)}`)) !== null && _get !== void 0 ? _get : 0;
|
|
28
|
+
const value = (0, _get.default)(elem, `offset${(0, _capitalize.default)(dimension)}`) ?? 0;
|
|
30
29
|
const margins = MARGINS[dimension];
|
|
31
30
|
return value + parseInt((0, _getStyle.default)(elem, margins[0]), 10) + parseInt((0, _getStyle.default)(elem, margins[1]), 10);
|
|
32
31
|
}
|
|
33
32
|
function getScrollDimensionValue(elem, dimension) {
|
|
34
|
-
const value = (0,
|
|
33
|
+
const value = (0, _get.default)(elem, `scroll${(0, _capitalize.default)(dimension)}`);
|
|
35
34
|
return `${value}px`;
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -63,7 +63,7 @@ declare class Transition extends React.Component<TransitionProps, TransitionStat
|
|
|
63
63
|
componentWillUnmount(): void;
|
|
64
64
|
onTransitionEnd(node: HTMLElement, handler: (event?: React.AnimationEvent) => void): void;
|
|
65
65
|
setNextCallback(callback: (event?: React.AnimationEvent) => void): {
|
|
66
|
-
(event?: React.AnimationEvent
|
|
66
|
+
(event?: React.AnimationEvent): void;
|
|
67
67
|
cancel: () => any;
|
|
68
68
|
} | null;
|
|
69
69
|
getChildElement(): HTMLElement;
|
|
@@ -71,6 +71,6 @@ declare class Transition extends React.Component<TransitionProps, TransitionStat
|
|
|
71
71
|
performExit(props: TransitionProps): void;
|
|
72
72
|
cancelNextCallback(): void;
|
|
73
73
|
safeSetState(nextState: TransitionState, callback: (event?: React.AnimationEvent) => void): void;
|
|
74
|
-
render(): React.ReactNode;
|
|
74
|
+
render(): string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.DetailedReactHTMLElement<any, HTMLElement> | null | undefined;
|
|
75
75
|
}
|
|
76
76
|
export default Transition;
|
|
@@ -27,13 +27,16 @@ const transitionProps = ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExit
|
|
|
27
27
|
* @see https://rsuitejs.com/components/animation/#transition
|
|
28
28
|
*/
|
|
29
29
|
class Transition extends _react.default.Component {
|
|
30
|
+
static displayName = 'Transition';
|
|
31
|
+
static defaultProps = {
|
|
32
|
+
timeout: 1000
|
|
33
|
+
};
|
|
34
|
+
animationEventListener = null;
|
|
35
|
+
instanceElement = null;
|
|
36
|
+
nextCallback = null;
|
|
37
|
+
needsUpdate = null;
|
|
30
38
|
constructor(props) {
|
|
31
39
|
super(props);
|
|
32
|
-
this.animationEventListener = null;
|
|
33
|
-
this.instanceElement = null;
|
|
34
|
-
this.nextCallback = null;
|
|
35
|
-
this.needsUpdate = null;
|
|
36
|
-
this.childRef = void 0;
|
|
37
40
|
let initialStatus;
|
|
38
41
|
if (props.in) {
|
|
39
42
|
initialStatus = props.transitionAppear ? STATUS.EXITED : STATUS.ENTERED;
|
|
@@ -103,9 +106,8 @@ class Transition extends _react.default.Component {
|
|
|
103
106
|
this.instanceElement = null;
|
|
104
107
|
}
|
|
105
108
|
onTransitionEnd(node, handler) {
|
|
106
|
-
var _this$animationEventL;
|
|
107
109
|
this.setNextCallback(handler);
|
|
108
|
-
|
|
110
|
+
this.animationEventListener?.off();
|
|
109
111
|
if (!this.nextCallback) {
|
|
110
112
|
return;
|
|
111
113
|
}
|
|
@@ -162,16 +164,16 @@ class Transition extends _react.default.Component {
|
|
|
162
164
|
this.cancelNextCallback();
|
|
163
165
|
const node = this.getChildElement();
|
|
164
166
|
this.instanceElement = node;
|
|
165
|
-
onEnter
|
|
167
|
+
onEnter?.(node);
|
|
166
168
|
this.safeSetState({
|
|
167
169
|
status: STATUS.ENTERING
|
|
168
170
|
}, () => {
|
|
169
|
-
onEntering
|
|
171
|
+
onEntering?.(node);
|
|
170
172
|
this.onTransitionEnd(node, () => {
|
|
171
173
|
this.safeSetState({
|
|
172
174
|
status: STATUS.ENTERED
|
|
173
175
|
}, () => {
|
|
174
|
-
onEntered
|
|
176
|
+
onEntered?.(node);
|
|
175
177
|
});
|
|
176
178
|
});
|
|
177
179
|
});
|
|
@@ -185,16 +187,16 @@ class Transition extends _react.default.Component {
|
|
|
185
187
|
this.cancelNextCallback();
|
|
186
188
|
const node = this.getChildElement();
|
|
187
189
|
this.instanceElement = node;
|
|
188
|
-
onExit
|
|
190
|
+
onExit?.(node);
|
|
189
191
|
this.safeSetState({
|
|
190
192
|
status: STATUS.EXITING
|
|
191
193
|
}, () => {
|
|
192
|
-
onExiting
|
|
194
|
+
onExiting?.(node);
|
|
193
195
|
this.onTransitionEnd(node, () => {
|
|
194
196
|
this.safeSetState({
|
|
195
197
|
status: STATUS.EXITED
|
|
196
198
|
}, () => {
|
|
197
|
-
onExited
|
|
199
|
+
onExited?.(node);
|
|
198
200
|
});
|
|
199
201
|
});
|
|
200
202
|
});
|
|
@@ -208,11 +210,10 @@ class Transition extends _react.default.Component {
|
|
|
208
210
|
safeSetState(nextState, callback) {
|
|
209
211
|
if (this.instanceElement) {
|
|
210
212
|
const nextCallback = this.setNextCallback(callback);
|
|
211
|
-
this.setState(nextState, () => nextCallback
|
|
213
|
+
this.setState(nextState, () => nextCallback?.());
|
|
212
214
|
}
|
|
213
215
|
}
|
|
214
216
|
render() {
|
|
215
|
-
var _child$props;
|
|
216
217
|
const status = this.state.status;
|
|
217
218
|
if (status === STATUS.UNMOUNTED) {
|
|
218
219
|
return null;
|
|
@@ -245,12 +246,8 @@ class Transition extends _react.default.Component {
|
|
|
245
246
|
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
246
247
|
...childProps,
|
|
247
248
|
ref: this.childRef,
|
|
248
|
-
className: (0, _classnames.default)(className,
|
|
249
|
+
className: (0, _classnames.default)(className, child.props?.className, transitionClassName)
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
|
-
Transition.displayName = 'Transition';
|
|
253
|
-
Transition.defaultProps = {
|
|
254
|
-
timeout: 1000
|
|
255
|
-
};
|
|
256
253
|
var _default = exports.default = Transition;
|
|
@@ -62,7 +62,7 @@ const AutoComplete = (0, _utils.forwardRef)((props, ref) => {
|
|
|
62
62
|
const datalist = (0, _utils2.transformData)(data);
|
|
63
63
|
const [value, setValue] = (0, _hooks.useControlled)(valueProp, defaultValue);
|
|
64
64
|
const [focus, setFocus] = (0, _react.useState)(false);
|
|
65
|
-
const items =
|
|
65
|
+
const items = datalist?.filter((0, _utils2.shouldDisplay)(filterBy, value)) || [];
|
|
66
66
|
const hasItems = items.length > 0;
|
|
67
67
|
const {
|
|
68
68
|
trigger,
|
|
@@ -91,13 +91,13 @@ const AutoComplete = (0, _utils.forwardRef)((props, ref) => {
|
|
|
91
91
|
esc: handleClose
|
|
92
92
|
});
|
|
93
93
|
handleKeyDown(event);
|
|
94
|
-
onKeyDown
|
|
94
|
+
onKeyDown?.(event);
|
|
95
95
|
};
|
|
96
96
|
const selectFocusMenuItem = event => {
|
|
97
97
|
if (!focusItemValue) {
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const focusItem = datalist.find(item =>
|
|
100
|
+
const focusItem = datalist.find(item => item?.value === focusItemValue);
|
|
101
101
|
setValue(focusItemValue);
|
|
102
102
|
setFocusItemValue(focusItemValue);
|
|
103
103
|
handleSelect(focusItem, event);
|
|
@@ -107,10 +107,10 @@ const AutoComplete = (0, _utils.forwardRef)((props, ref) => {
|
|
|
107
107
|
handleClose();
|
|
108
108
|
};
|
|
109
109
|
const handleSelect = (0, _hooks.useEventCallback)((item, event) => {
|
|
110
|
-
onSelect
|
|
110
|
+
onSelect?.(item.value, item, event);
|
|
111
111
|
});
|
|
112
112
|
const handleChangeValue = (0, _hooks.useEventCallback)((value, event) => {
|
|
113
|
-
onChange
|
|
113
|
+
onChange?.(value, event);
|
|
114
114
|
});
|
|
115
115
|
const handleChange = (value, event) => {
|
|
116
116
|
setFocusItemValue('');
|
|
@@ -121,12 +121,12 @@ const AutoComplete = (0, _utils.forwardRef)((props, ref) => {
|
|
|
121
121
|
const handleClose = (0, _hooks.useEventCallback)(() => {
|
|
122
122
|
if (isMounted()) {
|
|
123
123
|
setFocus(false);
|
|
124
|
-
onClose
|
|
124
|
+
onClose?.();
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
const handleOpen = (0, _hooks.useEventCallback)(() => {
|
|
128
128
|
setFocus(true);
|
|
129
|
-
onOpen
|
|
129
|
+
onOpen?.();
|
|
130
130
|
});
|
|
131
131
|
const handleItemSelect = (0, _hooks.useEventCallback)((nextItemValue, item, event) => {
|
|
132
132
|
setValue(nextItemValue);
|
|
@@ -138,12 +138,12 @@ const AutoComplete = (0, _utils.forwardRef)((props, ref) => {
|
|
|
138
138
|
handleClose();
|
|
139
139
|
});
|
|
140
140
|
const handleInputFocus = (0, _hooks.useEventCallback)(event => {
|
|
141
|
-
onFocus
|
|
141
|
+
onFocus?.(event);
|
|
142
142
|
handleOpen();
|
|
143
143
|
});
|
|
144
144
|
const handleInputBlur = (0, _hooks.useEventCallback)(event => {
|
|
145
145
|
setTimeout(handleClose, 300);
|
|
146
|
-
onBlur
|
|
146
|
+
onBlur?.(event);
|
|
147
147
|
});
|
|
148
148
|
const {
|
|
149
149
|
withPrefix,
|
package/cjs/Avatar/useImage.js
CHANGED
|
@@ -39,7 +39,7 @@ const useImage = props => {
|
|
|
39
39
|
const handleError = (0, _react.useCallback)(event => {
|
|
40
40
|
setStatus('error');
|
|
41
41
|
flush();
|
|
42
|
-
onError
|
|
42
|
+
onError?.(event);
|
|
43
43
|
}, [onError]);
|
|
44
44
|
(0, _react.useEffect)(() => {
|
|
45
45
|
setStatus(src ? 'loading' : 'pending');
|
|
@@ -16,8 +16,8 @@ export interface AvatarGroupProps extends BoxProps {
|
|
|
16
16
|
size?: Size;
|
|
17
17
|
}
|
|
18
18
|
export declare const AvatarGroupContext: React.Context<{
|
|
19
|
-
size?:
|
|
20
|
-
spacing?: number
|
|
19
|
+
size?: Size;
|
|
20
|
+
spacing?: number;
|
|
21
21
|
}>;
|
|
22
22
|
/**
|
|
23
23
|
* The AvatarGroup component is used to represent a collection of avatars.
|
package/cjs/Badge/Badge.js
CHANGED
|
@@ -42,10 +42,7 @@ const Badge = (0, _utils.forwardRef)((props, ref) => {
|
|
|
42
42
|
merge
|
|
43
43
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
44
44
|
const text = typeof content === 'number' && content > maxCount ? `${maxCount}+` : content;
|
|
45
|
-
const isOneChar = (0, _react.useMemo)(() =>
|
|
46
|
-
var _String;
|
|
47
|
-
return ((_String = String(content)) === null || _String === void 0 ? void 0 : _String.length) === 1;
|
|
48
|
-
}, [content]);
|
|
45
|
+
const isOneChar = (0, _react.useMemo)(() => String(content)?.length === 1, [content]);
|
|
49
46
|
const classes = merge(className, withPrefix({
|
|
50
47
|
wrapper: children
|
|
51
48
|
}));
|
|
@@ -48,7 +48,7 @@ const Breadcrumb = (0, _utils.forwardRef)((props, ref) => {
|
|
|
48
48
|
const [showEllipsis, setShowEllipsis] = (0, _react.useState)(true);
|
|
49
49
|
const handleClickEllipsis = (0, _hooks.useEventCallback)(event => {
|
|
50
50
|
setShowEllipsis(false);
|
|
51
|
-
onExpand
|
|
51
|
+
onExpand?.(event);
|
|
52
52
|
});
|
|
53
53
|
const content = (0, _react.useMemo)(() => {
|
|
54
54
|
const count = _utils.rch.count(children);
|
|
@@ -63,8 +63,8 @@ const Breadcrumb = (0, _utils.forwardRef)((props, ref) => {
|
|
|
63
63
|
return [...items.slice(0, 1), [/*#__PURE__*/_react.default.createElement(_BreadcrumbItem.default, {
|
|
64
64
|
role: "button",
|
|
65
65
|
key: "ellipsis",
|
|
66
|
-
title: locale
|
|
67
|
-
"aria-label": locale
|
|
66
|
+
title: locale?.expandText,
|
|
67
|
+
"aria-label": locale?.expandText,
|
|
68
68
|
separator: /*#__PURE__*/_react.default.createElement(Separator, null, separator),
|
|
69
69
|
onClick: handleClickEllipsis
|
|
70
70
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -72,7 +72,7 @@ const Breadcrumb = (0, _utils.forwardRef)((props, ref) => {
|
|
|
72
72
|
}, ellipsis))], ...items.slice(items.length - 1, items.length)];
|
|
73
73
|
}
|
|
74
74
|
return items;
|
|
75
|
-
}, [children, ellipsis, handleClickEllipsis, locale
|
|
75
|
+
}, [children, ellipsis, handleClickEllipsis, locale?.expandText, maxItems, separator, showEllipsis]);
|
|
76
76
|
const classes = merge(className, withPrefix());
|
|
77
77
|
return /*#__PURE__*/_react.default.createElement(_StyledBox.default, (0, _extends2.default)({
|
|
78
78
|
name: "breadcrumb",
|
package/cjs/Button/Button.js
CHANGED
|
@@ -31,11 +31,11 @@ const Button = (0, _utils.forwardRef)((props, ref) => {
|
|
|
31
31
|
children,
|
|
32
32
|
classPrefix = 'btn',
|
|
33
33
|
color,
|
|
34
|
-
disabled = buttonGroup
|
|
34
|
+
disabled = buttonGroup?.disabled,
|
|
35
35
|
loading,
|
|
36
36
|
role,
|
|
37
37
|
ripple = true,
|
|
38
|
-
size =
|
|
38
|
+
size = buttonGroup?.size || 'md',
|
|
39
39
|
startIcon,
|
|
40
40
|
endIcon,
|
|
41
41
|
type: typeProp,
|
|
@@ -66,16 +66,16 @@ const Button = (0, _utils.forwardRef)((props, ref) => {
|
|
|
66
66
|
if (toggleable) {
|
|
67
67
|
const nextActive = !active;
|
|
68
68
|
setActive(nextActive);
|
|
69
|
-
onToggle
|
|
69
|
+
onToggle?.(nextActive, event);
|
|
70
70
|
}
|
|
71
|
-
onClick
|
|
71
|
+
onClick?.(event);
|
|
72
72
|
});
|
|
73
73
|
const buttonAs = as || (rest.href ? _SafeAnchor.default : 'button');
|
|
74
74
|
const isCustomElement = buttonAs !== 'button' && buttonAs !== _SafeAnchor.default;
|
|
75
75
|
const uncertainProps = {
|
|
76
76
|
[(0, _utils.isDisableableElement)(buttonAs) || buttonAs === _SafeAnchor.default ? 'disabled' : 'aria-disabled']: disabled,
|
|
77
|
-
type: typeProp
|
|
78
|
-
role: role
|
|
77
|
+
type: typeProp ?? (buttonAs === 'button' ? 'button' : undefined),
|
|
78
|
+
role: role ?? (isCustomElement ? 'button' : undefined)
|
|
79
79
|
};
|
|
80
80
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
81
81
|
as: buttonAs,
|
package/cjs/Calendar/Calendar.js
CHANGED
|
@@ -46,16 +46,16 @@ const Calendar = (0, _utils.forwardRef)((props, ref) => {
|
|
|
46
46
|
} = (0, _hooks2.useCalendarDate)(value, defaultValue);
|
|
47
47
|
const handleChange = (0, _hooks.useEventCallback)(nextValue => {
|
|
48
48
|
setCalendarDate(nextValue);
|
|
49
|
-
onChange
|
|
49
|
+
onChange?.(nextValue);
|
|
50
50
|
if (!(0, _date.isSameMonth)(nextValue, calendarDate)) {
|
|
51
|
-
onMonthChange
|
|
51
|
+
onMonthChange?.(nextValue);
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
const handleClickToday = (0, _hooks.useEventCallback)(() => {
|
|
55
55
|
handleChange(new Date());
|
|
56
56
|
});
|
|
57
57
|
const handleSelect = (0, _hooks.useEventCallback)(nextValue => {
|
|
58
|
-
onSelect
|
|
58
|
+
onSelect?.(nextValue);
|
|
59
59
|
handleChange(nextValue);
|
|
60
60
|
});
|
|
61
61
|
const {
|
|
@@ -66,10 +66,10 @@ const Calendar = (0, _utils.forwardRef)((props, ref) => {
|
|
|
66
66
|
className: prefix('btn-today'),
|
|
67
67
|
size: "sm",
|
|
68
68
|
onClick: handleClickToday
|
|
69
|
-
},
|
|
69
|
+
}, locale?.today || 'Today');
|
|
70
70
|
const renderTitle = date => /*#__PURE__*/_react.default.createElement(_FormattedDate.FormattedDate, {
|
|
71
71
|
date: date,
|
|
72
|
-
formatStr:
|
|
72
|
+
formatStr: locale?.formattedMonthPattern || 'MMMM yyyy'
|
|
73
73
|
});
|
|
74
74
|
const classes = merge(className, prefix('panel', {
|
|
75
75
|
bordered,
|
|
@@ -43,7 +43,7 @@ const CalendarBody = (0, _utils.forwardRef)((props, ref) => {
|
|
|
43
43
|
}), /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
44
44
|
rows: (0, _date.getWeekStartDates)(yearMonth, {
|
|
45
45
|
weekStart,
|
|
46
|
-
locale: locale
|
|
46
|
+
locale: locale?.dateLocale
|
|
47
47
|
}),
|
|
48
48
|
"aria-label": getAriaLabelForMonth(yearMonth)
|
|
49
49
|
}));
|
|
@@ -78,8 +78,7 @@ const CalendarContainer = (0, _utils.forwardRef)((props, ref) => {
|
|
|
78
78
|
onToggleMonthDropdown
|
|
79
79
|
});
|
|
80
80
|
const isDateDisabled = (0, _react.useCallback)(date => {
|
|
81
|
-
|
|
82
|
-
return (_disabledDate = disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(toJsDate(date))) !== null && _disabledDate !== void 0 ? _disabledDate : false;
|
|
81
|
+
return disabledDate?.(toJsDate(date)) ?? false;
|
|
83
82
|
}, [disabledDate]);
|
|
84
83
|
const isMonthDisabled = (0, _react.useCallback)(yearMonth => {
|
|
85
84
|
return (0, _plainDate.isEveryDayInMonth)(yearMonth, isDateDisabled);
|
|
@@ -103,19 +102,19 @@ const CalendarContainer = (0, _utils.forwardRef)((props, ref) => {
|
|
|
103
102
|
const handleChangeMonth = (0, _hooks.useEventCallback)((yearMonth, event) => {
|
|
104
103
|
reset();
|
|
105
104
|
// Call `onChangeMonth` with the first day in the month
|
|
106
|
-
onChangeMonth
|
|
105
|
+
onChangeMonth?.(new Date(yearMonth.year, yearMonth.month - 1, 1), event);
|
|
107
106
|
});
|
|
108
|
-
const cellClassName = (0, _react.useCallback)(date => cellClassNameProp
|
|
109
|
-
const onMouseMove = (0, _react.useCallback)(date => onMouseMoveProp
|
|
110
|
-
const onSelect = (0, _react.useCallback)((date, event) => onSelectProp
|
|
111
|
-
const renderCell = (0, _react.useCallback)(date => renderCellProp
|
|
112
|
-
const renderCellOnPicker = (0, _react.useCallback)(date => renderCellOnPickerProp
|
|
107
|
+
const cellClassName = (0, _react.useCallback)(date => cellClassNameProp?.(toJsDate(date)), [cellClassNameProp]);
|
|
108
|
+
const onMouseMove = (0, _react.useCallback)(date => onMouseMoveProp?.(toJsDate(date)), [onMouseMoveProp]);
|
|
109
|
+
const onSelect = (0, _react.useCallback)((date, event) => onSelectProp?.(toJsDate(date), event), [onSelectProp]);
|
|
110
|
+
const renderCell = (0, _react.useCallback)(date => renderCellProp?.(toJsDate(date)), [renderCellProp]);
|
|
111
|
+
const renderCellOnPicker = (0, _react.useCallback)(date => renderCellOnPickerProp?.(toJsDate(date)), [renderCellOnPickerProp]);
|
|
113
112
|
const handleChangeTime = (0, _hooks.useEventCallback)((time, event) => {
|
|
114
113
|
let nextDate = calendarDate || (0, _date.startOfToday)();
|
|
115
114
|
nextDate = (0, _date.setHours)(nextDate, time.hour);
|
|
116
115
|
nextDate = (0, _date.setMinutes)(nextDate, time.minute);
|
|
117
116
|
nextDate = (0, _date.setSeconds)(nextDate, time.second);
|
|
118
|
-
onChangeTime
|
|
117
|
+
onChangeTime?.(nextDate, event);
|
|
119
118
|
});
|
|
120
119
|
const contextValue = {
|
|
121
120
|
date: calendarDate,
|
|
@@ -192,30 +191,12 @@ function useTimeDropdownProps(calendarProps) {
|
|
|
192
191
|
disabledSeconds
|
|
193
192
|
} = calendarProps;
|
|
194
193
|
return (0, _react.useMemo)(() => ({
|
|
195
|
-
hideHours: (hour, date) =>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return (_hideMinutes = hideMinutes === null || hideMinutes === void 0 ? void 0 : hideMinutes(minute, toJsDate(date))) !== null && _hideMinutes !== void 0 ? _hideMinutes : false;
|
|
202
|
-
},
|
|
203
|
-
hideSeconds: (second, date) => {
|
|
204
|
-
var _hideSeconds;
|
|
205
|
-
return (_hideSeconds = hideSeconds === null || hideSeconds === void 0 ? void 0 : hideSeconds(second, toJsDate(date))) !== null && _hideSeconds !== void 0 ? _hideSeconds : false;
|
|
206
|
-
},
|
|
207
|
-
disabledHours: (hour, date) => {
|
|
208
|
-
var _disabledHours;
|
|
209
|
-
return (_disabledHours = disabledHours === null || disabledHours === void 0 ? void 0 : disabledHours(hour, toJsDate(date))) !== null && _disabledHours !== void 0 ? _disabledHours : false;
|
|
210
|
-
},
|
|
211
|
-
disabledMinutes: (minute, date) => {
|
|
212
|
-
var _disabledMinutes;
|
|
213
|
-
return (_disabledMinutes = disabledMinutes === null || disabledMinutes === void 0 ? void 0 : disabledMinutes(minute, toJsDate(date))) !== null && _disabledMinutes !== void 0 ? _disabledMinutes : false;
|
|
214
|
-
},
|
|
215
|
-
disabledSeconds: (second, date) => {
|
|
216
|
-
var _disabledSeconds;
|
|
217
|
-
return (_disabledSeconds = disabledSeconds === null || disabledSeconds === void 0 ? void 0 : disabledSeconds(second, toJsDate(date))) !== null && _disabledSeconds !== void 0 ? _disabledSeconds : false;
|
|
218
|
-
}
|
|
194
|
+
hideHours: (hour, date) => hideHours?.(hour, toJsDate(date)) ?? false,
|
|
195
|
+
hideMinutes: (minute, date) => hideMinutes?.(minute, toJsDate(date)) ?? false,
|
|
196
|
+
hideSeconds: (second, date) => hideSeconds?.(second, toJsDate(date)) ?? false,
|
|
197
|
+
disabledHours: (hour, date) => disabledHours?.(hour, toJsDate(date)) ?? false,
|
|
198
|
+
disabledMinutes: (minute, date) => disabledMinutes?.(minute, toJsDate(date)) ?? false,
|
|
199
|
+
disabledSeconds: (second, date) => disabledSeconds?.(second, toJsDate(date)) ?? false
|
|
219
200
|
}), [hideHours, hideMinutes, hideSeconds, disabledHours, disabledMinutes, disabledSeconds]);
|
|
220
201
|
}
|
|
221
202
|
function toJsDate(date) {
|
|
@@ -57,7 +57,7 @@ const CalendarHeader = (0, _utils.forwardRef)((props, ref) => {
|
|
|
57
57
|
size: inline ? 'sm' : 'xs'
|
|
58
58
|
};
|
|
59
59
|
const timeFormat = (0, _react.useMemo)(() => {
|
|
60
|
-
const defaultTimeFormat =
|
|
60
|
+
const defaultTimeFormat = locale?.shortTimeFormat || 'HH:mm';
|
|
61
61
|
if (!format) {
|
|
62
62
|
return defaultTimeFormat;
|
|
63
63
|
}
|
|
@@ -65,26 +65,25 @@ const CalendarHeader = (0, _utils.forwardRef)((props, ref) => {
|
|
|
65
65
|
}, [format, locale]);
|
|
66
66
|
const dateFormat = (0, _react.useMemo)(() => {
|
|
67
67
|
if (showMonth) {
|
|
68
|
-
return
|
|
68
|
+
return locale?.formattedMonthPattern || 'yyyy-MM';
|
|
69
69
|
}
|
|
70
70
|
return 'yyyy';
|
|
71
71
|
}, [locale, showMonth]);
|
|
72
72
|
const renderTitle = () => {
|
|
73
|
-
|
|
74
|
-
return (_renderTitleProp = renderTitleProp === null || renderTitleProp === void 0 ? void 0 : renderTitleProp(date)) !== null && _renderTitleProp !== void 0 ? _renderTitleProp : date && /*#__PURE__*/_react.default.createElement(_FormattedDate.FormattedDate, {
|
|
73
|
+
return renderTitleProp?.(date) ?? (date && /*#__PURE__*/_react.default.createElement(_FormattedDate.FormattedDate, {
|
|
75
74
|
date: date,
|
|
76
75
|
formatStr: dateFormat
|
|
77
|
-
});
|
|
76
|
+
}));
|
|
78
77
|
};
|
|
79
78
|
const dateTitleClasses = prefix('title', 'title-date', {
|
|
80
|
-
error: disabledDate
|
|
79
|
+
error: disabledDate?.({
|
|
81
80
|
year: date.getFullYear(),
|
|
82
81
|
month: date.getMonth() + 1,
|
|
83
82
|
day: date.getDate()
|
|
84
83
|
})
|
|
85
84
|
});
|
|
86
85
|
const timeTitleClasses = prefix('title', 'title-time', {
|
|
87
|
-
error: disabledTime
|
|
86
|
+
error: disabledTime?.(date)
|
|
88
87
|
});
|
|
89
88
|
const backwardClass = prefix('backward', {
|
|
90
89
|
'btn-disabled': disabledBackward
|
|
@@ -132,7 +131,7 @@ const CalendarHeader = (0, _utils.forwardRef)((props, ref) => {
|
|
|
132
131
|
}), date && /*#__PURE__*/_react.default.createElement(_FormattedDate.FormattedDate, {
|
|
133
132
|
date: date,
|
|
134
133
|
formatStr: timeFormat
|
|
135
|
-
}))), renderToolbar
|
|
134
|
+
}))), renderToolbar?.(date));
|
|
136
135
|
});
|
|
137
136
|
CalendarHeader.displayName = 'CalendarHeader';
|
|
138
137
|
var _default = exports.default = CalendarHeader;
|
|
@@ -57,7 +57,7 @@ const GridCell = (0, _utils.forwardRef)((props, ref) => {
|
|
|
57
57
|
'cell-selected-end': rangeEnd,
|
|
58
58
|
'cell-in-range': !unSameMonth && inRange,
|
|
59
59
|
'cell-disabled': disabled
|
|
60
|
-
}), cellClassName
|
|
60
|
+
}), cellClassName?.(date));
|
|
61
61
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
62
62
|
ref: ref,
|
|
63
63
|
role: "gridcell",
|
|
@@ -73,7 +73,7 @@ const GridCell = (0, _utils.forwardRef)((props, ref) => {
|
|
|
73
73
|
className: prefix('cell-content')
|
|
74
74
|
}, renderCellOnPicker ? renderCellOnPicker(date) : /*#__PURE__*/_react.default.createElement("span", {
|
|
75
75
|
className: prefix('cell-day')
|
|
76
|
-
}, date.day), renderCell
|
|
76
|
+
}, date.day), renderCell?.(date)));
|
|
77
77
|
});
|
|
78
78
|
GridCell.displayName = 'CalendarGridCell';
|
|
79
79
|
var _default = exports.default = GridCell;
|
|
@@ -44,7 +44,7 @@ const GridHeaderRow = (0, _utils.forwardRef)((props, ref) => {
|
|
|
44
44
|
"aria-label": (0, _upperFirst.default)(key)
|
|
45
45
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
46
46
|
className: prefix('header-cell-content')
|
|
47
|
-
}, locale
|
|
47
|
+
}, locale?.[key]))));
|
|
48
48
|
});
|
|
49
49
|
GridHeaderRow.displayName = 'CalendarGridHeaderRow';
|
|
50
50
|
var _default = exports.default = GridHeaderRow;
|
|
@@ -19,7 +19,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const GridRow = (0, _utils.forwardRef)((props, ref) => {
|
|
22
|
-
var _locale$dateLocale$op, _locale$dateLocale;
|
|
23
22
|
const {
|
|
24
23
|
as: Component = 'div',
|
|
25
24
|
className,
|
|
@@ -48,7 +47,7 @@ const GridRow = (0, _utils.forwardRef)((props, ref) => {
|
|
|
48
47
|
if (disabled) {
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
|
-
onSelect
|
|
50
|
+
onSelect?.(date, event);
|
|
52
51
|
}, [onSelect]);
|
|
53
52
|
const renderDays = () => {
|
|
54
53
|
const days = [];
|
|
@@ -57,7 +56,7 @@ const GridRow = (0, _utils.forwardRef)((props, ref) => {
|
|
|
57
56
|
// - Invalid date - when the user is inputting the date with text input
|
|
58
57
|
// - undefined - when the range selection isn't completed
|
|
59
58
|
const [selectedStartDateJS, selectedEndDateJS] = dateRange || [];
|
|
60
|
-
const [hoverStartDateJS, hoverEndDateJS] = hoverRangeValue
|
|
59
|
+
const [hoverStartDateJS, hoverEndDateJS] = hoverRangeValue ?? [];
|
|
61
60
|
const isRangeSelectionMode = typeof dateRange !== 'undefined';
|
|
62
61
|
const plainDateRange = typeof dateRange !== 'undefined' ? dateRange.map(d => d instanceof Date ? {
|
|
63
62
|
year: d.getFullYear(),
|
|
@@ -67,7 +66,7 @@ const GridRow = (0, _utils.forwardRef)((props, ref) => {
|
|
|
67
66
|
for (let i = 0; i < 7; i += 1) {
|
|
68
67
|
const thisDate = (0, _plainDate.addDays)(startingDate, i);
|
|
69
68
|
const thisDateJS = new Date(thisDate.year, thisDate.month - 1, thisDate.day);
|
|
70
|
-
const disabled = disabledDate
|
|
69
|
+
const disabled = disabledDate?.(thisDate, plainDateRange, _constants.DATERANGE_DISABLED_TARGET.CALENDAR);
|
|
71
70
|
|
|
72
71
|
// Whether this date is in a different month from the selected date
|
|
73
72
|
const isSameMonth = selected.getFullYear() === thisDate.year && selected.getMonth() + 1 === thisDate.month;
|
|
@@ -143,11 +142,11 @@ const GridRow = (0, _utils.forwardRef)((props, ref) => {
|
|
|
143
142
|
const classes = merge(className, prefix('row'));
|
|
144
143
|
const {
|
|
145
144
|
firstWeekContainsDate
|
|
146
|
-
} =
|
|
145
|
+
} = locale?.dateLocale?.options ?? {};
|
|
147
146
|
// ISO week starts on Monday
|
|
148
147
|
const date = isoWeek ? (0, _plainDate.addDays)(startingDate, 1) : startingDate;
|
|
149
148
|
const week = (0, _date.format)(new Date(date.year, date.month - 1, date.day), isoWeek ? 'I' : 'w', {
|
|
150
|
-
locale: locale
|
|
149
|
+
locale: locale?.dateLocale,
|
|
151
150
|
firstWeekContainsDate,
|
|
152
151
|
weekStartsOn: weekStart
|
|
153
152
|
});
|
|
@@ -87,7 +87,7 @@ const MonthDropdown = (0, _utils.forwardRef)((props, ref) => {
|
|
|
87
87
|
return /*#__PURE__*/_react.default.createElement(_MonthDropdownItem.default, {
|
|
88
88
|
key: (0, _plainDate.plainYearMonthToString)(yearMonth),
|
|
89
89
|
yearMonth: yearMonth,
|
|
90
|
-
disabled: isMonthDisabled
|
|
90
|
+
disabled: isMonthDisabled?.(yearMonth),
|
|
91
91
|
active: isSelectedYear && month === selectedMonth
|
|
92
92
|
});
|
|
93
93
|
})));
|