rsuite 5.2.4 → 5.4.2
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/Avatar/styles/index.less +2 -2
- package/AvatarGroup/package.json +7 -0
- package/AvatarGroup/styles/index.less +19 -0
- package/ButtonGroup/styles/index.less +0 -18
- package/CHANGELOG.md +61 -0
- package/CheckTreePicker/styles/index.less +14 -1
- package/Dropdown/styles/index.less +4 -3
- package/Modal/styles/index.less +23 -22
- package/Nav/styles/index.less +1 -0
- package/Navbar/styles/index.less +19 -5
- package/Radio/styles/index.less +6 -0
- package/Sidenav/styles/index.less +2 -2
- package/Stack/package.json +7 -0
- package/Stack/styles/index.less +5 -0
- package/TreePicker/styles/index.less +10 -14
- package/cjs/@types/common.d.ts +13 -12
- package/cjs/@types/utils.d.ts +12 -0
- package/cjs/Affix/Affix.js +8 -6
- package/cjs/Animation/Transition.d.ts +21 -12
- package/cjs/Animation/Transition.js +4 -1
- package/cjs/AutoComplete/AutoComplete.js +1 -1
- package/cjs/AutoComplete/utils.d.ts +1 -1
- package/cjs/Avatar/Avatar.js +10 -3
- package/cjs/AvatarGroup/AvatarGroup.d.ts +15 -0
- package/cjs/AvatarGroup/AvatarGroup.js +76 -0
- package/cjs/AvatarGroup/index.d.ts +3 -0
- package/cjs/AvatarGroup/index.js +11 -0
- package/cjs/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/Button/Button.js +8 -2
- package/cjs/ButtonGroup/ButtonGroup.js +14 -3
- package/cjs/ButtonGroup/ButtonGroupContext.d.ts +7 -0
- package/cjs/ButtonGroup/ButtonGroupContext.js +13 -0
- package/cjs/ButtonGroup/index.d.ts +2 -0
- package/cjs/ButtonGroup/index.js +3 -0
- package/cjs/Calendar/Calendar.d.ts +4 -4
- package/cjs/Calendar/Calendar.js +26 -22
- package/cjs/Calendar/CalendarContext.js +1 -1
- package/cjs/Calendar/Header.js +1 -3
- package/cjs/Calendar/Table.js +1 -1
- package/cjs/Calendar/TableRow.js +13 -8
- package/cjs/Calendar/TimeDropdown.js +6 -5
- package/cjs/Calendar/View.js +9 -5
- package/cjs/Calendar/types.d.ts +2 -2
- package/cjs/Calendar/useCalendarDate.d.ts +2 -2
- package/cjs/Carousel/Carousel.d.ts +1 -1
- package/cjs/Carousel/Carousel.js +1 -1
- package/cjs/Cascader/Cascader.d.ts +1 -1
- package/cjs/Cascader/Cascader.js +10 -10
- package/cjs/Cascader/DropdownMenu.d.ts +5 -4
- package/cjs/Cascader/utils.d.ts +10 -10
- package/cjs/CheckPicker/CheckPicker.d.ts +9 -4
- package/cjs/CheckPicker/CheckPicker.js +4 -4
- package/cjs/CheckPicker/test/CheckPicker.test.d.ts +1 -0
- package/cjs/CheckPicker/test/CheckPicker.test.js +76 -0
- package/cjs/CheckTree/index.js +6 -5
- package/cjs/CheckTreePicker/CheckTreeNode.d.ts +1 -1
- package/cjs/CheckTreePicker/CheckTreeNode.js +7 -9
- package/cjs/CheckTreePicker/CheckTreePicker.js +29 -25
- package/cjs/CheckTreePicker/utils.d.ts +3 -1
- package/cjs/CheckTreePicker/utils.js +12 -10
- package/cjs/Checkbox/Checkbox.d.ts +1 -1
- package/cjs/Container/Container.js +6 -3
- package/cjs/CustomProvider/CustomProvider.d.ts +31 -57
- package/cjs/DOMHelper/index.d.ts +12 -12
- package/cjs/DatePicker/DatePicker.d.ts +1 -1
- package/cjs/DatePicker/DatePicker.js +19 -11
- package/cjs/DatePicker/Toolbar.d.ts +12 -9
- package/cjs/DatePicker/Toolbar.js +6 -8
- package/cjs/DatePicker/types.d.ts +4 -4
- package/cjs/DatePicker/utils.d.ts +4 -3
- package/cjs/DateRangePicker/Calendar.d.ts +8 -7
- package/cjs/DateRangePicker/Calendar.js +1 -1
- package/cjs/DateRangePicker/DateRangePicker.d.ts +6 -6
- package/cjs/DateRangePicker/DateRangePicker.js +112 -111
- package/cjs/DateRangePicker/types.d.ts +2 -1
- package/cjs/DateRangePicker/utils.d.ts +6 -6
- package/cjs/DateRangePicker/utils.js +7 -2
- package/cjs/Disclosure/Disclosure.d.ts +8 -5
- package/cjs/Disclosure/Disclosure.js +55 -13
- package/cjs/Disclosure/DisclosureButton.d.ts +2 -2
- package/cjs/Disclosure/DisclosureButton.js +9 -7
- package/cjs/Disclosure/DisclosureContent.js +4 -6
- package/cjs/Disclosure/DisclosureContext.d.ts +8 -3
- package/cjs/Disclosure/useDisclosureContext.d.ts +2 -0
- package/cjs/Disclosure/useDisclosureContext.js +20 -0
- package/cjs/Dropdown/Dropdown.d.ts +1 -1
- package/cjs/Dropdown/Dropdown.js +1 -1
- package/cjs/Dropdown/DropdownContext.d.ts +2 -2
- package/cjs/Dropdown/DropdownItem.js +10 -11
- package/cjs/Dropdown/DropdownMenu.d.ts +3 -3
- package/cjs/Dropdown/DropdownMenu.js +81 -23
- package/cjs/Dropdown/DropdownState.d.ts +1 -1
- package/cjs/Dropdown/DropdownToggle.js +10 -2
- package/cjs/Dropdown/useRenderDropdownItem.d.ts +1 -1
- package/cjs/Form/Form.js +1 -1
- package/cjs/Form/FormContext.d.ts +1 -1
- package/cjs/FormControl/FormControl.d.ts +1 -1
- package/cjs/FormControl/FormControl.js +5 -4
- package/cjs/FormGroup/FormGroup.d.ts +1 -1
- package/cjs/FormGroup/FormGroup.js +9 -4
- package/cjs/Input/Input.d.ts +3 -2
- package/cjs/InputGroup/InputGroup.d.ts +1 -1
- package/cjs/InputNumber/InputNumber.js +6 -2
- package/cjs/InputPicker/InputAutosize.js +4 -4
- package/cjs/InputPicker/InputPicker.d.ts +2 -2
- package/cjs/InputPicker/InputPicker.js +15 -10
- package/cjs/List/ListContext.d.ts +1 -1
- package/cjs/List/ListContext.js +8 -1
- package/cjs/List/helper/AutoScroller.js +4 -2
- package/cjs/List/helper/useManager.d.ts +3 -3
- package/cjs/List/helper/useManager.js +1 -1
- package/cjs/List/helper/useSortHelper.d.ts +3 -3
- package/cjs/List/helper/useSortHelper.js +6 -4
- package/cjs/List/helper/utils.d.ts +2 -2
- package/cjs/MaskedInput/TextMask.d.ts +5 -5
- package/cjs/MaskedInput/adjustCaretPosition.d.ts +6 -6
- package/cjs/MaskedInput/conformToMask.js +5 -4
- package/cjs/MaskedInput/createTextMaskInputElement.d.ts +2 -2
- package/cjs/MaskedInput/utilities.d.ts +1 -1
- package/cjs/Menu/Menu.js +14 -7
- package/cjs/Menu/MenuContext.d.ts +1 -1
- package/cjs/Menu/MenuItem.d.ts +1 -1
- package/cjs/Menu/MenuItem.js +19 -15
- package/cjs/Menu/Menubar.js +8 -8
- package/cjs/Menu/useMenu.js +17 -7
- package/cjs/Modal/Modal.js +39 -21
- package/cjs/Modal/ModalContext.d.ts +2 -2
- package/cjs/Modal/utils.d.ts +1 -1
- package/cjs/Modal/utils.js +3 -5
- package/cjs/MultiCascader/DropdownMenu.d.ts +4 -4
- package/cjs/MultiCascader/MultiCascader.js +6 -6
- package/cjs/MultiCascader/utils.d.ts +17 -17
- package/cjs/Nav/Nav.d.ts +1 -1
- package/cjs/Nav/Nav.js +10 -12
- package/cjs/Nav/NavContext.d.ts +7 -1
- package/cjs/Nav/NavContext.js +1 -0
- package/cjs/Nav/NavItem.d.ts +1 -1
- package/cjs/Navbar/Navbar.js +1 -1
- package/cjs/Navbar/NavbarItem.d.ts +1 -1
- package/cjs/Navbar/index.d.ts +1 -0
- package/cjs/Navbar/index.js +4 -3
- package/cjs/Overlay/Modal.d.ts +2 -2
- package/cjs/Overlay/Modal.js +71 -63
- package/cjs/Overlay/ModalManager.d.ts +17 -8
- package/cjs/Overlay/ModalManager.js +11 -20
- package/cjs/Overlay/Overlay.d.ts +3 -3
- package/cjs/Overlay/Overlay.js +8 -2
- package/cjs/Overlay/OverlayContext.d.ts +6 -0
- package/cjs/Overlay/OverlayContext.js +14 -0
- package/cjs/Overlay/OverlayTrigger.d.ts +11 -11
- package/cjs/Overlay/OverlayTrigger.js +21 -7
- package/cjs/Overlay/Position.d.ts +4 -4
- package/cjs/Overlay/Position.js +14 -8
- package/cjs/Overlay/positionUtils.d.ts +1 -1
- package/cjs/Overlay/positionUtils.js +8 -8
- package/cjs/Pagination/Pagination.d.ts +1 -1
- package/cjs/Pagination/PaginationButton.d.ts +3 -3
- package/cjs/Pagination/PaginationGroup.js +5 -3
- package/cjs/Panel/Panel.d.ts +1 -1
- package/cjs/Panel/Panel.js +2 -2
- package/cjs/PanelGroup/PanelGroup.d.ts +2 -2
- package/cjs/PanelGroup/PanelGroup.js +8 -5
- package/cjs/Picker/DropdownMenu.d.ts +8 -5
- package/cjs/Picker/DropdownMenu.js +5 -5
- package/cjs/Picker/PickerOverlay.js +4 -3
- package/cjs/Picker/PickerToggle.js +4 -3
- package/cjs/Picker/PickerToggleTrigger.d.ts +2 -6
- package/cjs/Picker/SearchBar.d.ts +1 -1
- package/cjs/Picker/SelectedElement.js +2 -1
- package/cjs/Picker/propTypes.d.ts +5 -7
- package/cjs/Picker/propTypes.js +4 -3
- package/cjs/Picker/utils.d.ts +11 -11
- package/cjs/Picker/utils.js +22 -18
- package/cjs/Placeholder/PlaceholderGrid.js +1 -1
- package/cjs/Plaintext/Plaintext.js +2 -1
- package/cjs/Radio/Radio.d.ts +1 -1
- package/cjs/RadioGroup/RadioGroup.d.ts +2 -2
- package/cjs/RadioGroup/RadioGroup.js +1 -1
- package/cjs/RangeSlider/RangeSlider.d.ts +2 -2
- package/cjs/RangeSlider/RangeSlider.js +6 -4
- package/cjs/Rate/Character.js +4 -2
- package/cjs/Rate/Rate.js +2 -1
- package/cjs/Ripple/Ripple.js +1 -1
- package/cjs/SelectPicker/SelectPicker.d.ts +12 -5
- package/cjs/SelectPicker/SelectPicker.js +8 -8
- package/cjs/SelectPicker/index.d.ts +1 -1
- package/cjs/SelectPicker/test/SelectPicker.test.d.ts +1 -0
- package/cjs/SelectPicker/test/SelectPicker.test.js +62 -0
- package/cjs/Sidenav/Node.d.ts +1 -1
- package/cjs/Sidenav/Sidenav.d.ts +4 -4
- package/cjs/Sidenav/Sidenav.js +5 -2
- package/cjs/Sidenav/SidenavDropdown.js +11 -8
- package/cjs/Sidenav/SidenavDropdownItem.js +10 -5
- package/cjs/Sidenav/SidenavDropdownMenu.js +9 -5
- package/cjs/Sidenav/SidenavItem.d.ts +1 -1
- package/cjs/Sidenav/SidenavItem.js +4 -0
- package/cjs/Slider/Graduated.d.ts +5 -5
- package/cjs/Slider/Handle.d.ts +1 -1
- package/cjs/Slider/Handle.js +10 -6
- package/cjs/Slider/Mark.d.ts +1 -1
- package/cjs/Slider/Slider.d.ts +1 -1
- package/cjs/Slider/Slider.js +2 -2
- package/cjs/Slider/utils.d.ts +2 -1
- package/cjs/Slider/utils.js +4 -5
- package/cjs/Stack/Stack.d.ts +26 -0
- package/cjs/Stack/Stack.js +86 -0
- package/cjs/Stack/index.d.ts +3 -0
- package/cjs/Stack/index.js +11 -0
- package/cjs/Steps/StepItem.js +1 -1
- package/cjs/TagInput/index.js +1 -1
- package/cjs/Toggle/Toggle.js +5 -4
- package/cjs/Tree/Tree.d.ts +3 -2
- package/cjs/Tree/Tree.js +6 -5
- package/cjs/Tree/TreeContext.d.ts +0 -1
- package/cjs/TreePicker/TreeNode.js +7 -22
- package/cjs/TreePicker/TreePicker.js +32 -52
- package/cjs/Uploader/UploadFileItem.d.ts +1 -1
- package/cjs/Uploader/UploadFileItem.js +2 -2
- package/cjs/Uploader/UploadTrigger.d.ts +1 -1
- package/cjs/Uploader/UploadTrigger.js +2 -3
- package/cjs/Uploader/Uploader.d.ts +5 -5
- package/cjs/Uploader/Uploader.js +1 -2
- package/cjs/index.d.ts +6 -2
- package/cjs/index.js +13 -5
- package/cjs/locales/index.d.ts +3 -3
- package/cjs/toaster/ToastContainer.d.ts +1 -1
- package/cjs/toaster/ToastContainer.js +1 -1
- package/cjs/toaster/toaster.js +3 -1
- package/cjs/utils/BrowserDetection.js +1 -1
- package/cjs/utils/ReactChildren.d.ts +2 -2
- package/cjs/utils/ajaxUpload.d.ts +1 -1
- package/cjs/utils/ajaxUpload.js +5 -4
- package/cjs/utils/appendTooltip.d.ts +1 -1
- package/cjs/utils/constants.d.ts +4 -4
- package/cjs/utils/createChainedFunction.d.ts +1 -1
- package/cjs/utils/getDataGroupBy.d.ts +1 -1
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +7 -2
- package/cjs/utils/mergeRefs.d.ts +2 -2
- package/cjs/utils/previewFile.d.ts +1 -1
- package/cjs/utils/propTypeChecker.d.ts +6 -2
- package/cjs/utils/propTypeChecker.js +7 -6
- package/cjs/utils/reactToString.d.ts +2 -1
- package/cjs/utils/statusIcons.d.ts +1 -1
- package/cjs/utils/stringToObject.d.ts +1 -1
- package/cjs/utils/treeUtils.d.ts +35 -32
- package/cjs/utils/treeUtils.js +46 -23
- package/cjs/utils/useControlled.d.ts +6 -1
- package/cjs/utils/useControlled.js +0 -8
- package/cjs/utils/useCustom.js +6 -4
- package/cjs/utils/useFocus.d.ts +2 -2
- package/cjs/utils/useMount.d.ts +2 -0
- package/cjs/utils/useMount.js +19 -0
- package/cjs/utils/usePortal.d.ts +2 -2
- package/cjs/utils/useRootClose.d.ts +2 -2
- package/cjs/utils/useTimeout.d.ts +1 -1
- package/cjs/utils/useTimeout.js +5 -3
- package/dist/rsuite-rtl.css +95 -210
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +95 -210
- package/dist/rsuite.js +214 -115
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/@types/common.d.ts +13 -12
- package/esm/@types/utils.d.ts +12 -0
- package/esm/Affix/Affix.js +9 -7
- package/esm/Animation/Transition.d.ts +21 -12
- package/esm/Animation/Transition.js +4 -1
- package/esm/AutoComplete/AutoComplete.js +1 -1
- package/esm/AutoComplete/utils.d.ts +1 -1
- package/esm/Avatar/Avatar.js +7 -3
- package/esm/AvatarGroup/AvatarGroup.d.ts +15 -0
- package/esm/AvatarGroup/AvatarGroup.js +57 -0
- package/esm/AvatarGroup/index.d.ts +3 -0
- package/esm/AvatarGroup/index.js +2 -0
- package/esm/Breadcrumb/Breadcrumb.js +1 -1
- package/esm/Button/Button.js +6 -2
- package/esm/ButtonGroup/ButtonGroup.js +11 -3
- package/esm/ButtonGroup/ButtonGroupContext.d.ts +7 -0
- package/esm/ButtonGroup/ButtonGroupContext.js +3 -0
- package/esm/ButtonGroup/index.d.ts +2 -0
- package/esm/ButtonGroup/index.js +2 -0
- package/esm/Calendar/Calendar.d.ts +4 -4
- package/esm/Calendar/Calendar.js +27 -23
- package/esm/Calendar/CalendarContext.js +1 -1
- package/esm/Calendar/Header.js +1 -3
- package/esm/Calendar/Table.js +1 -1
- package/esm/Calendar/TableRow.js +14 -9
- package/esm/Calendar/TimeDropdown.js +5 -4
- package/esm/Calendar/View.js +10 -6
- package/esm/Calendar/types.d.ts +2 -2
- package/esm/Calendar/useCalendarDate.d.ts +2 -2
- package/esm/Carousel/Carousel.d.ts +1 -1
- package/esm/Carousel/Carousel.js +1 -1
- package/esm/Cascader/Cascader.d.ts +1 -1
- package/esm/Cascader/Cascader.js +10 -10
- package/esm/Cascader/DropdownMenu.d.ts +5 -4
- package/esm/Cascader/utils.d.ts +10 -10
- package/esm/CheckPicker/CheckPicker.d.ts +9 -4
- package/esm/CheckPicker/CheckPicker.js +4 -4
- package/esm/CheckPicker/test/CheckPicker.test.d.ts +1 -0
- package/esm/CheckPicker/test/CheckPicker.test.js +64 -0
- package/esm/CheckTree/index.js +7 -6
- package/esm/CheckTreePicker/CheckTreeNode.d.ts +1 -1
- package/esm/CheckTreePicker/CheckTreeNode.js +4 -7
- package/esm/CheckTreePicker/CheckTreePicker.js +28 -23
- package/esm/CheckTreePicker/utils.d.ts +3 -1
- package/esm/CheckTreePicker/utils.js +12 -10
- package/esm/Checkbox/Checkbox.d.ts +1 -1
- package/esm/Container/Container.js +7 -4
- package/esm/CustomProvider/CustomProvider.d.ts +31 -57
- package/esm/DOMHelper/index.d.ts +12 -12
- package/esm/DatePicker/DatePicker.d.ts +1 -1
- package/esm/DatePicker/DatePicker.js +18 -11
- package/esm/DatePicker/Toolbar.d.ts +12 -9
- package/esm/DatePicker/Toolbar.js +6 -8
- package/esm/DatePicker/types.d.ts +4 -4
- package/esm/DatePicker/utils.d.ts +4 -3
- package/esm/DateRangePicker/Calendar.d.ts +8 -7
- package/esm/DateRangePicker/Calendar.js +1 -1
- package/esm/DateRangePicker/DateRangePicker.d.ts +6 -6
- package/esm/DateRangePicker/DateRangePicker.js +112 -111
- package/esm/DateRangePicker/types.d.ts +2 -1
- package/esm/DateRangePicker/utils.d.ts +6 -6
- package/esm/DateRangePicker/utils.js +6 -2
- package/esm/Disclosure/Disclosure.d.ts +8 -5
- package/esm/Disclosure/Disclosure.js +56 -15
- package/esm/Disclosure/DisclosureButton.d.ts +2 -2
- package/esm/Disclosure/DisclosureButton.js +8 -7
- package/esm/Disclosure/DisclosureContent.js +5 -7
- package/esm/Disclosure/DisclosureContext.d.ts +8 -3
- package/esm/Disclosure/useDisclosureContext.d.ts +2 -0
- package/esm/Disclosure/useDisclosureContext.js +11 -0
- package/esm/Dropdown/Dropdown.d.ts +1 -1
- package/esm/Dropdown/Dropdown.js +1 -1
- package/esm/Dropdown/DropdownContext.d.ts +2 -2
- package/esm/Dropdown/DropdownItem.js +10 -10
- package/esm/Dropdown/DropdownMenu.d.ts +3 -3
- package/esm/Dropdown/DropdownMenu.js +82 -24
- package/esm/Dropdown/DropdownState.d.ts +1 -1
- package/esm/Dropdown/DropdownToggle.js +9 -2
- package/esm/Dropdown/useRenderDropdownItem.d.ts +1 -1
- package/esm/Form/Form.js +1 -1
- package/esm/Form/FormContext.d.ts +1 -1
- package/esm/FormControl/FormControl.d.ts +1 -1
- package/esm/FormControl/FormControl.js +5 -4
- package/esm/FormGroup/FormGroup.d.ts +1 -1
- package/esm/FormGroup/FormGroup.js +7 -4
- package/esm/Input/Input.d.ts +3 -2
- package/esm/InputGroup/InputGroup.d.ts +1 -1
- package/esm/InputNumber/InputNumber.js +6 -2
- package/esm/InputPicker/InputAutosize.js +4 -4
- package/esm/InputPicker/InputPicker.d.ts +2 -2
- package/esm/InputPicker/InputPicker.js +15 -10
- package/esm/List/ListContext.d.ts +1 -1
- package/esm/List/ListContext.js +7 -1
- package/esm/List/helper/AutoScroller.js +4 -2
- package/esm/List/helper/useManager.d.ts +3 -3
- package/esm/List/helper/useManager.js +1 -1
- package/esm/List/helper/useSortHelper.d.ts +3 -3
- package/esm/List/helper/useSortHelper.js +6 -4
- package/esm/List/helper/utils.d.ts +2 -2
- package/esm/MaskedInput/TextMask.d.ts +5 -5
- package/esm/MaskedInput/adjustCaretPosition.d.ts +6 -6
- package/esm/MaskedInput/conformToMask.js +5 -4
- package/esm/MaskedInput/createTextMaskInputElement.d.ts +2 -2
- package/esm/MaskedInput/utilities.d.ts +1 -1
- package/esm/Menu/Menu.js +13 -7
- package/esm/Menu/MenuContext.d.ts +1 -1
- package/esm/Menu/MenuItem.d.ts +1 -1
- package/esm/Menu/MenuItem.js +18 -15
- package/esm/Menu/Menubar.js +7 -8
- package/esm/Menu/useMenu.js +17 -7
- package/esm/Modal/Modal.js +41 -23
- package/esm/Modal/ModalContext.d.ts +2 -2
- package/esm/Modal/utils.d.ts +1 -1
- package/esm/Modal/utils.js +3 -5
- package/esm/MultiCascader/DropdownMenu.d.ts +4 -4
- package/esm/MultiCascader/MultiCascader.js +6 -6
- package/esm/MultiCascader/utils.d.ts +17 -17
- package/esm/Nav/Nav.d.ts +1 -1
- package/esm/Nav/Nav.js +11 -13
- package/esm/Nav/NavContext.d.ts +7 -1
- package/esm/Nav/NavContext.js +1 -0
- package/esm/Nav/NavItem.d.ts +1 -1
- package/esm/Navbar/Navbar.js +1 -1
- package/esm/Navbar/NavbarItem.d.ts +1 -1
- package/esm/Navbar/index.d.ts +1 -0
- package/esm/Navbar/index.js +1 -0
- package/esm/Overlay/Modal.d.ts +2 -2
- package/esm/Overlay/Modal.js +72 -64
- package/esm/Overlay/ModalManager.d.ts +17 -8
- package/esm/Overlay/ModalManager.js +11 -20
- package/esm/Overlay/Overlay.d.ts +3 -3
- package/esm/Overlay/Overlay.js +8 -3
- package/esm/Overlay/OverlayContext.d.ts +6 -0
- package/esm/Overlay/OverlayContext.js +4 -0
- package/esm/Overlay/OverlayTrigger.d.ts +11 -11
- package/esm/Overlay/OverlayTrigger.js +21 -8
- package/esm/Overlay/Position.d.ts +4 -4
- package/esm/Overlay/Position.js +14 -8
- package/esm/Overlay/positionUtils.d.ts +1 -1
- package/esm/Overlay/positionUtils.js +6 -6
- package/esm/Pagination/Pagination.d.ts +1 -1
- package/esm/Pagination/PaginationButton.d.ts +3 -3
- package/esm/Pagination/PaginationGroup.js +5 -3
- package/esm/Panel/Panel.d.ts +1 -1
- package/esm/Panel/Panel.js +2 -2
- package/esm/PanelGroup/PanelGroup.d.ts +2 -2
- package/esm/PanelGroup/PanelGroup.js +9 -6
- package/esm/Picker/DropdownMenu.d.ts +8 -5
- package/esm/Picker/DropdownMenu.js +5 -5
- package/esm/Picker/PickerOverlay.js +4 -3
- package/esm/Picker/PickerToggle.js +4 -3
- package/esm/Picker/PickerToggleTrigger.d.ts +2 -6
- package/esm/Picker/SearchBar.d.ts +1 -1
- package/esm/Picker/SelectedElement.js +2 -1
- package/esm/Picker/propTypes.d.ts +5 -7
- package/esm/Picker/propTypes.js +4 -3
- package/esm/Picker/utils.d.ts +11 -11
- package/esm/Picker/utils.js +21 -18
- package/esm/Placeholder/PlaceholderGrid.js +1 -1
- package/esm/Plaintext/Plaintext.js +2 -1
- package/esm/Radio/Radio.d.ts +1 -1
- package/esm/RadioGroup/RadioGroup.d.ts +2 -2
- package/esm/RadioGroup/RadioGroup.js +1 -1
- package/esm/RangeSlider/RangeSlider.d.ts +2 -2
- package/esm/RangeSlider/RangeSlider.js +5 -4
- package/esm/Rate/Character.js +3 -2
- package/esm/Rate/Rate.js +2 -1
- package/esm/Ripple/Ripple.js +1 -1
- package/esm/SelectPicker/SelectPicker.d.ts +12 -5
- package/esm/SelectPicker/SelectPicker.js +8 -8
- package/esm/SelectPicker/index.d.ts +1 -1
- package/esm/SelectPicker/test/SelectPicker.test.d.ts +1 -0
- package/esm/SelectPicker/test/SelectPicker.test.js +52 -0
- package/esm/Sidenav/Node.d.ts +1 -1
- package/esm/Sidenav/Sidenav.d.ts +4 -4
- package/esm/Sidenav/Sidenav.js +5 -2
- package/esm/Sidenav/SidenavDropdown.js +11 -7
- package/esm/Sidenav/SidenavDropdownItem.js +11 -5
- package/esm/Sidenav/SidenavDropdownMenu.js +9 -5
- package/esm/Sidenav/SidenavItem.d.ts +1 -1
- package/esm/Sidenav/SidenavItem.js +4 -0
- package/esm/Slider/Graduated.d.ts +5 -5
- package/esm/Slider/Handle.d.ts +1 -1
- package/esm/Slider/Handle.js +10 -6
- package/esm/Slider/Mark.d.ts +1 -1
- package/esm/Slider/Slider.d.ts +1 -1
- package/esm/Slider/Slider.js +2 -2
- package/esm/Slider/utils.d.ts +2 -1
- package/esm/Slider/utils.js +5 -2
- package/esm/Stack/Stack.d.ts +26 -0
- package/esm/Stack/Stack.js +71 -0
- package/esm/Stack/index.d.ts +3 -0
- package/esm/Stack/index.js +2 -0
- package/esm/Steps/StepItem.js +1 -1
- package/esm/TagInput/index.js +1 -1
- package/esm/Toggle/Toggle.js +5 -4
- package/esm/Tree/Tree.d.ts +3 -2
- package/esm/Tree/Tree.js +7 -6
- package/esm/Tree/TreeContext.d.ts +0 -1
- package/esm/TreePicker/TreeNode.js +6 -21
- package/esm/TreePicker/TreePicker.js +31 -50
- package/esm/Uploader/UploadFileItem.d.ts +1 -1
- package/esm/Uploader/UploadFileItem.js +2 -2
- package/esm/Uploader/UploadTrigger.d.ts +1 -1
- package/esm/Uploader/UploadTrigger.js +2 -3
- package/esm/Uploader/Uploader.d.ts +5 -5
- package/esm/Uploader/Uploader.js +1 -2
- package/esm/index.d.ts +6 -2
- package/esm/index.js +3 -1
- package/esm/locales/index.d.ts +3 -3
- package/esm/toaster/ToastContainer.d.ts +1 -1
- package/esm/toaster/ToastContainer.js +1 -1
- package/esm/toaster/toaster.js +3 -1
- package/esm/utils/BrowserDetection.js +1 -1
- package/esm/utils/ReactChildren.d.ts +2 -2
- package/esm/utils/ajaxUpload.d.ts +1 -1
- package/esm/utils/ajaxUpload.js +5 -4
- package/esm/utils/appendTooltip.d.ts +1 -1
- package/esm/utils/constants.d.ts +4 -4
- package/esm/utils/createChainedFunction.d.ts +1 -1
- package/esm/utils/getDataGroupBy.d.ts +1 -1
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.js +2 -1
- package/esm/utils/mergeRefs.d.ts +2 -2
- package/esm/utils/previewFile.d.ts +1 -1
- package/esm/utils/propTypeChecker.d.ts +6 -2
- package/esm/utils/propTypeChecker.js +7 -6
- package/esm/utils/reactToString.d.ts +2 -1
- package/esm/utils/statusIcons.d.ts +1 -1
- package/esm/utils/stringToObject.d.ts +1 -1
- package/esm/utils/treeUtils.d.ts +35 -32
- package/esm/utils/treeUtils.js +45 -21
- package/esm/utils/useControlled.d.ts +6 -1
- package/esm/utils/useControlled.js +0 -8
- package/esm/utils/useCustom.js +6 -4
- package/esm/utils/useFocus.d.ts +2 -2
- package/esm/utils/useMount.d.ts +2 -0
- package/esm/utils/useMount.js +13 -0
- package/esm/utils/usePortal.d.ts +2 -2
- package/esm/utils/useRootClose.d.ts +2 -2
- package/esm/utils/useTimeout.d.ts +1 -1
- package/esm/utils/useTimeout.js +5 -3
- package/package.json +2 -2
- package/styles/index.less +2 -0
package/esm/Menu/useMenu.js
CHANGED
|
@@ -43,8 +43,10 @@ export function menuReducer(state, action) {
|
|
|
43
43
|
|
|
44
44
|
switch (action.to) {
|
|
45
45
|
case MoveFocusTo.Next:
|
|
46
|
-
for (var i =
|
|
47
|
-
|
|
46
|
+
for (var i = activeItemIndex === null ? 0 : activeItemIndex + 1; i < items.length; i++) {
|
|
47
|
+
var _items$i$props;
|
|
48
|
+
|
|
49
|
+
if (!((_items$i$props = items[i].props) !== null && _items$i$props !== void 0 && _items$i$props.disabled)) {
|
|
48
50
|
nextActiveItemIndex = i;
|
|
49
51
|
break;
|
|
50
52
|
}
|
|
@@ -53,8 +55,10 @@ export function menuReducer(state, action) {
|
|
|
53
55
|
break;
|
|
54
56
|
|
|
55
57
|
case MoveFocusTo.Prev:
|
|
56
|
-
for (var _i =
|
|
57
|
-
|
|
58
|
+
for (var _i = activeItemIndex === null ? items.length - 1 : activeItemIndex - 1; _i >= 0; _i--) {
|
|
59
|
+
var _items$_i$props;
|
|
60
|
+
|
|
61
|
+
if (!((_items$_i$props = items[_i].props) !== null && _items$_i$props !== void 0 && _items$_i$props.disabled)) {
|
|
58
62
|
nextActiveItemIndex = _i;
|
|
59
63
|
break;
|
|
60
64
|
}
|
|
@@ -64,7 +68,9 @@ export function menuReducer(state, action) {
|
|
|
64
68
|
|
|
65
69
|
case MoveFocusTo.First:
|
|
66
70
|
for (var _i2 = 0; _i2 < items.length; _i2++) {
|
|
67
|
-
|
|
71
|
+
var _items$_i2$props;
|
|
72
|
+
|
|
73
|
+
if (!((_items$_i2$props = items[_i2].props) !== null && _items$_i2$props !== void 0 && _items$_i2$props.disabled)) {
|
|
68
74
|
nextActiveItemIndex = _i2;
|
|
69
75
|
break;
|
|
70
76
|
}
|
|
@@ -74,7 +80,9 @@ export function menuReducer(state, action) {
|
|
|
74
80
|
|
|
75
81
|
case MoveFocusTo.Last:
|
|
76
82
|
for (var _i3 = items.length - 1; _i3 >= 0; _i3--) {
|
|
77
|
-
|
|
83
|
+
var _items$_i3$props;
|
|
84
|
+
|
|
85
|
+
if (!((_items$_i3$props = items[_i3].props) !== null && _items$_i3$props !== void 0 && _items$_i3$props.disabled)) {
|
|
78
86
|
nextActiveItemIndex = _i3;
|
|
79
87
|
break;
|
|
80
88
|
}
|
|
@@ -84,7 +92,9 @@ export function menuReducer(state, action) {
|
|
|
84
92
|
|
|
85
93
|
case MoveFocusTo.Specific:
|
|
86
94
|
for (var _i4 = 0; _i4 < items.length; _i4++) {
|
|
87
|
-
|
|
95
|
+
var _items$_i4$props;
|
|
96
|
+
|
|
97
|
+
if (items[_i4].element.id === action.id && !((_items$_i4$props = items[_i4].props) !== null && _items$_i4$props !== void 0 && _items$_i4$props.disabled)) {
|
|
88
98
|
nextActiveItemIndex = _i4;
|
|
89
99
|
break;
|
|
90
100
|
}
|
package/esm/Modal/Modal.js
CHANGED
|
@@ -4,14 +4,14 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
6
|
|
|
7
|
-
import React, { useRef, useMemo, useState,
|
|
7
|
+
import React, { useRef, useMemo, useState, useCallback } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import pick from 'lodash/pick';
|
|
10
10
|
import on from 'dom-lib/on';
|
|
11
|
-
import
|
|
11
|
+
import getAnimationEnd from 'dom-lib/getAnimationEnd';
|
|
12
12
|
import BaseModal, { modalPropTypes } from '../Overlay/Modal';
|
|
13
13
|
import Bounce from '../Animation/Bounce';
|
|
14
|
-
import { useClassNames, mergeRefs, SIZE } from '../utils';
|
|
14
|
+
import { useClassNames, mergeRefs, SIZE, useWillUnmount } from '../utils';
|
|
15
15
|
import ModalDialog, { modalDialogPropTypes } from './ModalDialog';
|
|
16
16
|
import { ModalContext } from './ModalContext';
|
|
17
17
|
import ModalBody from './ModalBody';
|
|
@@ -43,7 +43,8 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
43
43
|
animationTimeout = _props$animationTimeo === void 0 ? 300 : _props$animationTimeo,
|
|
44
44
|
_props$overflow = props.overflow,
|
|
45
45
|
overflow = _props$overflow === void 0 ? true : _props$overflow,
|
|
46
|
-
drawer = props.drawer,
|
|
46
|
+
_props$drawer = props.drawer,
|
|
47
|
+
drawer = _props$drawer === void 0 ? false : _props$drawer,
|
|
47
48
|
onClose = props.onClose,
|
|
48
49
|
onEntered = props.onEntered,
|
|
49
50
|
onEntering = props.onEntering,
|
|
@@ -63,10 +64,14 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
63
64
|
merge = _useClassNames.merge,
|
|
64
65
|
prefix = _useClassNames.prefix;
|
|
65
66
|
|
|
67
|
+
var _useState = useState(false),
|
|
68
|
+
shake = _useState[0],
|
|
69
|
+
setShake = _useState[1];
|
|
70
|
+
|
|
66
71
|
var classes = merge(className, prefix(size, {
|
|
67
72
|
full: full
|
|
68
73
|
}));
|
|
69
|
-
var dialogRef = useRef();
|
|
74
|
+
var dialogRef = useRef(null);
|
|
70
75
|
var transitionEndListener = useRef(); // The style of the Modal body will be updated with the size of the window or container.
|
|
71
76
|
|
|
72
77
|
var _useBodyStyles = useBodyStyles(dialogRef, {
|
|
@@ -89,26 +94,13 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
94
|
isDrawer: drawer
|
|
90
95
|
};
|
|
91
96
|
}, [dialogId, onClose, bodyStyles, drawer]);
|
|
92
|
-
|
|
93
|
-
var _useState = useState(false),
|
|
94
|
-
shake = _useState[0],
|
|
95
|
-
setShake = _useState[1];
|
|
96
|
-
|
|
97
|
-
var handleBackdropClick = useCallback(function () {
|
|
98
|
-
// When the value of `backdrop` is `static`, a jitter animation will be added to the dialog when clicked.
|
|
99
|
-
if (backdrop === 'static') {
|
|
100
|
-
setShake(true);
|
|
101
|
-
transitionEndListener.current = on(dialogRef.current, getTransitionEnd(), function () {
|
|
102
|
-
setShake(false);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}, [backdrop]);
|
|
106
97
|
var handleExited = useCallback(function (node) {
|
|
107
98
|
var _transitionEndListene;
|
|
108
99
|
|
|
109
100
|
onExited === null || onExited === void 0 ? void 0 : onExited(node);
|
|
110
101
|
onDestroyEvents();
|
|
111
102
|
(_transitionEndListene = transitionEndListener.current) === null || _transitionEndListene === void 0 ? void 0 : _transitionEndListene.off();
|
|
103
|
+
transitionEndListener.current = null;
|
|
112
104
|
}, [onDestroyEvents, onExited]);
|
|
113
105
|
var handleEntered = useCallback(function (node) {
|
|
114
106
|
onEntered === null || onEntered === void 0 ? void 0 : onEntered(node);
|
|
@@ -118,11 +110,37 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
118
110
|
onEntering === null || onEntering === void 0 ? void 0 : onEntering(node);
|
|
119
111
|
onChangeBodyStyles(true);
|
|
120
112
|
}, [onChangeBodyStyles, onEntering]);
|
|
121
|
-
|
|
113
|
+
var handleBackdropClick = useCallback(function (e) {
|
|
114
|
+
if (e.target !== e.currentTarget) {
|
|
115
|
+
return;
|
|
116
|
+
} // When the value of `backdrop` is `static`, a jitter animation will be added to the dialog when clicked.
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
if (backdrop === 'static') {
|
|
120
|
+
setShake(true);
|
|
121
|
+
|
|
122
|
+
if (!transitionEndListener.current && dialogRef.current) {
|
|
123
|
+
//fix: https://github.com/rsuite/rsuite/blob/a93d13c14fb20cc58204babe3331d3c3da3fe1fd/src/Modal/styles/index.less#L59
|
|
124
|
+
transitionEndListener.current = on(dialogRef.current, getAnimationEnd(), function () {
|
|
125
|
+
setShake(false);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
133
|
+
}, [backdrop, onClose]);
|
|
134
|
+
var handleClick = useCallback(function (e) {
|
|
135
|
+
if (dialogRef.current && e.target !== dialogRef.current) {
|
|
136
|
+
handleBackdropClick(e);
|
|
137
|
+
}
|
|
138
|
+
}, [handleBackdropClick]);
|
|
139
|
+
useWillUnmount(function () {
|
|
122
140
|
var _transitionEndListene2;
|
|
123
141
|
|
|
124
142
|
(_transitionEndListene2 = transitionEndListener.current) === null || _transitionEndListene2 === void 0 ? void 0 : _transitionEndListene2.off();
|
|
125
|
-
}
|
|
143
|
+
});
|
|
126
144
|
return /*#__PURE__*/React.createElement(ModalContext.Provider, {
|
|
127
145
|
value: modalContextValue
|
|
128
146
|
}, /*#__PURE__*/React.createElement(BaseModal, _extends({}, rest, {
|
|
@@ -130,7 +148,6 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
130
148
|
backdrop: backdrop,
|
|
131
149
|
open: open,
|
|
132
150
|
onClose: onClose,
|
|
133
|
-
onBackdropClick: handleBackdropClick,
|
|
134
151
|
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["wrapper"]))),
|
|
135
152
|
onEntered: handleEntered,
|
|
136
153
|
onEntering: handleEntering,
|
|
@@ -143,7 +160,8 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
143
160
|
transition: animation ? animation : undefined,
|
|
144
161
|
animationProps: animationProps,
|
|
145
162
|
dialogTransitionTimeout: animationTimeout,
|
|
146
|
-
backdropTransitionTimeout: 150
|
|
163
|
+
backdropTransitionTimeout: 150,
|
|
164
|
+
onClick: backdrop ? handleClick : undefined
|
|
147
165
|
}), function (transitionProps, transitionRef) {
|
|
148
166
|
var transitionClassName = transitionProps.className,
|
|
149
167
|
transitionRest = _objectWithoutPropertiesLoose(transitionProps, ["className"]);
|
|
@@ -3,10 +3,10 @@ export interface ModalContextProps {
|
|
|
3
3
|
/** ID of the dialog element */
|
|
4
4
|
dialogId: string;
|
|
5
5
|
/** Pass the close event callback to the header close button. */
|
|
6
|
-
onModalClose
|
|
6
|
+
onModalClose?: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
7
7
|
/** Pass the latest style to body. */
|
|
8
8
|
getBodyStyles?: () => React.CSSProperties;
|
|
9
9
|
/** Whether this Modal is a Drawer */
|
|
10
10
|
isDrawer: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare const ModalContext: React.Context<ModalContextProps>;
|
|
12
|
+
export declare const ModalContext: React.Context<ModalContextProps | null>;
|
package/esm/Modal/utils.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare const useBodyStyles: (ref: React.RefObject<HTMLElement>, options:
|
|
|
3
3
|
overflow: boolean;
|
|
4
4
|
drawer: boolean;
|
|
5
5
|
prefix: (...classes: any) => string;
|
|
6
|
-
}) => [import("react").CSSProperties, (entering?: boolean) => void, () => void];
|
|
6
|
+
}) => [import("react").CSSProperties, (entering?: boolean | undefined) => void, () => void];
|
package/esm/Modal/utils.js
CHANGED
|
@@ -11,7 +11,7 @@ export var useBodyStyles = function useBodyStyles(ref, options) {
|
|
|
11
11
|
drawer = options.drawer,
|
|
12
12
|
prefix = options.prefix;
|
|
13
13
|
var windowResizeListener = useRef();
|
|
14
|
-
var contentElement = useRef();
|
|
14
|
+
var contentElement = useRef(null);
|
|
15
15
|
var contentElementResizeObserver = useRef();
|
|
16
16
|
var updateBodyStyles = useCallback(function (_event, entering) {
|
|
17
17
|
var dialog = ref.current;
|
|
@@ -48,10 +48,8 @@ export var useBodyStyles = function useBodyStyles(ref, options) {
|
|
|
48
48
|
}, []);
|
|
49
49
|
var onChangeBodyStyles = useCallback(function (entering) {
|
|
50
50
|
if (overflow && !drawer) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
updateBodyStyles(null, entering);
|
|
54
|
-
contentElement.current = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector("." + prefix('content'));
|
|
51
|
+
updateBodyStyles(undefined, entering);
|
|
52
|
+
contentElement.current = ref.current.querySelector("." + prefix('content'));
|
|
55
53
|
windowResizeListener.current = on(window, 'resize', updateBodyStyles);
|
|
56
54
|
contentElementResizeObserver.current = new ResizeObserver(function () {
|
|
57
55
|
return updateBodyStyles();
|
|
@@ -3,15 +3,15 @@ import { ItemDataType, WithAsProps, RsRefForwardingComponent } from '../@types/c
|
|
|
3
3
|
import { ValueType } from './MultiCascader';
|
|
4
4
|
export interface DropdownMenuProps extends WithAsProps {
|
|
5
5
|
disabledItemValues: ValueType;
|
|
6
|
-
value
|
|
6
|
+
value: ValueType;
|
|
7
7
|
childrenKey: string;
|
|
8
8
|
valueKey: string;
|
|
9
9
|
labelKey: string;
|
|
10
|
-
menuWidth
|
|
11
|
-
menuHeight
|
|
10
|
+
menuWidth?: number;
|
|
11
|
+
menuHeight?: number | string;
|
|
12
12
|
cascade?: boolean;
|
|
13
13
|
cascadeData: ItemDataType[][];
|
|
14
|
-
cascadePaths
|
|
14
|
+
cascadePaths?: ItemDataType[];
|
|
15
15
|
uncheckableItemValues: ValueType;
|
|
16
16
|
renderMenuItem?: (itemLabel: React.MouseEventHandler, item: ItemDataType) => React.ReactNode;
|
|
17
17
|
renderMenu?: (children: ItemDataType[], menu: React.ReactNode, parentNode?: ItemDataType, layer?: number) => React.ReactNode;
|
|
@@ -113,10 +113,10 @@ var MultiCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
113
113
|
selectedPaths = _useState2[0],
|
|
114
114
|
setSelectedPaths = _useState2[1];
|
|
115
115
|
|
|
116
|
-
var triggerRef = useRef();
|
|
117
|
-
var overlayRef = useRef();
|
|
118
|
-
var targetRef = useRef();
|
|
119
|
-
var searchInputRef = useRef();
|
|
116
|
+
var triggerRef = useRef(null);
|
|
117
|
+
var overlayRef = useRef(null);
|
|
118
|
+
var targetRef = useRef(null);
|
|
119
|
+
var searchInputRef = useRef(null);
|
|
120
120
|
usePublicMethods(ref, {
|
|
121
121
|
triggerRef: triggerRef,
|
|
122
122
|
overlayRef: overlayRef,
|
|
@@ -164,7 +164,7 @@ var MultiCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
164
164
|
*/
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
var hasValue = selectedItems.length > 0 || (valueProp === null || valueProp === void 0 ? void 0 : valueProp.length) > 0 && isFunction(renderValue);
|
|
167
|
+
var hasValue = selectedItems.length > 0 || Number(valueProp === null || valueProp === void 0 ? void 0 : valueProp.length) > 0 && isFunction(renderValue);
|
|
168
168
|
|
|
169
169
|
var _useClassNames = useClassNames(classPrefix),
|
|
170
170
|
prefix = _useClassNames.prefix,
|
|
@@ -446,7 +446,7 @@ var MultiCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
if (hasValue && isFunction(renderValue)) {
|
|
449
|
-
selectedElement = renderValue(value.length ? value : valueProp, selectedItems, selectedElement); // If renderValue returns null or undefined, hasValue is false.
|
|
449
|
+
selectedElement = renderValue(value.length ? value : valueProp !== null && valueProp !== void 0 ? valueProp : [], selectedItems, selectedElement); // If renderValue returns null or undefined, hasValue is false.
|
|
450
450
|
|
|
451
451
|
if (isNil(selectedElement)) {
|
|
452
452
|
hasValue = false;
|
|
@@ -5,50 +5,50 @@ export interface ItemType extends ItemDataType {
|
|
|
5
5
|
parent?: ItemType;
|
|
6
6
|
}
|
|
7
7
|
interface ItemKeys {
|
|
8
|
-
valueKey
|
|
9
|
-
labelKey
|
|
10
|
-
childrenKey
|
|
8
|
+
valueKey: string;
|
|
9
|
+
labelKey: string;
|
|
10
|
+
childrenKey: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Get all parents of a node
|
|
14
14
|
* @param node
|
|
15
15
|
*/
|
|
16
|
-
export declare const getParents: (node: ItemType) =>
|
|
16
|
+
export declare const getParents: (node: ItemType) => ItemType[];
|
|
17
17
|
/**
|
|
18
18
|
* Check if any child nodes are selected.
|
|
19
19
|
* @param node
|
|
20
20
|
* @param value
|
|
21
21
|
* @param itemKeys
|
|
22
22
|
*/
|
|
23
|
-
export declare const isSomeChildChecked: (node: ItemDataType, value: ValueType, itemKeys: ItemKeys) => any;
|
|
23
|
+
export declare const isSomeChildChecked: (node: ItemDataType, value: ValueType, itemKeys: Omit<ItemKeys, 'labelKey'>) => any;
|
|
24
24
|
/**
|
|
25
25
|
* Check if the parent is selected.
|
|
26
26
|
* @param node
|
|
27
27
|
* @param value
|
|
28
28
|
* @param itemKeys
|
|
29
29
|
*/
|
|
30
|
-
export declare const isSomeParentChecked: (node: ItemDataType, value: ValueType, itemKeys: ItemKeys) => any;
|
|
31
|
-
export declare const getOtherItemValuesByUnselectChild: (itemNode: ItemType, value: any, itemKeys: ItemKeys) =>
|
|
30
|
+
export declare const isSomeParentChecked: (node: ItemDataType, value: ValueType, itemKeys: Pick<ItemKeys, 'valueKey'>) => any;
|
|
31
|
+
export declare const getOtherItemValuesByUnselectChild: <T>(itemNode: ItemType, value: any, itemKeys: Omit<ItemKeys, 'labelKey'>) => T[];
|
|
32
32
|
/**
|
|
33
33
|
* Remove the values of all children.
|
|
34
34
|
*/
|
|
35
|
-
export declare const removeAllChildrenValue: (value:
|
|
35
|
+
export declare const removeAllChildrenValue: <T>(value: T[], item: ItemType, itemKeys: Omit<ItemKeys, 'labelKey'>) => T[] | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* A hook to flatten tree structure data
|
|
38
38
|
* @param data
|
|
39
39
|
*/
|
|
40
40
|
export declare function useFlattenData(data: ItemDataType[], itemKeys: ItemKeys): {
|
|
41
41
|
addFlattenData: (children: ItemDataType[], parent: ItemDataType) => void;
|
|
42
|
-
flattenData: ItemDataType[];
|
|
42
|
+
flattenData: ItemDataType<string | number>[];
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
45
|
* A hook for column data
|
|
46
46
|
* @param flattenData
|
|
47
47
|
*/
|
|
48
48
|
export declare function useColumnData(flattenData: ItemType[]): {
|
|
49
|
-
columnData: ItemDataType[][];
|
|
49
|
+
columnData: ItemDataType<string | number>[][];
|
|
50
50
|
addColumn: (column: ItemDataType[], index: number) => void;
|
|
51
|
-
setColumnData: import("react").Dispatch<import("react").SetStateAction<ItemDataType[][]>>;
|
|
51
|
+
setColumnData: import("react").Dispatch<import("react").SetStateAction<ItemDataType<string | number>[][]>>;
|
|
52
52
|
enforceUpdateColumnData: (nextData: ItemDataType[]) => void;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
@@ -56,12 +56,12 @@ export declare function useColumnData(flattenData: ItemType[]): {
|
|
|
56
56
|
* @param props
|
|
57
57
|
* @param flattenData
|
|
58
58
|
*/
|
|
59
|
-
export declare function useCascadeValue(props: Partial<MultiCascaderProps
|
|
60
|
-
value:
|
|
61
|
-
setValue: import("react").Dispatch<import("react").SetStateAction<
|
|
62
|
-
splitValue: (item: ItemType, checked: boolean, value:
|
|
63
|
-
value:
|
|
64
|
-
removedValue:
|
|
59
|
+
export declare function useCascadeValue<T>(props: Partial<MultiCascaderProps<T[]>> & ItemKeys, flattenData: ItemType[]): {
|
|
60
|
+
value: T[];
|
|
61
|
+
setValue: import("react").Dispatch<import("react").SetStateAction<T[]>>;
|
|
62
|
+
splitValue: (item: ItemType, checked: boolean, value: T[]) => {
|
|
63
|
+
value: T[];
|
|
64
|
+
removedValue: T[];
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
export {};
|
package/esm/Nav/Nav.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface NavProps<T = any> extends WithAsProps, Omit<React.HTMLAttribute
|
|
|
16
16
|
/** Active key, corresponding to eventkey in <Nav.item>. */
|
|
17
17
|
activeKey?: T;
|
|
18
18
|
/** Callback function triggered after selection */
|
|
19
|
-
onSelect?: (eventKey: T, event: React.SyntheticEvent) => void;
|
|
19
|
+
onSelect?: (eventKey: T | undefined, event: React.SyntheticEvent) => void;
|
|
20
20
|
}
|
|
21
21
|
interface NavComponent extends RsRefForwardingComponent<'div', NavProps> {
|
|
22
22
|
Dropdown: typeof Dropdown;
|
package/esm/Nav/Nav.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import React, { useContext } from 'react';
|
|
3
|
+
import React, { useContext, useMemo } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import NavItem from './NavItem';
|
|
6
6
|
import Dropdown from '../Dropdown';
|
|
@@ -55,13 +55,17 @@ var Nav = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
55
55
|
onSelectFromSidenav = _ref$onSelect === void 0 ? onSelectProp : _ref$onSelect;
|
|
56
56
|
|
|
57
57
|
var activeKey = activeKeyProp !== null && activeKeyProp !== void 0 ? activeKeyProp : activeKeyFromSidenav;
|
|
58
|
+
var contextValue = useMemo(function () {
|
|
59
|
+
return {
|
|
60
|
+
withinNav: true,
|
|
61
|
+
activeKey: activeKey,
|
|
62
|
+
onSelect: onSelectProp !== null && onSelectProp !== void 0 ? onSelectProp : onSelectFromSidenav
|
|
63
|
+
};
|
|
64
|
+
}, [activeKey, onSelectFromSidenav, onSelectProp]);
|
|
58
65
|
|
|
59
66
|
if (sidenav !== null && sidenav !== void 0 && sidenav.expanded) {
|
|
60
67
|
return /*#__PURE__*/React.createElement(NavContext.Provider, {
|
|
61
|
-
value:
|
|
62
|
-
activeKey: activeKey,
|
|
63
|
-
onSelect: onSelectProp !== null && onSelectProp !== void 0 ? onSelectProp : onSelectFromSidenav
|
|
64
|
-
}
|
|
68
|
+
value: contextValue
|
|
65
69
|
}, /*#__PURE__*/React.createElement("ul", _extends({
|
|
66
70
|
ref: ref,
|
|
67
71
|
className: classes
|
|
@@ -72,10 +76,7 @@ var Nav = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
72
76
|
|
|
73
77
|
if (sidenav) {
|
|
74
78
|
return /*#__PURE__*/React.createElement(NavContext.Provider, {
|
|
75
|
-
value:
|
|
76
|
-
activeKey: activeKey,
|
|
77
|
-
onSelect: onSelectProp !== null && onSelectProp !== void 0 ? onSelectProp : onSelectFromSidenav
|
|
78
|
-
}
|
|
79
|
+
value: contextValue
|
|
79
80
|
}, /*#__PURE__*/React.createElement(Menubar, {
|
|
80
81
|
vertical: !!sidenav
|
|
81
82
|
}, function (menubar, ref) {
|
|
@@ -88,10 +89,7 @@ var Nav = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
return /*#__PURE__*/React.createElement(NavContext.Provider, {
|
|
91
|
-
value:
|
|
92
|
-
activeKey: activeKey,
|
|
93
|
-
onSelect: onSelectProp !== null && onSelectProp !== void 0 ? onSelectProp : onSelectFromSidenav
|
|
94
|
-
}
|
|
92
|
+
value: contextValue
|
|
95
93
|
}, /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
96
94
|
ref: menubarRef,
|
|
97
95
|
className: classes
|
package/esm/Nav/NavContext.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface NavContextProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether component is rendered within a <Nav>
|
|
5
|
+
*
|
|
6
|
+
* FIXME: Bad design. Should use NavContextProps | null to determin whether within a <Nav>
|
|
7
|
+
*/
|
|
8
|
+
withinNav: boolean;
|
|
3
9
|
activeKey: string | null;
|
|
4
|
-
onSelect
|
|
10
|
+
onSelect?: (eventKey: string | undefined, event: React.SyntheticEvent) => void;
|
|
5
11
|
}
|
|
6
12
|
declare const NavContext: React.Context<NavContextProps>;
|
|
7
13
|
export default NavContext;
|
package/esm/Nav/NavContext.js
CHANGED
package/esm/Nav/NavItem.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface NavItemProps<T = string> extends WithAsProps, Omit<React.HTMLAt
|
|
|
17
17
|
/** Providing a `href` will render an `<a>` element */
|
|
18
18
|
href?: string;
|
|
19
19
|
/** Select the callback function that the event triggers. */
|
|
20
|
-
onSelect?: (eventKey: T, event: React.SyntheticEvent) => void;
|
|
20
|
+
onSelect?: (eventKey: T | undefined, event: React.SyntheticEvent) => void;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* The <Nav.Item> API
|
package/esm/Navbar/Navbar.js
CHANGED
|
@@ -5,7 +5,7 @@ import NavbarBody from './NavbarBody';
|
|
|
5
5
|
import NavbarHeader from './NavbarHeader';
|
|
6
6
|
import NavbarBrand from './NavbarBrand';
|
|
7
7
|
import { useClassNames } from '../utils';
|
|
8
|
-
export var NavbarContext = /*#__PURE__*/React.createContext(
|
|
8
|
+
export var NavbarContext = /*#__PURE__*/React.createContext(false);
|
|
9
9
|
var Navbar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
10
|
var className = props.className,
|
|
11
11
|
_props$as = props.as,
|
|
@@ -13,7 +13,7 @@ export interface NavItemProps<T = string> extends WithAsProps, Omit<React.HTMLAt
|
|
|
13
13
|
/** Providing a `href` will render an `<a>` element */
|
|
14
14
|
href?: string;
|
|
15
15
|
/** Select the callback function that the event triggers. */
|
|
16
|
-
onSelect?: (eventKey: T, event: React.SyntheticEvent) => void;
|
|
16
|
+
onSelect?: (eventKey: T | undefined, event: React.SyntheticEvent) => void;
|
|
17
17
|
}
|
|
18
18
|
declare const NavbarItem: RsRefForwardingComponent<'a', NavItemProps>;
|
|
19
19
|
export default NavbarItem;
|
package/esm/Navbar/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export type { NavbarProps } from './Navbar';
|
|
|
3
3
|
export type { NavbarBodyProps } from './NavbarBody';
|
|
4
4
|
export type { NavbarHeaderProps } from './NavbarHeader';
|
|
5
5
|
export type { NavbarBrandProps } from './NavbarBrand';
|
|
6
|
+
export { NavbarContext } from './Navbar';
|
|
6
7
|
export default Navbar;
|
package/esm/Navbar/index.js
CHANGED
package/esm/Overlay/Modal.d.ts
CHANGED
|
@@ -44,8 +44,8 @@ interface ModalProps extends BaseModalProps {
|
|
|
44
44
|
containerClassName?: string;
|
|
45
45
|
backdropTransitionTimeout?: number;
|
|
46
46
|
dialogTransitionTimeout?: number;
|
|
47
|
-
transition
|
|
48
|
-
|
|
47
|
+
transition?: React.ElementType;
|
|
48
|
+
onEsc?: React.KeyboardEventHandler;
|
|
49
49
|
onBackdropClick?: React.MouseEventHandler;
|
|
50
50
|
}
|
|
51
51
|
declare const Modal: RsRefForwardingComponent<'div', ModalProps>;
|