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
|
@@ -13,7 +13,7 @@ var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
|
|
13
13
|
|
|
14
14
|
var _ownerDocument = _interopRequireDefault(require("dom-lib/ownerDocument"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _getOffset = _interopRequireDefault(require("dom-lib/getOffset"));
|
|
17
17
|
|
|
18
18
|
var _scrollTop = _interopRequireDefault(require("dom-lib/scrollTop"));
|
|
19
19
|
|
|
@@ -45,10 +45,10 @@ function getContainerDimensions(containerNode) {
|
|
|
45
45
|
scrollY = (0, _scrollTop.default)((0, _ownerDocument.default)(containerNode).documentElement) || (0, _scrollTop.default)(containerNode);
|
|
46
46
|
scrollX = (0, _scrollLeft.default)((0, _ownerDocument.default)(containerNode).documentElement) || (0, _scrollLeft.default)(containerNode);
|
|
47
47
|
} else {
|
|
48
|
-
var
|
|
48
|
+
var _ref = (0, _getOffset.default)(containerNode);
|
|
49
49
|
|
|
50
|
-
width =
|
|
51
|
-
height =
|
|
50
|
+
width = _ref.width;
|
|
51
|
+
height = _ref.height;
|
|
52
52
|
scrollY = (0, _scrollTop.default)(containerNode);
|
|
53
53
|
scrollX = (0, _scrollLeft.default)(containerNode);
|
|
54
54
|
}
|
|
@@ -143,7 +143,7 @@ var _default = function _default(props) {
|
|
|
143
143
|
|
|
144
144
|
return {
|
|
145
145
|
getPosition: function getPosition(target, container) {
|
|
146
|
-
var offset = container.tagName === 'BODY' ? (0,
|
|
146
|
+
var offset = container.tagName === 'BODY' ? (0, _getOffset.default)(target) : (0, _getPosition2.default)(target, container, false);
|
|
147
147
|
return offset;
|
|
148
148
|
},
|
|
149
149
|
calcAutoPlacement: function calcAutoPlacement(targetOffset, container, overlay) {
|
|
@@ -213,9 +213,9 @@ var _default = function _default(props) {
|
|
|
213
213
|
calcOverlayPosition: function calcOverlayPosition(overlayNode, target, container) {
|
|
214
214
|
var childOffset = this.getPosition(target, container);
|
|
215
215
|
|
|
216
|
-
var
|
|
217
|
-
overlayHeight =
|
|
218
|
-
overlayWidth =
|
|
216
|
+
var _ref2 = (0, _getOffset.default)(overlayNode),
|
|
217
|
+
overlayHeight = _ref2.height,
|
|
218
|
+
overlayWidth = _ref2.width;
|
|
219
219
|
|
|
220
220
|
var top = childOffset.top,
|
|
221
221
|
left = childOffset.left;
|
|
@@ -31,7 +31,7 @@ export interface PaginationProps extends WithAsProps {
|
|
|
31
31
|
/** A pagination can have different sizes */
|
|
32
32
|
size?: TypeAttributes.Size;
|
|
33
33
|
/** callback function for pagination clicked */
|
|
34
|
-
onSelect?: (eventKey: number, event: React.MouseEvent) => void;
|
|
34
|
+
onSelect?: (eventKey: string | number, event: React.MouseEvent) => void;
|
|
35
35
|
}
|
|
36
36
|
declare const Pagination: RsRefForwardingComponent<'div', PaginationProps>;
|
|
37
37
|
export default Pagination;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
|
|
3
|
-
export interface PaginationButtonProps extends WithAsProps, Omit<React.
|
|
3
|
+
export interface PaginationButtonProps<T = number | string> extends WithAsProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onSelect'> {
|
|
4
4
|
/** The value of the current option */
|
|
5
|
-
eventKey
|
|
5
|
+
eventKey: T;
|
|
6
6
|
/** Called when the button is clicked. */
|
|
7
7
|
onClick?: React.MouseEventHandler;
|
|
8
8
|
/** A button can show it is currently unable to be interacted with */
|
|
@@ -12,7 +12,7 @@ export interface PaginationButtonProps extends WithAsProps, Omit<React.HTMLAttri
|
|
|
12
12
|
/** Primary content */
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
/** Select the callback function for the current option */
|
|
15
|
-
onSelect?: (eventKey:
|
|
15
|
+
onSelect?: (eventKey: T, event: React.MouseEvent) => void;
|
|
16
16
|
}
|
|
17
17
|
declare const PaginationButton: RsRefForwardingComponent<'button', PaginationButtonProps>;
|
|
18
18
|
export default PaginationButton;
|
|
@@ -35,7 +35,7 @@ var LimitPicker = function LimitPicker(props) {
|
|
|
35
35
|
onChangeLimit = props.onChangeLimit,
|
|
36
36
|
size = props.size,
|
|
37
37
|
prefix = props.prefix;
|
|
38
|
-
var disabledPicker = typeof disabled === 'function' ? disabled('picker') : disabled;
|
|
38
|
+
var disabledPicker = typeof disabled === 'function' ? disabled('picker') : Boolean(disabled);
|
|
39
39
|
var formatlimitOptions = limitOptions.map(function (item) {
|
|
40
40
|
return {
|
|
41
41
|
value: item,
|
|
@@ -51,7 +51,8 @@ var LimitPicker = function LimitPicker(props) {
|
|
|
51
51
|
placement: "topStart",
|
|
52
52
|
data: formatlimitOptions,
|
|
53
53
|
value: limit,
|
|
54
|
-
onChange: onChangeLimit
|
|
54
|
+
onChange: onChangeLimit // fixme don't use any
|
|
55
|
+
,
|
|
55
56
|
menuStyle: {
|
|
56
57
|
minWidth: 'auto'
|
|
57
58
|
},
|
|
@@ -153,7 +154,8 @@ var PaginationGroup = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
153
154
|
maxButtons: maxButtons,
|
|
154
155
|
pages: pages,
|
|
155
156
|
disabled: disabled,
|
|
156
|
-
onSelect: onChangePage
|
|
157
|
+
onSelect: onChangePage // fixme don't use any
|
|
158
|
+
,
|
|
157
159
|
activePage: activePage
|
|
158
160
|
}, rest));
|
|
159
161
|
} else if (key === 'total') {
|
package/cjs/Panel/Panel.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface PanelProps<T = string | number> extends WithAsProps, AnimationE
|
|
|
24
24
|
/** Role of Panel */
|
|
25
25
|
panelRole?: string;
|
|
26
26
|
/** callback function for the panel clicked */
|
|
27
|
-
onSelect?: (eventKey: T, event: React.SyntheticEvent) => void;
|
|
27
|
+
onSelect?: (eventKey: T | undefined, event: React.SyntheticEvent) => void;
|
|
28
28
|
}
|
|
29
29
|
declare const Panel: RsRefForwardingComponent<'div', PanelProps>;
|
|
30
30
|
export default Panel;
|
package/cjs/Panel/Panel.js
CHANGED
|
@@ -127,7 +127,7 @@ var Panel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
127
127
|
className: prefix('title'),
|
|
128
128
|
role: "presentation"
|
|
129
129
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
130
|
-
className: expanded ?
|
|
130
|
+
className: expanded ? undefined : 'collapsed'
|
|
131
131
|
}, header))) : header;
|
|
132
132
|
} else {
|
|
133
133
|
var _className = merge(prefix('title'), (0, _get.default)(header, 'props.className'));
|
|
@@ -139,7 +139,7 @@ var Panel = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
139
139
|
|
|
140
140
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
141
141
|
role: headerRole,
|
|
142
|
-
"aria-controls": collapsible && id ? "" + id :
|
|
142
|
+
"aria-controls": collapsible && id ? "" + id : undefined,
|
|
143
143
|
"aria-expanded": expanded,
|
|
144
144
|
className: prefix('header'),
|
|
145
145
|
onClick: collapsible ? handleSelect : undefined,
|
|
@@ -13,12 +13,12 @@ export interface PanelGroupProps<T = KeyType> extends WithAsProps {
|
|
|
13
13
|
/** Primary content */
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
/** Toggles the callback function for the expand panel */
|
|
16
|
-
onSelect?: (eventKey: T, event: React.SyntheticEvent) => void;
|
|
16
|
+
onSelect?: (eventKey: T | undefined, event: React.SyntheticEvent) => void;
|
|
17
17
|
}
|
|
18
18
|
interface PanelGroupContext {
|
|
19
19
|
accordion?: boolean;
|
|
20
20
|
activeKey?: KeyType;
|
|
21
|
-
onGroupSelect?: (activeKey: KeyType, event: React.MouseEvent) => void;
|
|
21
|
+
onGroupSelect?: (activeKey: KeyType | undefined, event: React.MouseEvent) => void;
|
|
22
22
|
}
|
|
23
23
|
export declare const PanelGroupContext: React.Context<PanelGroupContext>;
|
|
24
24
|
declare const PanelGroup: React.ForwardRefExoticComponent<PanelGroupProps<KeyType> & React.RefAttributes<unknown>>;
|
|
@@ -51,16 +51,19 @@ var PanelGroup = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
51
51
|
setActiveKey(activeKey);
|
|
52
52
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(activeKey, event);
|
|
53
53
|
}, [onSelect, setActiveKey]);
|
|
54
|
+
var contextValue = (0, _react.useMemo)(function () {
|
|
55
|
+
return {
|
|
56
|
+
accordion: accordion,
|
|
57
|
+
activeKey: activeKey,
|
|
58
|
+
onGroupSelect: handleSelect
|
|
59
|
+
};
|
|
60
|
+
}, [accordion, activeKey, handleSelect]);
|
|
54
61
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
|
|
55
62
|
ref: ref,
|
|
56
63
|
role: accordion ? 'tablist' : undefined,
|
|
57
64
|
className: classes
|
|
58
65
|
}), /*#__PURE__*/_react.default.createElement(PanelGroupContext.Provider, {
|
|
59
|
-
value:
|
|
60
|
-
accordion: accordion,
|
|
61
|
-
activeKey: activeKey,
|
|
62
|
-
onGroupSelect: handleSelect
|
|
63
|
-
}
|
|
66
|
+
value: contextValue
|
|
64
67
|
}, children));
|
|
65
68
|
});
|
|
66
69
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ListProps } from './VirtualizedList';
|
|
4
4
|
import { StandardProps, ItemDataType } from '../@types/common';
|
|
5
|
-
export interface DropdownMenuProps extends StandardProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
5
|
+
export interface DropdownMenuProps<Multiple = false> extends StandardProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
6
6
|
classPrefix: string;
|
|
7
7
|
data?: ItemDataType[];
|
|
8
8
|
group?: boolean;
|
|
@@ -23,14 +23,17 @@ export interface DropdownMenuProps extends StandardProps, Omit<React.HTMLAttribu
|
|
|
23
23
|
/** Custom selected option */
|
|
24
24
|
renderMenuItem?: (itemLabel: React.ReactNode, item: any) => React.ReactNode;
|
|
25
25
|
renderMenuGroup?: (title: React.ReactNode, item: any) => React.ReactNode;
|
|
26
|
-
onSelect?: (value: any, item: any, event: React.MouseEvent, checked
|
|
26
|
+
onSelect?: Multiple extends true ? (value: any, item: any, event: React.MouseEvent, checked: boolean) => void : Multiple extends false ? (value: any, item: any, event: React.MouseEvent) => void : any;
|
|
27
27
|
onGroupTitleClick?: (event: React.MouseEvent) => void;
|
|
28
28
|
}
|
|
29
|
-
declare
|
|
29
|
+
export declare type DropdownMenuComponent = React.ForwardRefExoticComponent<DropdownMenuProps> & {
|
|
30
|
+
<Multiple = false>(props: DropdownMenuProps<Multiple>): React.ReactElement | null;
|
|
31
|
+
};
|
|
32
|
+
declare const DropdownMenu: DropdownMenuComponent;
|
|
30
33
|
export declare const dropdownMenuPropTypes: {
|
|
31
|
-
classPrefix: PropTypes.
|
|
34
|
+
classPrefix: PropTypes.Validator<string>;
|
|
32
35
|
className: PropTypes.Requireable<string>;
|
|
33
|
-
dropdownMenuItemAs: PropTypes.
|
|
36
|
+
dropdownMenuItemAs: PropTypes.Validator<PropTypes.ReactComponentLike>;
|
|
34
37
|
dropdownMenuItemClassPrefix: PropTypes.Requireable<string>;
|
|
35
38
|
data: PropTypes.Requireable<any[]>;
|
|
36
39
|
group: PropTypes.Requireable<boolean>;
|
|
@@ -87,7 +87,7 @@ var DropdownMenu = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
87
87
|
var styles = (0, _extends2.default)({}, style, {
|
|
88
88
|
maxHeight: maxHeight
|
|
89
89
|
});
|
|
90
|
-
var menuBodyContainerRef = (0, _react.useRef)();
|
|
90
|
+
var menuBodyContainerRef = (0, _react.useRef)(null);
|
|
91
91
|
|
|
92
92
|
var _useState = (0, _react.useState)([]),
|
|
93
93
|
foldedGroupKeys = _useState[0],
|
|
@@ -209,7 +209,7 @@ var DropdownMenu = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
209
209
|
|
|
210
210
|
var useVirtualized = virtualized && rowCount * rowHeight > maxHeight;
|
|
211
211
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
212
|
-
role: !useVirtualized ? 'listbox' :
|
|
212
|
+
role: !useVirtualized ? 'listbox' : undefined
|
|
213
213
|
}, rest, {
|
|
214
214
|
className: classes,
|
|
215
215
|
ref: (0, _utils.mergeRefs)(menuBodyContainerRef, ref),
|
|
@@ -226,7 +226,7 @@ var DropdownMenu = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
226
226
|
return /*#__PURE__*/_react.default.createElement(_VirtualizedList.List, (0, _extends2.default)({
|
|
227
227
|
role: "listbox",
|
|
228
228
|
containerRole: '',
|
|
229
|
-
"aria-readonly":
|
|
229
|
+
"aria-readonly": undefined,
|
|
230
230
|
width: width,
|
|
231
231
|
height: height || maxHeight,
|
|
232
232
|
scrollToIndex: (0, _findIndex.default)(data, function (item) {
|
|
@@ -244,9 +244,9 @@ var DropdownMenu = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
var dropdownMenuPropTypes = {
|
|
247
|
-
classPrefix: _propTypes.default.string,
|
|
247
|
+
classPrefix: _propTypes.default.string.isRequired,
|
|
248
248
|
className: _propTypes.default.string,
|
|
249
|
-
dropdownMenuItemAs: _propTypes.default.elementType,
|
|
249
|
+
dropdownMenuItemAs: _propTypes.default.elementType.isRequired,
|
|
250
250
|
dropdownMenuItemClassPrefix: _propTypes.default.string,
|
|
251
251
|
data: _propTypes.default.array,
|
|
252
252
|
group: _propTypes.default.bool,
|
|
@@ -31,10 +31,11 @@ var PickerOverlay = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
31
31
|
classPrefix = _props$classPrefix === void 0 ? 'picker-menu' : _props$classPrefix,
|
|
32
32
|
autoWidth = props.autoWidth,
|
|
33
33
|
className = props.className,
|
|
34
|
-
placement = props.placement,
|
|
34
|
+
_props$placement = props.placement,
|
|
35
|
+
placement = _props$placement === void 0 ? 'bottomStart' : _props$placement,
|
|
35
36
|
target = props.target,
|
|
36
37
|
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["as", "classPrefix", "autoWidth", "className", "placement", "target"]);
|
|
37
|
-
var overlayRef = (0, _react.useRef)();
|
|
38
|
+
var overlayRef = (0, _react.useRef)(null);
|
|
38
39
|
var handleResize = (0, _react.useCallback)(function () {
|
|
39
40
|
var instance = target === null || target === void 0 ? void 0 : target.current;
|
|
40
41
|
|
|
@@ -48,7 +49,7 @@ var PickerOverlay = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
48
49
|
(0, _react.useEffect)(function () {
|
|
49
50
|
var toggle = target === null || target === void 0 ? void 0 : target.current;
|
|
50
51
|
|
|
51
|
-
if (autoWidth && toggle.root) {
|
|
52
|
+
if (autoWidth && toggle !== null && toggle !== void 0 && toggle.root) {
|
|
52
53
|
// Get the width value of the button,
|
|
53
54
|
// and then set it to the menu to make their width consistent.
|
|
54
55
|
var width = (0, _getWidth.default)((0, _utils.getDOMNode)(toggle.root));
|
|
@@ -68,12 +68,13 @@ var PickerToggle = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
68
68
|
onClean = props.onClean,
|
|
69
69
|
onFocus = props.onFocus,
|
|
70
70
|
onBlur = props.onBlur,
|
|
71
|
-
placement = props.placement,
|
|
71
|
+
_props$placement = props.placement,
|
|
72
|
+
placement = _props$placement === void 0 ? 'bottomStart' : _props$placement,
|
|
72
73
|
caretComponent = props.caretComponent,
|
|
73
74
|
_props$caretAs = props.caretAs,
|
|
74
75
|
caretAs = _props$caretAs === void 0 ? caretComponent : _props$caretAs,
|
|
75
76
|
rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["active", "as", "classPrefix", "children", "caret", "className", "disabled", "readOnly", "plaintext", "hasValue", "cleanable", "tabIndex", "id", "value", "input", "inputPlaceholder", "inputValue", "inputMask", "onInputChange", "onInputPressEnter", "onInputBlur", "onInputFocus", "onClean", "onFocus", "onBlur", "placement", "caretComponent", "caretAs"]);
|
|
76
|
-
var inputRef = (0, _react.useRef)();
|
|
77
|
+
var inputRef = (0, _react.useRef)(null);
|
|
77
78
|
|
|
78
79
|
var _useState = (0, _react.useState)(false),
|
|
79
80
|
activeState = _useState[0],
|
|
@@ -193,7 +194,7 @@ var PickerToggle = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
193
194
|
}
|
|
194
195
|
}), children ? /*#__PURE__*/_react.default.createElement("span", {
|
|
195
196
|
className: prefix(hasValue ? 'value' : 'placeholder'),
|
|
196
|
-
"aria-placeholder": typeof children === 'string' ? children :
|
|
197
|
+
"aria-placeholder": typeof children === 'string' ? children : undefined
|
|
197
198
|
}, children) : null, showCleanButton && /*#__PURE__*/_react.default.createElement(_CloseButton.default, {
|
|
198
199
|
className: prefix(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2.default)(["clean"]))),
|
|
199
200
|
tabIndex: -1,
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OverlayTriggerInstance, OverlayTriggerType } from '../Overlay/OverlayTrigger';
|
|
3
3
|
import { PositionChildProps } from '../Overlay/Position';
|
|
4
|
-
import { TypeAttributes } from '../@types/common';
|
|
4
|
+
import { TypeAttributes, AnimationEventProps } from '../@types/common';
|
|
5
5
|
export type { OverlayTriggerInstance, PositionChildProps };
|
|
6
|
-
export interface PickerToggleTriggerProps {
|
|
6
|
+
export interface PickerToggleTriggerProps extends Omit<AnimationEventProps, 'onEntering' | 'onExiting'> {
|
|
7
7
|
placement?: TypeAttributes.Placement;
|
|
8
8
|
pickerProps: any;
|
|
9
9
|
open?: boolean;
|
|
10
10
|
trigger?: OverlayTriggerType | OverlayTriggerType[];
|
|
11
11
|
children: React.ReactElement | ((props: any, ref: any) => React.ReactElement);
|
|
12
12
|
speaker: React.ReactElement | ((props: any, ref: React.RefObject<any>) => React.ReactElement);
|
|
13
|
-
onEnter?: (node: null | Element | Text) => void;
|
|
14
|
-
onEntered?: (node: null | Element | Text) => void;
|
|
15
|
-
onExit?: (node: null | Element | Text) => void;
|
|
16
|
-
onExited?: (node: null | Element | Text) => void;
|
|
17
13
|
}
|
|
18
14
|
export declare const omitTriggerPropKeys: string[];
|
|
19
15
|
export declare const pickTriggerPropKeys: string[];
|
|
@@ -5,7 +5,7 @@ export interface SearchBarProps extends WithAsProps {
|
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
className?: string;
|
|
7
7
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
8
|
-
onChange?: (value: string, event: React.
|
|
8
|
+
onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const SearchBar: RsRefForwardingComponent<'div', SearchBarProps>;
|
|
11
11
|
export default SearchBar;
|
|
@@ -14,7 +14,8 @@ var SelectedElement = function SelectedElement(props) {
|
|
|
14
14
|
prefix = props.prefix,
|
|
15
15
|
valueKey = props.valueKey,
|
|
16
16
|
labelKey = props.labelKey,
|
|
17
|
-
childrenKey = props.childrenKey,
|
|
17
|
+
_props$childrenKey = props.childrenKey,
|
|
18
|
+
childrenKey = _props$childrenKey === void 0 ? 'children' : _props$childrenKey,
|
|
18
19
|
countable = props.countable,
|
|
19
20
|
cascade = props.cascade,
|
|
20
21
|
locale = props.locale;
|
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ListProps, ListRowProps } from 'react-virtualized/dist/commonjs/List';
|
|
3
3
|
import { AutoSizerProps } from 'react-virtualized/dist/commonjs/AutoSizer';
|
|
4
|
+
import type { Alignment } from 'react-virtualized';
|
|
4
5
|
export interface ListInstance {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Forcefully re-render the inner Grid component.
|
|
8
|
+
*/
|
|
9
|
+
forceUpdateGrid(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Gets offset for a given row and alignment.
|
|
12
|
+
*/
|
|
13
|
+
getOffsetForRow(params: {
|
|
14
|
+
alignment?: Alignment;
|
|
15
|
+
index?: number;
|
|
16
|
+
}): number;
|
|
17
|
+
/**
|
|
18
|
+
* Pre-measure all rows in a List.
|
|
19
|
+
*/
|
|
20
|
+
measureAllRows(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Recompute row heights and offsets after the specified index (defaults to 0).
|
|
23
|
+
*/
|
|
24
|
+
recomputeRowHeights(index?: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Scroll to the specified offset. Useful for animating position changes.
|
|
27
|
+
*/
|
|
28
|
+
scrollToPosition(scrollTop?: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Ensure row is visible. This method can be used to safely scroll back to a cell
|
|
31
|
+
* that a user has scrolled away from even if it was previously scrolled to.
|
|
32
|
+
*/
|
|
33
|
+
scrollToRow(index?: number): void;
|
|
7
34
|
}
|
|
8
35
|
export type { ListProps, AutoSizerProps, ListRowProps };
|
|
9
36
|
export declare const List: React.ComponentType<ListProps>;
|
|
@@ -9,11 +9,10 @@ export declare const pickerPropTypes: {
|
|
|
9
9
|
containerPadding: PropTypes.Requireable<number>;
|
|
10
10
|
container: PropTypes.Requireable<any>;
|
|
11
11
|
disabled: PropTypes.Requireable<boolean>;
|
|
12
|
-
toggleAs: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
13
12
|
menuClassName: PropTypes.Requireable<string>;
|
|
14
13
|
menuStyle: PropTypes.Requireable<object>;
|
|
15
14
|
placeholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
-
placement: PropTypes.Requireable<
|
|
15
|
+
placement: PropTypes.Requireable<"top" | "bottom" | "right" | "left" | "bottomStart" | "bottomEnd" | "topStart" | "topEnd" | "leftStart" | "rightStart" | "leftEnd" | "rightEnd" | "auto" | "autoVertical" | "autoVerticalStart" | "autoVerticalEnd" | "autoHorizontal" | "autoHorizontalStart" | "autoHorizontalEnd">;
|
|
17
16
|
/**
|
|
18
17
|
* Prevent floating element overflow
|
|
19
18
|
*/
|
|
@@ -26,7 +25,7 @@ export declare const pickerPropTypes: {
|
|
|
26
25
|
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
26
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
27
|
onClean: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
-
listProps: PropTypes.Requireable<
|
|
28
|
+
listProps: PropTypes.Requireable<any>;
|
|
30
29
|
onEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
30
|
onEntering: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
31
|
onEntered: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -35,7 +34,7 @@ export declare const pickerPropTypes: {
|
|
|
35
34
|
onExited: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
35
|
};
|
|
37
36
|
export declare const listPickerPropTypes: {
|
|
38
|
-
data: PropTypes.
|
|
37
|
+
data: PropTypes.Validator<any[]>;
|
|
39
38
|
valueKey: PropTypes.Requireable<string>;
|
|
40
39
|
labelKey: PropTypes.Requireable<string>;
|
|
41
40
|
childrenKey: PropTypes.Requireable<string>;
|
|
@@ -52,11 +51,10 @@ export declare const listPickerPropTypes: {
|
|
|
52
51
|
containerPadding: PropTypes.Requireable<number>;
|
|
53
52
|
container: PropTypes.Requireable<any>;
|
|
54
53
|
disabled: PropTypes.Requireable<boolean>;
|
|
55
|
-
toggleAs: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
56
54
|
menuClassName: PropTypes.Requireable<string>;
|
|
57
55
|
menuStyle: PropTypes.Requireable<object>;
|
|
58
56
|
placeholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
59
|
-
placement: PropTypes.Requireable<
|
|
57
|
+
placement: PropTypes.Requireable<"top" | "bottom" | "right" | "left" | "bottomStart" | "bottomEnd" | "topStart" | "topEnd" | "leftStart" | "rightStart" | "leftEnd" | "rightEnd" | "auto" | "autoVertical" | "autoVerticalStart" | "autoVerticalEnd" | "autoHorizontal" | "autoHorizontalStart" | "autoHorizontalEnd">;
|
|
60
58
|
/**
|
|
61
59
|
* Prevent floating element overflow
|
|
62
60
|
*/
|
|
@@ -69,7 +67,7 @@ export declare const listPickerPropTypes: {
|
|
|
69
67
|
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
68
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
69
|
onClean: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
-
listProps: PropTypes.Requireable<
|
|
70
|
+
listProps: PropTypes.Requireable<any>;
|
|
73
71
|
onEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
72
|
onEntering: PropTypes.Requireable<(...args: any[]) => any>;
|
|
75
73
|
onEntered: PropTypes.Requireable<(...args: any[]) => any>;
|
package/cjs/Picker/propTypes.js
CHANGED
|
@@ -23,7 +23,8 @@ var pickerPropTypes = (0, _extends2.default)({}, _utils2.animationPropTypes, {
|
|
|
23
23
|
containerPadding: _propTypes.default.number,
|
|
24
24
|
container: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.func]),
|
|
25
25
|
disabled: _propTypes.default.bool,
|
|
26
|
-
|
|
26
|
+
// PropTypes.elementType conflictin with React.ElementType
|
|
27
|
+
// toggleAs: PropTypes.elementType,
|
|
27
28
|
menuClassName: _propTypes.default.string,
|
|
28
29
|
menuStyle: _propTypes.default.object,
|
|
29
30
|
placeholder: _propTypes.default.node,
|
|
@@ -41,11 +42,11 @@ var pickerPropTypes = (0, _extends2.default)({}, _utils2.animationPropTypes, {
|
|
|
41
42
|
onOpen: _propTypes.default.func,
|
|
42
43
|
onClose: _propTypes.default.func,
|
|
43
44
|
onClean: _propTypes.default.func,
|
|
44
|
-
listProps: _propTypes.default.
|
|
45
|
+
listProps: _propTypes.default.any
|
|
45
46
|
});
|
|
46
47
|
exports.pickerPropTypes = pickerPropTypes;
|
|
47
48
|
var listPickerPropTypes = (0, _extends2.default)({}, pickerPropTypes, {
|
|
48
|
-
data: _propTypes.default.array,
|
|
49
|
+
data: _propTypes.default.array.isRequired,
|
|
49
50
|
valueKey: _propTypes.default.string,
|
|
50
51
|
labelKey: _propTypes.default.string,
|
|
51
52
|
childrenKey: _propTypes.default.string,
|
package/cjs/Picker/utils.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OverlayTriggerInstance } from './PickerToggleTrigger';
|
|
3
3
|
import { TypeAttributes, ItemDataType } from '../@types/common';
|
|
4
|
+
import { ListInstance } from './VirtualizedList';
|
|
4
5
|
interface NodeKeys {
|
|
5
6
|
valueKey: string;
|
|
6
7
|
childrenKey: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function createConcatChildrenFunction(node: any, nodeValue?: any, nodeKeys?: NodeKeys): (data:
|
|
9
|
+
export declare function createConcatChildrenFunction<T = any>(node: any, nodeValue?: any, nodeKeys?: NodeKeys): (data: T[], children: T[]) => T[];
|
|
9
10
|
export declare function shouldDisplay(label: React.ReactNode, searchKeyword: string): boolean;
|
|
10
11
|
interface PickerClassNameProps {
|
|
11
12
|
name?: string;
|
|
12
|
-
classPrefix
|
|
13
|
+
classPrefix: string;
|
|
13
14
|
className?: string;
|
|
14
15
|
placement?: TypeAttributes.Placement;
|
|
15
16
|
appearance?: 'default' | 'subtle';
|
|
@@ -42,7 +43,7 @@ interface EventsProps {
|
|
|
42
43
|
*/
|
|
43
44
|
export declare function onMenuKeyDown(event: React.KeyboardEvent, events: EventsProps): void;
|
|
44
45
|
interface FocusItemValueProps {
|
|
45
|
-
target: HTMLElement | (() => HTMLElement);
|
|
46
|
+
target: HTMLElement | null | (() => HTMLElement | null);
|
|
46
47
|
data?: any[];
|
|
47
48
|
valueKey?: string;
|
|
48
49
|
focusableQueryKey?: string;
|
|
@@ -55,9 +56,9 @@ interface FocusItemValueProps {
|
|
|
55
56
|
* @param defaultFocusItemValue
|
|
56
57
|
* @param props
|
|
57
58
|
*/
|
|
58
|
-
export declare const useFocusItemValue: (defaultFocusItemValue:
|
|
59
|
-
focusItemValue:
|
|
60
|
-
setFocusItemValue: React.Dispatch<
|
|
59
|
+
export declare const useFocusItemValue: <T>(defaultFocusItemValue: T | null | undefined, props: FocusItemValueProps) => {
|
|
60
|
+
focusItemValue: T | null | undefined;
|
|
61
|
+
setFocusItemValue: React.Dispatch<React.SetStateAction<T | null | undefined>>;
|
|
61
62
|
layer: number;
|
|
62
63
|
setLayer: React.Dispatch<React.SetStateAction<number>>;
|
|
63
64
|
keys: any[];
|
|
@@ -66,7 +67,7 @@ export declare const useFocusItemValue: (defaultFocusItemValue: number | string
|
|
|
66
67
|
};
|
|
67
68
|
interface ToggleKeyDownEventProps {
|
|
68
69
|
toggle?: boolean;
|
|
69
|
-
triggerRef
|
|
70
|
+
triggerRef: React.RefObject<any>;
|
|
70
71
|
targetRef: React.RefObject<any>;
|
|
71
72
|
overlayRef?: React.RefObject<any>;
|
|
72
73
|
searchInputRef?: React.RefObject<any>;
|
|
@@ -88,7 +89,7 @@ export declare const useToggleKeyDownEvent: (props: ToggleKeyDownEventProps) =>
|
|
|
88
89
|
interface SearchProps {
|
|
89
90
|
labelKey: string;
|
|
90
91
|
data: ItemDataType[];
|
|
91
|
-
searchBy
|
|
92
|
+
searchBy?: (keyword: any, label: any, item: any) => boolean;
|
|
92
93
|
callback?: (keyword: string, data: ItemDataType[], event: React.SyntheticEvent) => void;
|
|
93
94
|
}
|
|
94
95
|
/**
|
|
@@ -97,31 +98,22 @@ interface SearchProps {
|
|
|
97
98
|
*/
|
|
98
99
|
export declare function useSearch(props: SearchProps): {
|
|
99
100
|
searchKeyword: string;
|
|
100
|
-
filteredData:
|
|
101
|
+
filteredData: import("../CheckTreePicker/utils").TreeNodeType[];
|
|
101
102
|
updateFilteredData: (nextData: ItemDataType[]) => void;
|
|
102
103
|
setSearchKeyword: React.Dispatch<React.SetStateAction<string>>;
|
|
103
|
-
checkShouldDisplay: (item: ItemDataType, keyword?: string) => boolean;
|
|
104
|
+
checkShouldDisplay: (item: ItemDataType, keyword?: string | undefined) => boolean;
|
|
104
105
|
handleSearch: (searchKeyword: string, event: React.SyntheticEvent) => void;
|
|
105
106
|
};
|
|
106
|
-
interface
|
|
107
|
+
interface PickerDependentParameters {
|
|
107
108
|
triggerRef?: React.RefObject<OverlayTriggerInstance>;
|
|
108
109
|
rootRef?: React.RefObject<HTMLElement>;
|
|
109
110
|
overlayRef?: React.RefObject<HTMLElement>;
|
|
110
111
|
targetRef?: React.RefObject<HTMLElement>;
|
|
112
|
+
listRef?: React.RefObject<ListInstance>;
|
|
113
|
+
inline?: boolean;
|
|
111
114
|
}
|
|
112
115
|
/**
|
|
113
116
|
* A hook of the exposed method of Picker
|
|
114
|
-
*
|
|
115
|
-
* {
|
|
116
|
-
* root: Element;
|
|
117
|
-
* overlay: Element;
|
|
118
|
-
* target?: Element;
|
|
119
|
-
* updatePosition:() => void;
|
|
120
|
-
* open:() => void;
|
|
121
|
-
* close:() => void;
|
|
122
|
-
* }
|
|
123
|
-
* @param ref
|
|
124
|
-
* @param params
|
|
125
117
|
*/
|
|
126
|
-
export declare function usePublicMethods(ref: any,
|
|
118
|
+
export declare function usePublicMethods(ref: any, parmas: PickerDependentParameters): void;
|
|
127
119
|
export {};
|