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
|
@@ -3,7 +3,7 @@ import { TypeAttributes } from '../@types/common';
|
|
|
3
3
|
interface Props {
|
|
4
4
|
ref?: React.Ref<any>;
|
|
5
5
|
message?: React.ReactNode;
|
|
6
|
-
children
|
|
6
|
+
children: React.ReactElement | ((props: any, ref: any) => React.ReactElement);
|
|
7
7
|
placement?: TypeAttributes.Placement;
|
|
8
8
|
}
|
|
9
9
|
export default function appendTooltip({ message, ref, ...rest }: Props): JSX.Element;
|
package/esm/utils/constants.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const SIZE: string[];
|
|
2
2
|
export declare const STATUS: string[];
|
|
3
3
|
export declare const COLOR: string[];
|
|
4
|
-
export declare const PLACEMENT_4:
|
|
5
|
-
export declare const PLACEMENT_8:
|
|
6
|
-
export declare const PLACEMENT_AUTO:
|
|
7
|
-
export declare const PLACEMENT:
|
|
4
|
+
export declare const PLACEMENT_4: readonly ["top", "bottom", "right", "left"];
|
|
5
|
+
export declare const PLACEMENT_8: readonly ["bottomStart", "bottomEnd", "topStart", "topEnd", "leftStart", "rightStart", "leftEnd", "rightEnd"];
|
|
6
|
+
export declare const PLACEMENT_AUTO: readonly ["auto", "autoVertical", "autoVerticalStart", "autoVerticalEnd", "autoHorizontal", "autoHorizontalStart", "autoHorizontalEnd"];
|
|
7
|
+
export declare const PLACEMENT: readonly ["top", "bottom", "right", "left", "bottomStart", "bottomEnd", "topStart", "topEnd", "leftStart", "rightStart", "leftEnd", "rightEnd", "auto", "autoVertical", "autoVerticalStart", "autoVerticalEnd", "autoHorizontal", "autoHorizontalStart", "autoHorizontalEnd"];
|
|
8
8
|
/**
|
|
9
9
|
* Check Tree Node State
|
|
10
10
|
*/
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
* @param {function} functions to chain
|
|
12
12
|
* @returns {function|undefined}
|
|
13
13
|
*/
|
|
14
|
-
declare function createChainedFunction<T = any>(...funcs: T[]): T;
|
|
14
|
+
declare function createChainedFunction<T = any>(...funcs: (T | null)[]): T;
|
|
15
15
|
export default createChainedFunction;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const KEY_GROUP: string | symbol;
|
|
2
2
|
export declare const KEY_GROUP_TITLE = "groupTitle";
|
|
3
|
-
export default function getDataGroupBy(data: any[], key: string, sort: any): any[];
|
|
3
|
+
export default function getDataGroupBy(data: any[] | undefined, key: string, sort: any): any[];
|
package/esm/utils/index.d.ts
CHANGED
|
@@ -40,3 +40,4 @@ export { default as useUpdatedRef } from './useUpdatedRef';
|
|
|
40
40
|
export { default as useWillUnmount } from './useWillUnmount';
|
|
41
41
|
export { default as useUpdateEffect } from './useUpdateEffect';
|
|
42
42
|
export { default as useIsMounted } from './useIsMounted';
|
|
43
|
+
export { default as useMount } from './useMount';
|
package/esm/utils/index.js
CHANGED
|
@@ -42,4 +42,5 @@ export { default as useEventCallback } from './useEventCallback';
|
|
|
42
42
|
export { default as useUpdatedRef } from './useUpdatedRef';
|
|
43
43
|
export { default as useWillUnmount } from './useWillUnmount';
|
|
44
44
|
export { default as useUpdateEffect } from './useUpdateEffect';
|
|
45
|
-
export { default as useIsMounted } from './useIsMounted';
|
|
45
|
+
export { default as useIsMounted } from './useIsMounted';
|
|
46
|
+
export { default as useMount } from './useMount';
|
package/esm/utils/mergeRefs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
declare type CallbackRef<T> = (ref: T | null) => void;
|
|
3
3
|
declare type Ref<T> = React.MutableRefObject<T> | CallbackRef<T>;
|
|
4
|
-
export default function mergeRefs<T>(refA?: Ref<T> | null, refB?: Ref<T
|
|
4
|
+
export default function mergeRefs<T>(refA?: Ref<T | null> | null, refB?: Ref<T | null> | null): React.RefCallback<T>;
|
|
5
5
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function isImage(file: any): boolean;
|
|
2
|
-
declare const _default: (file: File, callback: (result: string | ArrayBuffer) => void) => void;
|
|
2
|
+
declare const _default: (file: File, callback: (result: string | ArrayBuffer | null) => void) => void;
|
|
3
3
|
export default _default;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
|
|
1
|
+
import PropTypes, { Requireable, Validator } from 'prop-types';
|
|
2
|
+
declare type ExtractValue<T extends ReadonlyArray<Validator<any>>> = {
|
|
3
|
+
[K in keyof T]: T[K] extends Validator<infer V> ? V : never;
|
|
4
|
+
};
|
|
5
|
+
export declare function tupleType<T extends readonly Validator<any>[]>(...types: T): Requireable<ExtractValue<T>>;
|
|
3
6
|
export declare const refType: PropTypes.Requireable<any>;
|
|
7
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
var ANONYMOUS = '';
|
|
3
3
|
|
|
4
4
|
function createChainableTypeChecker(validate) {
|
|
5
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName
|
|
5
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
|
6
6
|
componentName = componentName || ANONYMOUS;
|
|
7
7
|
propFullName = propFullName || propName;
|
|
8
8
|
|
|
@@ -17,12 +17,13 @@ function createChainableTypeChecker(validate) {
|
|
|
17
17
|
|
|
18
18
|
return null;
|
|
19
19
|
} else {
|
|
20
|
-
return validate(props, propName, componentName, location, propFullName
|
|
20
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
var chainedCheckType = checkType.bind(null, false)
|
|
25
|
-
|
|
24
|
+
var chainedCheckType = Object.assign(checkType.bind(null, false), {
|
|
25
|
+
isRequired: checkType.bind(null, true)
|
|
26
|
+
});
|
|
26
27
|
return chainedCheckType;
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -31,7 +32,7 @@ export function tupleType() {
|
|
|
31
32
|
types[_key] = arguments[_key];
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
return createChainableTypeChecker(function (props, propName, componentName, location, propFullName
|
|
35
|
+
return createChainableTypeChecker(function (props, propName, componentName, location, propFullName) {
|
|
35
36
|
var value = props[propName];
|
|
36
37
|
|
|
37
38
|
if (!location) {
|
|
@@ -55,7 +56,7 @@ export function tupleType() {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
for (var i = 0; i < value.length; ++i) {
|
|
58
|
-
var error = types[i](value, i, componentName, 'element', propFullName + "[" + i + "]"
|
|
59
|
+
var error = types[i](value, String(i), componentName, 'element', propFullName + "[" + i + "]");
|
|
59
60
|
|
|
60
61
|
if (error) {
|
|
61
62
|
return error;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function reactToString(element: React.ReactElement): string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (value: any, labelKey?: string, valueKey?: string) => object;
|
|
1
|
+
declare const _default: (value: any, labelKey?: string | undefined, valueKey?: string | undefined) => object | null;
|
|
2
2
|
export default _default;
|
package/esm/utils/treeUtils.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare function getNodeParents(node: any, parentKey?: string, valueKey?:
|
|
|
30
30
|
* @param node
|
|
31
31
|
* @param valueKey
|
|
32
32
|
*/
|
|
33
|
-
export declare function getNodeParentKeys(nodes: TreeNodesType, node: TreeNodeType, valueKey: string):
|
|
33
|
+
export declare function getNodeParentKeys(nodes: TreeNodesType, node: TreeNodeType, valueKey: string): TreeNodeType[];
|
|
34
34
|
export declare function hasVisibleChildren(node: TreeNodeType, childrenKey: string): any;
|
|
35
35
|
/**
|
|
36
36
|
* shallow equal array
|
|
@@ -61,7 +61,7 @@ export declare function createUpdateTreeDataFunction(params: any, { valueKey, ch
|
|
|
61
61
|
childrenKey: any;
|
|
62
62
|
}): (tree: any[]) => any[];
|
|
63
63
|
export declare function findNodeOfTree(data: any, check: any): any;
|
|
64
|
-
export declare function filterNodesOfTree(data: any, check: any):
|
|
64
|
+
export declare function filterNodesOfTree(data: any, check: any): TreeNodeType[];
|
|
65
65
|
/**
|
|
66
66
|
* get all focusable items
|
|
67
67
|
* exclude not visible and disabled node
|
|
@@ -70,7 +70,7 @@ export declare function filterNodesOfTree(data: any, check: any): any[];
|
|
|
70
70
|
* @param isSearching - component is in Searching
|
|
71
71
|
* @returns
|
|
72
72
|
*/
|
|
73
|
-
export declare const getFocusableItems: (filteredData: ItemDataType[], props: PartialTreeProps, isSearching?: boolean) =>
|
|
73
|
+
export declare const getFocusableItems: (filteredData: ItemDataType[], props: PartialTreeProps, isSearching?: boolean | undefined) => TreeNodeType[];
|
|
74
74
|
/**
|
|
75
75
|
* return all focusable Item and active Element index
|
|
76
76
|
* @param focusItemValue
|
|
@@ -82,7 +82,7 @@ export declare const getActiveIndex: (focusItemValue: any, focusItems: any[], va
|
|
|
82
82
|
* @param flattenNodes - flattenData
|
|
83
83
|
*/
|
|
84
84
|
export declare const getActiveItem: (focusItemValue: string | number, flattenNodes: TreeNodesType, valueKey: string) => any;
|
|
85
|
-
export declare const getElementByDataKey: (dataKey: string, treeNodesRefs: any, selector: string) => Element;
|
|
85
|
+
export declare const getElementByDataKey: (dataKey: string, treeNodesRefs: any, selector: string) => Element | null;
|
|
86
86
|
/**
|
|
87
87
|
* focus to specify tree node
|
|
88
88
|
* @param refKey - target node refKey
|
|
@@ -91,7 +91,7 @@ export declare const getElementByDataKey: (dataKey: string, treeNodesRefs: any,
|
|
|
91
91
|
*/
|
|
92
92
|
export declare const focusTreeNode: (refKey: string, treeNodeRefs: any, selector: string) => void;
|
|
93
93
|
export interface FocusPrevOrNextProps {
|
|
94
|
-
focusItemValue: string | number;
|
|
94
|
+
focusItemValue: string | number | null;
|
|
95
95
|
focusableItems: any[];
|
|
96
96
|
treeNodesRefs: any;
|
|
97
97
|
selector: string;
|
|
@@ -111,7 +111,7 @@ export declare const focusPreviousItem: ({ focusItemValue, focusableItems, treeN
|
|
|
111
111
|
export interface ArrowHandlerProps {
|
|
112
112
|
focusItem: TreeNodeType;
|
|
113
113
|
expand: boolean;
|
|
114
|
-
childrenKey
|
|
114
|
+
childrenKey: string;
|
|
115
115
|
onExpand: (focusItem: TreeNodeType) => void;
|
|
116
116
|
onFocusItem: () => void;
|
|
117
117
|
}
|
|
@@ -137,20 +137,21 @@ export declare function rightArrowHandler({ focusItem, expand, childrenKey, onEx
|
|
|
137
137
|
* @param value - activeItem value
|
|
138
138
|
* @param valueKey
|
|
139
139
|
*/
|
|
140
|
-
export declare const getScrollToIndex: (nodes: TreeNodeType[], value: string | number, valueKey: string) => number;
|
|
140
|
+
export declare const getScrollToIndex: (nodes: readonly TreeNodeType[], value: string | number, valueKey: string) => number;
|
|
141
141
|
/**
|
|
142
142
|
* when searching, expand state always return true
|
|
143
143
|
* @param searchKeyword
|
|
144
144
|
* @param expand
|
|
145
145
|
*/
|
|
146
146
|
export declare function getExpandWhenSearching(searchKeyword: string, expand: boolean): boolean;
|
|
147
|
-
|
|
147
|
+
declare function getTreeActiveNode<T extends number | string | undefined>(nodes: TreeNodesType, value: T, valueKey: string): T extends undefined ? undefined : TreeNodeType | undefined;
|
|
148
|
+
export { getTreeActiveNode };
|
|
148
149
|
/**
|
|
149
150
|
* toggle tree node
|
|
150
151
|
* @param param0
|
|
151
152
|
*/
|
|
152
|
-
export declare function toggleExpand({ node, isExpand, expandItemValues, valueKey }: any):
|
|
153
|
-
export declare function getTreeNodeTitle(label: any): string;
|
|
153
|
+
export declare function toggleExpand({ node, isExpand, expandItemValues, valueKey }: any): ItemDataType<string | number>[];
|
|
154
|
+
export declare function getTreeNodeTitle(label: any): string | undefined;
|
|
154
155
|
/**
|
|
155
156
|
* get all children from flattenNodes object by given parent node
|
|
156
157
|
* @param nodes
|
|
@@ -158,14 +159,14 @@ export declare function getTreeNodeTitle(label: any): string;
|
|
|
158
159
|
*/
|
|
159
160
|
export declare function getChildrenByFlattenNodes(nodes: TreeNodesType, parent: TreeNodeType): TreeNodeType[];
|
|
160
161
|
export declare function useTreeDrag(): {
|
|
161
|
-
dragNode:
|
|
162
|
-
dragOverNodeKey:
|
|
163
|
-
dragNodeKeys:
|
|
164
|
-
dropNodePosition: TREE_NODE_DROP_POSITION;
|
|
165
|
-
setDragNode: (node: ItemDataType) => void;
|
|
166
|
-
setDragOverNodeKey: React.Dispatch<
|
|
167
|
-
setDragNodeKeys: React.Dispatch<React.SetStateAction<
|
|
168
|
-
setDropNodePosition: React.Dispatch<React.SetStateAction<TREE_NODE_DROP_POSITION>>;
|
|
162
|
+
dragNode: ItemDataType<string | number> | null;
|
|
163
|
+
dragOverNodeKey: null;
|
|
164
|
+
dragNodeKeys: (string | number)[];
|
|
165
|
+
dropNodePosition: TREE_NODE_DROP_POSITION | null;
|
|
166
|
+
setDragNode: (node: ItemDataType | null) => void;
|
|
167
|
+
setDragOverNodeKey: React.Dispatch<React.SetStateAction<null>>;
|
|
168
|
+
setDragNodeKeys: React.Dispatch<React.SetStateAction<(string | number)[]>>;
|
|
169
|
+
setDropNodePosition: React.Dispatch<React.SetStateAction<TREE_NODE_DROP_POSITION | null>>;
|
|
169
170
|
};
|
|
170
171
|
interface FlattenTreeDataProps {
|
|
171
172
|
data: TreeNodeType[];
|
|
@@ -189,44 +190,44 @@ interface UnSerializeListProps {
|
|
|
189
190
|
export declare function useFlattenTreeData({ data, labelKey, valueKey, childrenKey, uncheckableItemValues, callback }: FlattenTreeDataProps): {
|
|
190
191
|
forceUpdate: () => void;
|
|
191
192
|
flattenNodes: TreeNodesType;
|
|
192
|
-
flattenTreeData: (treeData: TreeNodeType[], ref: string, parent?: TreeNodeType, layer?: any) =>
|
|
193
|
-
serializeListOnlyParent: (nodes: TreeNodesType, key: string) =>
|
|
193
|
+
flattenTreeData: (treeData: TreeNodeType[], ref: string, parent?: TreeNodeType | undefined, layer?: any) => never[] | undefined;
|
|
194
|
+
serializeListOnlyParent: (nodes: TreeNodesType, key: string) => (string | number)[];
|
|
194
195
|
unSerializeList: ({ nodes, key, value, cascade, uncheckableItemValues }: UnSerializeListProps) => void;
|
|
195
196
|
formatVirtualizedTreeData: (nodes: TreeNodesType, data: any[], expandItemValues: ItemDataType[], options: {
|
|
196
197
|
cascade?: boolean;
|
|
197
198
|
searchKeyword?: string;
|
|
198
|
-
}) =>
|
|
199
|
+
}) => TreeNodeType[];
|
|
199
200
|
};
|
|
200
201
|
/**
|
|
201
202
|
* A hook that saving every tree node ref
|
|
202
203
|
*/
|
|
203
204
|
export declare function useTreeNodeRefs(): {
|
|
204
205
|
treeNodesRefs: {};
|
|
205
|
-
saveTreeNodeRef: (
|
|
206
|
+
saveTreeNodeRef: (ref: React.Ref<any>, refKey?: string | undefined) => void;
|
|
206
207
|
};
|
|
207
208
|
interface TreeSearchProps {
|
|
208
209
|
labelKey: string;
|
|
209
210
|
childrenKey: string;
|
|
210
|
-
searchKeyword
|
|
211
|
+
searchKeyword?: string;
|
|
211
212
|
data: ItemDataType[];
|
|
212
|
-
searchBy
|
|
213
|
+
searchBy?: (keyword: any, label: any, item: any) => boolean;
|
|
213
214
|
callback?: (keyword: string, data: ItemDataType[], event: React.SyntheticEvent) => void;
|
|
214
215
|
}
|
|
215
216
|
/**
|
|
216
217
|
* A hook that handles tree search filter options
|
|
217
218
|
* @param props
|
|
218
219
|
*/
|
|
219
|
-
export declare function useTreeSearch(props: TreeSearchProps): {
|
|
220
|
+
export declare function useTreeSearch<T extends HTMLElement = HTMLInputElement>(props: TreeSearchProps): {
|
|
220
221
|
searchKeywordState: string;
|
|
221
|
-
filteredData: ItemDataType[];
|
|
222
|
+
filteredData: ItemDataType<string | number>[];
|
|
222
223
|
setFilteredData: (data: ItemDataType[], searchKeyword: string) => void;
|
|
223
224
|
setSearchKeyword: React.Dispatch<React.SetStateAction<string>>;
|
|
224
|
-
handleSearch: (searchKeyword: string, event: React.
|
|
225
|
+
handleSearch: (searchKeyword: string, event: React.ChangeEvent<T>) => void;
|
|
225
226
|
};
|
|
226
227
|
export declare function useGetTreeNodeChildren(treeData: ItemDataType[], valueKey: string, childrenKey: string): {
|
|
227
|
-
data: ItemDataType[];
|
|
228
|
-
setData: React.Dispatch<React.SetStateAction<ItemDataType[]>>;
|
|
229
|
-
loadingNodeValues:
|
|
228
|
+
data: ItemDataType<string | number>[];
|
|
229
|
+
setData: React.Dispatch<React.SetStateAction<ItemDataType<string | number>[]>>;
|
|
230
|
+
loadingNodeValues: never[];
|
|
230
231
|
loadChildren: (node: any, getChildren: any) => void;
|
|
231
232
|
};
|
|
232
233
|
export interface FocusToTreeNodeProps {
|
|
@@ -236,7 +237,7 @@ export interface FocusToTreeNodeProps {
|
|
|
236
237
|
virtualized: boolean;
|
|
237
238
|
container: HTMLDivElement;
|
|
238
239
|
list: ListInstance;
|
|
239
|
-
formattedNodes:
|
|
240
|
+
formattedNodes: TreeNodeType[];
|
|
240
241
|
}
|
|
241
242
|
/**
|
|
242
243
|
* Focus to active tree node.
|
|
@@ -244,4 +245,6 @@ export interface FocusToTreeNodeProps {
|
|
|
244
245
|
*/
|
|
245
246
|
export declare function focusToActiveTreeNode({ list, valueKey, activeNode, virtualized, container, selector, formattedNodes }: FocusToTreeNodeProps): void;
|
|
246
247
|
export declare function isSearching(searchKeyword?: string): boolean;
|
|
247
|
-
export {
|
|
248
|
+
export declare function getTreeNodeIndent(rtl: any, layer: any, absolute?: boolean): {
|
|
249
|
+
[x: string]: number;
|
|
250
|
+
};
|
package/esm/utils/treeUtils.js
CHANGED
|
@@ -12,6 +12,7 @@ import { getNodeCheckState } from '../CheckTreePicker/utils';
|
|
|
12
12
|
import { TREE_NODE_DROP_POSITION, shallowEqual } from '../utils';
|
|
13
13
|
import { shouldDisplay } from '../Picker';
|
|
14
14
|
import reactToString from './reactToString';
|
|
15
|
+
import { TREE_NODE_PADDING, TREE_NODE_ROOT_PADDING } from './constants';
|
|
15
16
|
// gap of tree node
|
|
16
17
|
var TREE_NODE_GAP = 4;
|
|
17
18
|
/**
|
|
@@ -568,19 +569,20 @@ export var getScrollToIndex = function getScrollToIndex(nodes, value, valueKey)
|
|
|
568
569
|
export function getExpandWhenSearching(searchKeyword, expand) {
|
|
569
570
|
return isSearching(searchKeyword) ? true : expand;
|
|
570
571
|
}
|
|
571
|
-
export function getTreeActiveNode(nodes, value, valueKey) {
|
|
572
|
-
var activeNode = null;
|
|
573
572
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
activeNode = nodes[refKey];
|
|
578
|
-
}
|
|
579
|
-
});
|
|
573
|
+
function getTreeActiveNode(nodes, value, valueKey) {
|
|
574
|
+
if (_isUndefined(value)) {
|
|
575
|
+
return undefined;
|
|
580
576
|
}
|
|
581
577
|
|
|
582
|
-
|
|
578
|
+
for (var refKey in nodes) {
|
|
579
|
+
if (shallowEqual(nodes[refKey][valueKey], value)) {
|
|
580
|
+
return nodes[refKey];
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
583
|
}
|
|
584
|
+
|
|
585
|
+
export { getTreeActiveNode };
|
|
584
586
|
/**
|
|
585
587
|
* toggle tree node
|
|
586
588
|
* @param param0
|
|
@@ -617,7 +619,7 @@ export function getTreeNodeTitle(label) {
|
|
|
617
619
|
*/
|
|
618
620
|
|
|
619
621
|
export function getChildrenByFlattenNodes(nodes, parent) {
|
|
620
|
-
if (_isNil(nodes[parent.refKey])) {
|
|
622
|
+
if (!_isNil(parent.refKey) && _isNil(nodes[parent.refKey])) {
|
|
621
623
|
return [];
|
|
622
624
|
}
|
|
623
625
|
|
|
@@ -700,7 +702,7 @@ export function useFlattenTreeData(_ref8) {
|
|
|
700
702
|
node.refKey = refKey;
|
|
701
703
|
flattenNodes[refKey] = _extends((_extends2 = {
|
|
702
704
|
layer: layer
|
|
703
|
-
}, _extends2[labelKey] = node[labelKey], _extends2[valueKey] = node[valueKey], _extends2.
|
|
705
|
+
}, _extends2[labelKey] = node[labelKey], _extends2[valueKey] = node[valueKey], _extends2.uncheckable = uncheckableItemValues.some(function (value) {
|
|
704
706
|
return shallowEqual(node[valueKey], value);
|
|
705
707
|
}), _extends2), node);
|
|
706
708
|
|
|
@@ -717,10 +719,8 @@ export function useFlattenTreeData(_ref8) {
|
|
|
717
719
|
Object.keys(nodes).forEach(function (refKey) {
|
|
718
720
|
var currentNode = nodes[refKey];
|
|
719
721
|
|
|
720
|
-
if (currentNode.parent) {
|
|
721
|
-
var
|
|
722
|
-
|
|
723
|
-
var parentNode = nodes[(_currentNode$parent = currentNode.parent) === null || _currentNode$parent === void 0 ? void 0 : _currentNode$parent.refKey];
|
|
722
|
+
if (!_isNil(currentNode.parent) && !_isNil(currentNode.parent.refKey)) {
|
|
723
|
+
var parentNode = nodes[currentNode.parent.refKey];
|
|
724
724
|
|
|
725
725
|
if (currentNode[key]) {
|
|
726
726
|
if (!(parentNode !== null && parentNode !== void 0 && parentNode.checkAll)) {
|
|
@@ -752,7 +752,7 @@ export function useFlattenTreeData(_ref8) {
|
|
|
752
752
|
Object.keys(nodes).forEach(function (refKey) {
|
|
753
753
|
var node = nodes[refKey];
|
|
754
754
|
|
|
755
|
-
if (cascade && node.parent) {
|
|
755
|
+
if (cascade && !_isNil(node.parent) && !_isNil(node.parent.refKey)) {
|
|
756
756
|
node[key] = nodes[node.parent.refKey][key];
|
|
757
757
|
} else {
|
|
758
758
|
node[key] = false;
|
|
@@ -833,8 +833,8 @@ export function useFlattenTreeData(_ref8) {
|
|
|
833
833
|
export function useTreeNodeRefs() {
|
|
834
834
|
var treeNodeRefs = useRef({});
|
|
835
835
|
|
|
836
|
-
var saveTreeNodeRef = function saveTreeNodeRef(
|
|
837
|
-
if (refKey) {
|
|
836
|
+
var saveTreeNodeRef = function saveTreeNodeRef(ref, refKey) {
|
|
837
|
+
if (!_isNil(refKey)) {
|
|
838
838
|
treeNodeRefs.current[refKey] = ref;
|
|
839
839
|
}
|
|
840
840
|
};
|
|
@@ -876,11 +876,15 @@ export function useTreeSearch(props) {
|
|
|
876
876
|
return data;
|
|
877
877
|
}, [childrenKey, labelKey, searchBy]); // Use search keywords to filter options.
|
|
878
878
|
|
|
879
|
-
var _useState5 = useState(
|
|
879
|
+
var _useState5 = useState(function () {
|
|
880
|
+
return searchKeyword !== null && searchKeyword !== void 0 ? searchKeyword : '';
|
|
881
|
+
}),
|
|
880
882
|
searchKeywordState = _useState5[0],
|
|
881
883
|
setSearchKeyword = _useState5[1];
|
|
882
884
|
|
|
883
|
-
var _useState6 = useState(
|
|
885
|
+
var _useState6 = useState(function () {
|
|
886
|
+
return filterVisibleData(data, searchKeywordState);
|
|
887
|
+
}),
|
|
884
888
|
filteredData = _useState6[0],
|
|
885
889
|
setFilteredData = _useState6[1];
|
|
886
890
|
|
|
@@ -972,8 +976,10 @@ export function focusToActiveTreeNode(_ref10) {
|
|
|
972
976
|
if (!container) return;
|
|
973
977
|
|
|
974
978
|
if (virtualized && activeNode) {
|
|
979
|
+
var _list$scrollToRow;
|
|
980
|
+
|
|
975
981
|
var scrollIndex = getScrollToIndex(formattedNodes, activeNode === null || activeNode === void 0 ? void 0 : activeNode[valueKey], valueKey);
|
|
976
|
-
list.scrollToRow(scrollIndex);
|
|
982
|
+
(_list$scrollToRow = list.scrollToRow) === null || _list$scrollToRow === void 0 ? void 0 : _list$scrollToRow.call(list, scrollIndex);
|
|
977
983
|
return;
|
|
978
984
|
}
|
|
979
985
|
|
|
@@ -987,4 +993,22 @@ export function focusToActiveTreeNode(_ref10) {
|
|
|
987
993
|
}
|
|
988
994
|
export function isSearching(searchKeyword) {
|
|
989
995
|
return !_isEmpty(searchKeyword);
|
|
996
|
+
}
|
|
997
|
+
export function getTreeNodeIndent(rtl, layer, absolute) {
|
|
998
|
+
var _ref12;
|
|
999
|
+
|
|
1000
|
+
if (absolute === void 0) {
|
|
1001
|
+
absolute = false;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// layer start from 1
|
|
1005
|
+
var offset = layer * TREE_NODE_PADDING + TREE_NODE_ROOT_PADDING;
|
|
1006
|
+
|
|
1007
|
+
if (absolute) {
|
|
1008
|
+
var _ref11;
|
|
1009
|
+
|
|
1010
|
+
return _ref11 = {}, _ref11[rtl ? 'right' : 'left'] = offset, _ref11;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
return _ref12 = {}, _ref12[rtl ? 'paddingRight' : 'paddingLeft'] = offset, _ref12;
|
|
990
1014
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
declare type InferDefined<T> = T extends infer U | undefined ? U : never;
|
|
2
3
|
/**
|
|
3
4
|
* A hook for controlled value management.
|
|
4
5
|
* In the case of passing the controlled value, the controlled value is returned, otherwise the value in state is returned.
|
|
@@ -7,5 +8,9 @@
|
|
|
7
8
|
* @param defaultValue
|
|
8
9
|
* @param formatValue
|
|
9
10
|
*/
|
|
10
|
-
declare function useControlled<
|
|
11
|
+
declare function useControlled<V = any, D = V>(controlledValue: V, defaultValue: D): [
|
|
12
|
+
V extends undefined ? D : InferDefined<V>,
|
|
13
|
+
(value: React.SetStateAction<V | null>) => void,
|
|
14
|
+
boolean
|
|
15
|
+
];
|
|
11
16
|
export default useControlled;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { useRef, useState, useCallback } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A hook for controlled value management.
|
|
4
|
-
* In the case of passing the controlled value, the controlled value is returned, otherwise the value in state is returned.
|
|
5
|
-
* Generally used for a component including controlled and uncontrolled modes.
|
|
6
|
-
* @param controlledValue
|
|
7
|
-
* @param defaultValue
|
|
8
|
-
* @param formatValue
|
|
9
|
-
*/
|
|
10
2
|
|
|
11
3
|
function useControlled(controlledValue, defaultValue) {
|
|
12
4
|
var controlledRef = useRef(false);
|
package/esm/utils/useCustom.js
CHANGED
|
@@ -21,6 +21,8 @@ var getDefaultRTL = function getDefaultRTL() {
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
function useCustom(keys, overrideLocale) {
|
|
24
|
+
var _locale$Calendar2, _locale$Calendar4;
|
|
25
|
+
|
|
24
26
|
var _useContext = useContext(CustomContext),
|
|
25
27
|
_useContext$locale = _useContext.locale,
|
|
26
28
|
locale = _useContext$locale === void 0 ? defaultLocale : _useContext$locale,
|
|
@@ -44,14 +46,14 @@ function useCustom(keys, overrideLocale) {
|
|
|
44
46
|
return format(date, formatStr, {
|
|
45
47
|
locale: locale === null || locale === void 0 ? void 0 : (_locale$Calendar = locale.Calendar) === null || _locale$Calendar === void 0 ? void 0 : _locale$Calendar.dateLocale
|
|
46
48
|
});
|
|
47
|
-
}, [locale.Calendar.dateLocale]);
|
|
49
|
+
}, [(_locale$Calendar2 = locale.Calendar) === null || _locale$Calendar2 === void 0 ? void 0 : _locale$Calendar2.dateLocale]);
|
|
48
50
|
var defaultParseDate = useCallback(function (dateString, formatString) {
|
|
49
|
-
var _locale$
|
|
51
|
+
var _locale$Calendar3;
|
|
50
52
|
|
|
51
53
|
return parse(dateString, formatString, new Date(), {
|
|
52
|
-
locale: locale === null || locale === void 0 ? void 0 : (_locale$
|
|
54
|
+
locale: locale === null || locale === void 0 ? void 0 : (_locale$Calendar3 = locale.Calendar) === null || _locale$Calendar3 === void 0 ? void 0 : _locale$Calendar3.dateLocale
|
|
53
55
|
});
|
|
54
|
-
}, [locale.Calendar.dateLocale]);
|
|
56
|
+
}, [(_locale$Calendar4 = locale.Calendar) === null || _locale$Calendar4 === void 0 ? void 0 : _locale$Calendar4.dateLocale]);
|
|
55
57
|
return {
|
|
56
58
|
locale: componentLocale,
|
|
57
59
|
rtl: rtl,
|
package/esm/utils/useFocus.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export default function useFocus<E extends HTMLElement>(elementRef: React.
|
|
2
|
+
export default function useFocus<E extends HTMLElement>(elementRef: React.RefObject<E>): {
|
|
3
3
|
grab: () => void;
|
|
4
|
-
release: (options?: FocusOptions) => void;
|
|
4
|
+
release: (options?: FocusOptions | undefined) => void;
|
|
5
5
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
var useMount = function useMount(callback) {
|
|
4
|
+
var mountRef = useRef(callback);
|
|
5
|
+
mountRef.current = callback;
|
|
6
|
+
useEffect(function () {
|
|
7
|
+
var _mountRef$current;
|
|
8
|
+
|
|
9
|
+
(_mountRef$current = mountRef.current) === null || _mountRef$current === void 0 ? void 0 : _mountRef$current.call(mountRef);
|
|
10
|
+
}, []);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default useMount;
|
package/esm/utils/usePortal.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface PortalProps {
|
|
3
3
|
id?: string;
|
|
4
|
-
container?: HTMLElement | (() => HTMLElement);
|
|
4
|
+
container?: HTMLElement | (() => HTMLElement | null) | null;
|
|
5
5
|
}
|
|
6
6
|
declare function usePortal(props?: PortalProps): {
|
|
7
|
-
target:
|
|
7
|
+
target: HTMLElement | null;
|
|
8
8
|
Portal: React.FC<any>;
|
|
9
9
|
};
|
|
10
10
|
export default usePortal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
declare type TargetType = React.RefObject<Element> | Element | null | undefined;
|
|
3
3
|
interface Options {
|
|
4
4
|
disabled: boolean;
|
|
@@ -16,5 +16,5 @@ interface Options {
|
|
|
16
16
|
* @param param1
|
|
17
17
|
* @todo Allow different behaviors based on whether clicked element is focusable
|
|
18
18
|
*/
|
|
19
|
-
declare function useRootClose(onRootClose:
|
|
19
|
+
declare function useRootClose(onRootClose: React.ReactEventHandler | undefined, { disabled, triggerTarget, overlayTarget, listenEscape }: Options): void;
|
|
20
20
|
export default useRootClose;
|
|
@@ -8,5 +8,5 @@ export interface UseTimeoutFnReturn {
|
|
|
8
8
|
* @param ms Milliseconds of the timer
|
|
9
9
|
* @param open Whether to open the timer
|
|
10
10
|
*/
|
|
11
|
-
declare function useTimeout(fn: () => void, ms?: number, open?: boolean): UseTimeoutFnReturn;
|
|
11
|
+
declare function useTimeout(fn: (() => void) | undefined, ms?: number, open?: boolean): UseTimeoutFnReturn;
|
|
12
12
|
export default useTimeout;
|
package/esm/utils/useTimeout.js
CHANGED
|
@@ -20,9 +20,11 @@ function useTimeout(fn, ms, open) {
|
|
|
20
20
|
timeout.current && clearTimeout(timeout.current);
|
|
21
21
|
}, []);
|
|
22
22
|
var set = useCallback(function () {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
if (open) {
|
|
24
|
+
timeout.current = setTimeout(function () {
|
|
25
|
+
return fn === null || fn === void 0 ? void 0 : fn();
|
|
26
|
+
}, ms);
|
|
27
|
+
}
|
|
26
28
|
}, [ms, fn, open]);
|
|
27
29
|
useEffect(function () {
|
|
28
30
|
set();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsuite",
|
|
3
|
-
"version": "5.2
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"description": "A suite of react components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@rsuite/icons": "^1.0.2",
|
|
30
30
|
"@types/chai": "^4.2.18",
|
|
31
31
|
"@types/lodash": "^4.14.134",
|
|
32
|
-
"@types/prop-types": "^15.7.
|
|
32
|
+
"@types/prop-types": "^15.7.4",
|
|
33
33
|
"@types/react-virtualized": "^9.21.11",
|
|
34
34
|
"classnames": "^2.3.1",
|
|
35
35
|
"date-fns": "^2.13.0",
|
package/styles/index.less
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
@import '../Animation/styles/index';
|
|
5
5
|
@import '../AutoComplete/styles/index';
|
|
6
6
|
@import '../Avatar/styles/index';
|
|
7
|
+
@import '../AvatarGroup/styles/index';
|
|
7
8
|
@import '../Badge/styles/index';
|
|
8
9
|
@import '../Breadcrumb/styles/index';
|
|
9
10
|
@import '../Button/styles/index';
|
|
@@ -74,3 +75,4 @@
|
|
|
74
75
|
@import '../Rate/styles/index';
|
|
75
76
|
@import '../toaster/styles/index';
|
|
76
77
|
@import '../CloseButton/styles/index';
|
|
78
|
+
@import '../Stack/styles/index';
|