rsuite 5.2.3 → 5.4.1
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 +63 -0
- package/CheckTreePicker/styles/index.less +14 -1
- package/Dropdown/styles/index.less +4 -3
- package/Nav/styles/index.less +1 -0
- package/Navbar/styles/index.less +7 -0
- 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/Table/styles/index.less +0 -4
- 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 +5 -5
- 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 +2 -2
- 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 +34 -27
- 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 +9 -7
- package/cjs/DateRangePicker/Calendar.js +27 -6
- package/cjs/DateRangePicker/DateRangePicker.d.ts +8 -6
- package/cjs/DateRangePicker/DateRangePicker.js +133 -110
- 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.js +6 -4
- package/cjs/Disclosure/DisclosureButton.js +9 -7
- package/cjs/Disclosure/DisclosureContent.js +4 -6
- package/cjs/Disclosure/DisclosureContext.d.ts +2 -2
- 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/DropdownContext.d.ts +2 -2
- package/cjs/Dropdown/DropdownItem.js +1 -1
- package/cjs/Dropdown/DropdownMenu.d.ts +3 -3
- package/cjs/Dropdown/DropdownMenu.js +9 -6
- 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 +12 -6
- 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/Overlay/Modal.d.ts +2 -2
- package/cjs/Overlay/Modal.js +70 -45
- 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/VirtualizedList.d.ts +29 -2
- package/cjs/Picker/propTypes.d.ts +5 -7
- package/cjs/Picker/propTypes.js +4 -3
- package/cjs/Picker/utils.d.ts +15 -23
- package/cjs/Picker/utils.js +71 -46
- 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 +37 -54
- 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/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/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 +63 -193
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +63 -193
- package/dist/rsuite.js +194 -117
- 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 +5 -5
- 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 +2 -2
- 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 +33 -25
- 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 +9 -7
- package/esm/DateRangePicker/Calendar.js +28 -6
- package/esm/DateRangePicker/DateRangePicker.d.ts +8 -6
- package/esm/DateRangePicker/DateRangePicker.js +131 -110
- 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.js +6 -4
- package/esm/Disclosure/DisclosureButton.js +8 -7
- package/esm/Disclosure/DisclosureContent.js +5 -7
- package/esm/Disclosure/DisclosureContext.d.ts +2 -2
- 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/DropdownContext.d.ts +2 -2
- package/esm/Dropdown/DropdownItem.js +1 -1
- package/esm/Dropdown/DropdownMenu.d.ts +3 -3
- package/esm/Dropdown/DropdownMenu.js +10 -7
- 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 +12 -6
- 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/Overlay/Modal.d.ts +2 -2
- package/esm/Overlay/Modal.js +71 -46
- 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/VirtualizedList.d.ts +29 -2
- package/esm/Picker/propTypes.d.ts +5 -7
- package/esm/Picker/propTypes.js +4 -3
- package/esm/Picker/utils.d.ts +15 -23
- package/esm/Picker/utils.js +70 -46
- 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 +36 -52
- 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/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/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 +3 -3
- package/styles/index.less +2 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default function createTextMaskInputElement(config: any): {
|
|
2
2
|
state: {
|
|
3
|
-
previousConformedValue:
|
|
4
|
-
previousPlaceholder:
|
|
3
|
+
previousConformedValue: undefined;
|
|
4
|
+
previousPlaceholder: undefined;
|
|
5
5
|
};
|
|
6
6
|
update(rawValue: any, { inputElement, mask: providedMask, guide, pipe, placeholderChar, keepCharPositions, showMask }?: any): void;
|
|
7
7
|
};
|
|
@@ -3,5 +3,5 @@ export declare const defaultPlaceholderChar = "_";
|
|
|
3
3
|
export declare function convertMaskToPlaceholder(mask?: MaskType | MaskFunctionType, placeholderChar?: string): string;
|
|
4
4
|
export declare function processCaretTraps(mask: any): {
|
|
5
5
|
maskWithoutCaretTraps: any;
|
|
6
|
-
indexes:
|
|
6
|
+
indexes: number[];
|
|
7
7
|
};
|
package/esm/Menu/Menu.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import React, { useCallback, useContext, useRef, useMemo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
4
5
|
import MenuContext, { MenuActionTypes, MoveFocusTo } from './MenuContext';
|
|
5
6
|
import { KEY_VALUES, useCustom } from '../utils';
|
|
6
7
|
import useUniqueId from '../utils/useUniqueId';
|
|
@@ -25,8 +26,8 @@ function Menu(props) {
|
|
|
25
26
|
renderMenuButton = props.renderMenuButton,
|
|
26
27
|
renderMenuPopup = props.renderMenuPopup,
|
|
27
28
|
onToggleMenu = props.onToggleMenu;
|
|
28
|
-
var buttonElementRef = useRef();
|
|
29
|
-
var menuElementRef = useRef();
|
|
29
|
+
var buttonElementRef = useRef(null);
|
|
30
|
+
var menuElementRef = useRef(null);
|
|
30
31
|
var parentMenu = useContext(MenuContext);
|
|
31
32
|
var isSubmenu = !!parentMenu;
|
|
32
33
|
var menu = useMenu();
|
|
@@ -39,7 +40,7 @@ function Menu(props) {
|
|
|
39
40
|
var _useCustom = useCustom('Menu'),
|
|
40
41
|
rtl = _useCustom.rtl;
|
|
41
42
|
|
|
42
|
-
var activeItem = (_items$activeItemInde = items[activeItemIndex]) === null || _items$activeItemInde === void 0 ? void 0 : _items$activeItemInde.element;
|
|
43
|
+
var activeItem = isNil(activeItemIndex) ? null : (_items$activeItemInde = items[activeItemIndex]) === null || _items$activeItemInde === void 0 ? void 0 : _items$activeItemInde.element;
|
|
43
44
|
|
|
44
45
|
var _useFocus = useFocus(menuElementRef),
|
|
45
46
|
grabFocus = _useFocus.grab;
|
|
@@ -74,7 +75,9 @@ function Menu(props) {
|
|
|
74
75
|
onToggleMenu === null || onToggleMenu === void 0 ? void 0 : onToggleMenu(false, event);
|
|
75
76
|
|
|
76
77
|
if (returnFocusToButton) {
|
|
77
|
-
|
|
78
|
+
var _buttonElementRef$cur;
|
|
79
|
+
|
|
80
|
+
(_buttonElementRef$cur = buttonElementRef.current) === null || _buttonElementRef$cur === void 0 ? void 0 : _buttonElementRef$cur.focus({
|
|
78
81
|
preventScroll: true
|
|
79
82
|
});
|
|
80
83
|
}
|
|
@@ -89,7 +92,9 @@ function Menu(props) {
|
|
|
89
92
|
useClickOutside({
|
|
90
93
|
enabled: open,
|
|
91
94
|
isOutside: function isOutside(event) {
|
|
92
|
-
|
|
95
|
+
var _buttonElementRef$cur2, _menuElementRef$curre;
|
|
96
|
+
|
|
97
|
+
return !((_buttonElementRef$cur2 = buttonElementRef.current) !== null && _buttonElementRef$cur2 !== void 0 && _buttonElementRef$cur2.contains(event.target)) && !((_menuElementRef$curre = menuElementRef.current) !== null && _menuElementRef$curre !== void 0 && _menuElementRef$curre.contains(event.target));
|
|
93
98
|
},
|
|
94
99
|
// fixme if clicking on a focusable element, don't move focus to menu button
|
|
95
100
|
handle: function handle(event) {
|
|
@@ -330,7 +335,8 @@ function Menu(props) {
|
|
|
330
335
|
|
|
331
336
|
var customMenuPopup = renderMenuPopup === null || renderMenuPopup === void 0 ? void 0 : renderMenuPopup(_extends({}, menuProps, {
|
|
332
337
|
open: open
|
|
333
|
-
}), menuElementRef);
|
|
338
|
+
}), menuElementRef); // fixme Wrong children here
|
|
339
|
+
|
|
334
340
|
var menuElement = customMenuPopup !== null && customMenuPopup !== void 0 ? customMenuPopup : /*#__PURE__*/React.createElement("ul", _extends({
|
|
335
341
|
ref: menuElementRef
|
|
336
342
|
}, menuProps, {
|
|
@@ -346,7 +352,7 @@ function Menu(props) {
|
|
|
346
352
|
closeMenu(e);
|
|
347
353
|
}
|
|
348
354
|
}, [disabled, closeMenu]);
|
|
349
|
-
var rootElementRef = useRef();
|
|
355
|
+
var rootElementRef = useRef(null);
|
|
350
356
|
var handleContainerBlur = useCallback(function (event) {
|
|
351
357
|
if (isFocusLeaving(event)) {
|
|
352
358
|
closeMenu(event, false);
|
package/esm/Menu/MenuItem.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface MenuItemProps {
|
|
|
8
8
|
/** Render prop */
|
|
9
9
|
children: (menuitem: React.LiHTMLAttributes<HTMLLIElement> & MenuitemRenderProps, ref: React.Ref<HTMLLIElement>) => React.ReactElement;
|
|
10
10
|
/** Callback when menuitem is being activated */
|
|
11
|
-
onActivate?:
|
|
11
|
+
onActivate?: React.MouseEventHandler;
|
|
12
12
|
}
|
|
13
13
|
export interface MenuitemRenderProps {
|
|
14
14
|
selected: boolean;
|
package/esm/Menu/MenuItem.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import isNil from 'lodash/isNil';
|
|
3
4
|
import useUniqueId from '../utils/useUniqueId';
|
|
4
5
|
import MenuContext, { MenuActionTypes, MoveFocusTo } from './MenuContext';
|
|
5
6
|
|
|
@@ -7,22 +8,24 @@ import MenuContext, { MenuActionTypes, MoveFocusTo } from './MenuContext';
|
|
|
7
8
|
* Headless ARIA `menuitem`
|
|
8
9
|
*/
|
|
9
10
|
function MenuItem(props) {
|
|
10
|
-
var _menuState$items$menu;
|
|
11
|
-
|
|
12
11
|
var children = props.children,
|
|
13
|
-
selected = props.selected,
|
|
14
|
-
|
|
12
|
+
_props$selected = props.selected,
|
|
13
|
+
selected = _props$selected === void 0 ? false : _props$selected,
|
|
14
|
+
_props$disabled = props.disabled,
|
|
15
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
15
16
|
onActivate = props.onActivate;
|
|
16
|
-
var menuitemRef = useRef();
|
|
17
|
+
var menuitemRef = useRef(null);
|
|
17
18
|
var menuitemId = useUniqueId('menuitem-');
|
|
18
|
-
var menu = useContext(MenuContext);
|
|
19
|
+
var menu = useContext(MenuContext);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if (!menu) {
|
|
22
|
+
throw new Error('<MenuItem> must be rendered within a <Menu>');
|
|
23
|
+
}
|
|
23
24
|
|
|
25
|
+
var menuState = menu[0],
|
|
26
|
+
dispatch = menu[1]; // Whether this menuitem has focus (indicated by `aria-activedescendant` from parent menu)
|
|
24
27
|
|
|
25
|
-
var hasFocus = (
|
|
28
|
+
var hasFocus = !isNil(menuitemRef.current) && !isNil(menuState.activeItemIndex) && menuState.items[menuState.activeItemIndex].element === menuitemRef.current;
|
|
26
29
|
var handleClick = useCallback(function (event) {
|
|
27
30
|
if (disabled) {
|
|
28
31
|
return;
|
|
@@ -32,17 +35,17 @@ function MenuItem(props) {
|
|
|
32
35
|
}, [disabled, onActivate]); // Gain/release focus on mousedown in `menubar`
|
|
33
36
|
|
|
34
37
|
var handleMouseDown = useCallback(function () {
|
|
35
|
-
if (!hasFocus) {
|
|
38
|
+
if (!isNil(menuitemRef.current) && !hasFocus) {
|
|
36
39
|
dispatch({
|
|
37
40
|
type: MenuActionTypes.MoveFocus,
|
|
38
41
|
to: MoveFocusTo.Specific,
|
|
39
42
|
id: menuitemRef.current.id
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
|
-
}, [
|
|
45
|
+
}, [dispatch, hasFocus]); // Gain/release focus on mouseenter/mouseleave in `menu`
|
|
43
46
|
|
|
44
47
|
var handleMouseMove = useCallback(function () {
|
|
45
|
-
if (!hasFocus) {
|
|
48
|
+
if (!isNil(menuitemRef.current) && !hasFocus) {
|
|
46
49
|
dispatch({
|
|
47
50
|
type: MenuActionTypes.MoveFocus,
|
|
48
51
|
to: MoveFocusTo.Specific,
|
|
@@ -58,7 +61,7 @@ function MenuItem(props) {
|
|
|
58
61
|
}, [dispatch]);
|
|
59
62
|
useEffect(function () {
|
|
60
63
|
var menuitemElement = menuitemRef.current;
|
|
61
|
-
dispatch
|
|
64
|
+
dispatch({
|
|
62
65
|
type: MenuActionTypes.RegisterItem,
|
|
63
66
|
element: menuitemElement,
|
|
64
67
|
props: {
|
|
@@ -66,7 +69,7 @@ function MenuItem(props) {
|
|
|
66
69
|
}
|
|
67
70
|
});
|
|
68
71
|
return function () {
|
|
69
|
-
dispatch
|
|
72
|
+
dispatch({
|
|
70
73
|
type: MenuActionTypes.UnregisterItem,
|
|
71
74
|
id: menuitemElement.id
|
|
72
75
|
});
|
package/esm/Menu/Menubar.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// Headless ARIA `menubar`
|
|
2
2
|
import React, { useCallback, useRef } from 'react';
|
|
3
|
+
import isNil from 'lodash/isNil';
|
|
3
4
|
import MenuContext, { MenuActionTypes, MoveFocusTo } from './MenuContext';
|
|
4
5
|
import { KEY_VALUES, useCustom } from '../utils';
|
|
5
6
|
import { isFocusEntering, isFocusLeaving } from '../utils/events';
|
|
6
7
|
import useMenu from './useMenu';
|
|
7
8
|
export default function Menubar(_ref) {
|
|
8
|
-
var _items$activeItemInde;
|
|
9
|
-
|
|
10
9
|
var _ref$vertical = _ref.vertical,
|
|
11
10
|
vertical = _ref$vertical === void 0 ? false : _ref$vertical,
|
|
12
11
|
children = _ref.children,
|
|
@@ -18,7 +17,7 @@ export default function Menubar(_ref) {
|
|
|
18
17
|
items = _menubar$.items,
|
|
19
18
|
activeItemIndex = _menubar$.activeItemIndex,
|
|
20
19
|
dispatch = menubar[1];
|
|
21
|
-
var menubarElementRef = useRef();
|
|
20
|
+
var menubarElementRef = useRef(null);
|
|
22
21
|
var onFocus = useCallback(function (event) {
|
|
23
22
|
// Focus moves inside Menubar
|
|
24
23
|
if (isFocusEntering(event)) {
|
|
@@ -44,7 +43,7 @@ export default function Menubar(_ref) {
|
|
|
44
43
|
rtl = _useCustom.rtl;
|
|
45
44
|
|
|
46
45
|
var onKeyDown = useCallback(function (event) {
|
|
47
|
-
var
|
|
46
|
+
var activeItemElement = isNil(activeItemIndex) ? null : items[activeItemIndex].element;
|
|
48
47
|
|
|
49
48
|
switch (true) {
|
|
50
49
|
case !vertical && !rtl && event.key === KEY_VALUES.RIGHT:
|
|
@@ -90,10 +89,10 @@ export default function Menubar(_ref) {
|
|
|
90
89
|
case !vertical && event.key === KEY_VALUES.DOWN:
|
|
91
90
|
case vertical && !rtl && event.key === KEY_VALUES.RIGHT:
|
|
92
91
|
case vertical && rtl && event.key === KEY_VALUES.LEFT:
|
|
93
|
-
if ((
|
|
92
|
+
if ((activeItemElement === null || activeItemElement === void 0 ? void 0 : activeItemElement.getAttribute('aria-haspopup')) === 'menu') {
|
|
94
93
|
event.preventDefault();
|
|
95
94
|
event.stopPropagation();
|
|
96
|
-
|
|
95
|
+
activeItemElement.click();
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
break;
|
|
@@ -102,7 +101,7 @@ export default function Menubar(_ref) {
|
|
|
102
101
|
case event.key === KEY_VALUES.SPACE:
|
|
103
102
|
event.preventDefault();
|
|
104
103
|
event.stopPropagation();
|
|
105
|
-
|
|
104
|
+
activeItemElement === null || activeItemElement === void 0 ? void 0 : activeItemElement.click();
|
|
106
105
|
break;
|
|
107
106
|
}
|
|
108
107
|
}, [rtl, items, activeItemIndex, dispatch, vertical]); // Only used for handling click events bubbling from children
|
|
@@ -124,7 +123,7 @@ export default function Menubar(_ref) {
|
|
|
124
123
|
onBlur: onBlur,
|
|
125
124
|
onKeyDown: onKeyDown,
|
|
126
125
|
onClick: onClick,
|
|
127
|
-
'aria-activedescendant': (
|
|
126
|
+
'aria-activedescendant': isNil(activeItemIndex) ? undefined : items[activeItemIndex].element.id,
|
|
128
127
|
'aria-orientation': vertical ? 'vertical' : undefined // implicitly set 'horizontal'
|
|
129
128
|
|
|
130
129
|
}, menubarElementRef));
|
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
|
@@ -8,7 +8,7 @@ import React, { useRef, useMemo, useState, useEffect, 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
14
|
import { useClassNames, mergeRefs, SIZE } from '../utils';
|
|
@@ -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,
|
|
@@ -66,7 +67,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
66
67
|
var classes = merge(className, prefix(size, {
|
|
67
68
|
full: full
|
|
68
69
|
}));
|
|
69
|
-
var dialogRef = useRef();
|
|
70
|
+
var dialogRef = useRef(null);
|
|
70
71
|
var transitionEndListener = useRef(); // The style of the Modal body will be updated with the size of the window or container.
|
|
71
72
|
|
|
72
73
|
var _useBodyStyles = useBodyStyles(dialogRef, {
|
|
@@ -98,9 +99,13 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
98
99
|
// When the value of `backdrop` is `static`, a jitter animation will be added to the dialog when clicked.
|
|
99
100
|
if (backdrop === 'static') {
|
|
100
101
|
setShake(true);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
|
|
103
|
+
if (!transitionEndListener.current && dialogRef.current) {
|
|
104
|
+
//fix: https://github.com/rsuite/rsuite/blob/a93d13c14fb20cc58204babe3331d3c3da3fe1fd/src/Modal/styles/index.less#L59
|
|
105
|
+
transitionEndListener.current = on(dialogRef.current, getAnimationEnd(), function () {
|
|
106
|
+
setShake(false);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
104
109
|
}
|
|
105
110
|
}, [backdrop]);
|
|
106
111
|
var handleExited = useCallback(function (node) {
|
|
@@ -109,6 +114,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
109
114
|
onExited === null || onExited === void 0 ? void 0 : onExited(node);
|
|
110
115
|
onDestroyEvents();
|
|
111
116
|
(_transitionEndListene = transitionEndListener.current) === null || _transitionEndListene === void 0 ? void 0 : _transitionEndListene.off();
|
|
117
|
+
transitionEndListener.current = null;
|
|
112
118
|
}, [onDestroyEvents, onExited]);
|
|
113
119
|
var handleEntered = useCallback(function (node) {
|
|
114
120
|
onEntered === null || onEntered === void 0 ? void 0 : onEntered(node);
|
|
@@ -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,
|