rsuite 5.2.1 → 5.3.0
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/Button/styles/index.less +6 -0
- package/ButtonGroup/styles/index.less +0 -18
- package/CHANGELOG.md +49 -0
- package/CheckTreePicker/styles/index.less +14 -1
- package/PanelGroup/styles/index.less +12 -12
- package/Table/styles/index.less +0 -4
- package/TreePicker/styles/index.less +10 -0
- package/cjs/@types/common.d.ts +9 -8
- 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 +71 -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 +8 -2
- 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 +5 -2
- package/cjs/Calendar/CalendarContext.js +1 -1
- package/cjs/Calendar/TableRow.js +1 -1
- package/cjs/Calendar/TimeDropdown.js +6 -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 +3 -3
- package/cjs/CheckPicker/CheckPicker.js +4 -4
- 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/CheckboxGroup/CheckboxGroup.js +2 -2
- 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 +15 -9
- 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 +126 -107
- 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 +4 -2
- 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 +3 -2
- package/cjs/Dropdown/DropdownMenu.d.ts +3 -3
- package/cjs/Dropdown/DropdownState.d.ts +1 -1
- package/cjs/Dropdown/DropdownToggle.js +2 -1
- 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/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 +16 -11
- 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/MaskedInput.d.ts +5 -42
- package/cjs/MaskedInput/MaskedInput.js +9 -63
- package/cjs/MaskedInput/TextMask.d.ts +43 -0
- package/cjs/MaskedInput/TextMask.js +80 -0
- 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 +60 -41
- package/cjs/Menu/MenuContext.d.ts +1 -1
- package/cjs/Menu/MenuItem.d.ts +1 -1
- package/cjs/Menu/MenuItem.js +31 -23
- 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 +12 -15
- package/cjs/MultiCascader/DropdownMenu.d.ts +4 -4
- package/cjs/MultiCascader/MultiCascader.js +6 -6
- package/cjs/MultiCascader/utils.d.ts +14 -14
- package/cjs/Nav/Nav.d.ts +1 -1
- package/cjs/Nav/NavContext.d.ts +1 -1
- 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 +41 -31
- package/cjs/Overlay/ModalManager.d.ts +17 -8
- package/cjs/Overlay/ModalManager.js +11 -20
- package/cjs/Overlay/Overlay.d.ts +2 -2
- package/cjs/Overlay/Overlay.js +1 -1
- package/cjs/Overlay/OverlayTrigger.d.ts +11 -11
- package/cjs/Overlay/OverlayTrigger.js +14 -6
- package/cjs/Overlay/Position.d.ts +3 -3
- package/cjs/Overlay/Position.js +21 -12
- 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/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 +11 -8
- 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 +2 -2
- package/cjs/Picker/utils.d.ts +17 -25
- 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 +3 -3
- 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 +5 -2
- package/cjs/Ripple/Ripple.js +1 -1
- package/cjs/SelectPicker/SelectPicker.js +4 -4
- 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/Steps/StepItem.js +2 -2
- package/cjs/TagInput/index.js +1 -1
- package/cjs/Toggle/Toggle.js +1 -1
- package/cjs/Tree/Tree.d.ts +3 -1
- package/cjs/TreePicker/TreeNode.js +6 -8
- package/cjs/TreePicker/TreePicker.js +36 -27
- 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 +2 -0
- package/cjs/index.js +5 -1
- 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 +32 -29
- 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/useElementResize.d.ts +1 -1
- package/cjs/utils/useElementResize.js +11 -6
- package/cjs/utils/useFocus.d.ts +2 -2
- package/cjs/utils/usePortal.d.ts +1 -1
- 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 +85 -165
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +85 -165
- package/dist/rsuite.js +468 -445
- 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.LICENSE.txt +9 -0
- package/dist/rsuite.min.js.map +1 -1
- package/esm/@types/common.d.ts +9 -8
- 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 +54 -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 +7 -2
- 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 +5 -2
- package/esm/Calendar/CalendarContext.js +1 -1
- package/esm/Calendar/TableRow.js +1 -1
- package/esm/Calendar/TimeDropdown.js +5 -4
- 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 +3 -3
- package/esm/CheckPicker/CheckPicker.js +4 -4
- 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/CheckboxGroup/CheckboxGroup.js +2 -2
- 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 +14 -9
- 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 +124 -107
- 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 +4 -2
- 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 +3 -2
- package/esm/Dropdown/DropdownMenu.d.ts +3 -3
- package/esm/Dropdown/DropdownState.d.ts +1 -1
- package/esm/Dropdown/DropdownToggle.js +2 -1
- 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/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 +16 -11
- 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/MaskedInput.d.ts +5 -42
- package/esm/MaskedInput/MaskedInput.js +9 -63
- package/esm/MaskedInput/TextMask.d.ts +43 -0
- package/esm/MaskedInput/TextMask.js +67 -0
- 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 +59 -43
- package/esm/Menu/MenuContext.d.ts +1 -1
- package/esm/Menu/MenuItem.d.ts +1 -1
- package/esm/Menu/MenuItem.js +30 -23
- 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 +11 -12
- package/esm/MultiCascader/DropdownMenu.d.ts +4 -4
- package/esm/MultiCascader/MultiCascader.js +6 -6
- package/esm/MultiCascader/utils.d.ts +14 -14
- package/esm/Nav/Nav.d.ts +1 -1
- package/esm/Nav/NavContext.d.ts +1 -1
- 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 +42 -32
- package/esm/Overlay/ModalManager.d.ts +17 -8
- package/esm/Overlay/ModalManager.js +11 -20
- package/esm/Overlay/Overlay.d.ts +2 -2
- package/esm/Overlay/Overlay.js +1 -1
- package/esm/Overlay/OverlayTrigger.d.ts +11 -11
- package/esm/Overlay/OverlayTrigger.js +14 -6
- package/esm/Overlay/Position.d.ts +3 -3
- package/esm/Overlay/Position.js +20 -11
- 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/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 +11 -8
- 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 +2 -2
- package/esm/Picker/utils.d.ts +17 -25
- 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 +3 -3
- 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 +4 -2
- package/esm/Ripple/Ripple.js +1 -1
- package/esm/SelectPicker/SelectPicker.js +4 -4
- 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/Steps/StepItem.js +2 -2
- package/esm/TagInput/index.js +1 -1
- package/esm/Toggle/Toggle.js +1 -1
- package/esm/Tree/Tree.d.ts +3 -1
- package/esm/TreePicker/TreeNode.js +4 -7
- package/esm/TreePicker/TreePicker.js +35 -25
- 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 +2 -0
- package/esm/index.js +1 -0
- 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 +32 -29
- 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/useElementResize.d.ts +1 -1
- package/esm/utils/useElementResize.js +12 -5
- package/esm/utils/useFocus.d.ts +2 -2
- package/esm/utils/usePortal.d.ts +1 -1
- 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 +4 -4
- package/styles/index.less +1 -0
package/esm/Slider/Slider.js
CHANGED
|
@@ -73,7 +73,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
73
73
|
onChangeCommitted = props.onChangeCommitted,
|
|
74
74
|
rest = _objectWithoutPropertiesLoose(props, ["aria-label", "aria-labelledby", "aria-valuetext", "as", "graduated", "className", "barClassName", "progress", "vertical", "disabled", "readOnly", "plaintext", "classPrefix", "min", "handleClassName", "handleStyle", "handleTitle", "tooltip", "step", "defaultValue", "value", "max", "getAriaValueText", "renderTooltip", "renderMark", "onChange", "onChangeCommitted"]);
|
|
75
75
|
|
|
76
|
-
var barRef = useRef();
|
|
76
|
+
var barRef = useRef(null);
|
|
77
77
|
|
|
78
78
|
var _useClassNames = useClassNames(classPrefix),
|
|
79
79
|
merge = _useClassNames.merge,
|
|
@@ -242,7 +242,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
242
242
|
onDragMove: handleChangeValue,
|
|
243
243
|
onKeyDown: handleKeyDown,
|
|
244
244
|
onDragEnd: handleChangeCommitted,
|
|
245
|
-
tabIndex: disabled || readOnly ?
|
|
245
|
+
tabIndex: disabled || readOnly ? undefined : 0,
|
|
246
246
|
"aria-orientation": vertical ? 'vertical' : 'horizontal',
|
|
247
247
|
"aria-valuenow": value,
|
|
248
248
|
"aria-disabled": disabled,
|
package/esm/Slider/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const precisionMath: (value: any) => number;
|
|
2
|
-
|
|
2
|
+
declare function checkValue<T extends number | undefined>(value: T, min: number, max: number): T extends undefined ? undefined : number;
|
|
3
|
+
export { checkValue };
|
package/esm/Slider/utils.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export var precisionMath = function precisionMath(value) {
|
|
2
2
|
return parseFloat(value.toFixed(10));
|
|
3
3
|
};
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
function checkValue(value, min, max) {
|
|
5
6
|
if (typeof value === 'undefined') {
|
|
6
7
|
return value;
|
|
7
8
|
}
|
|
@@ -15,4 +16,6 @@ export var checkValue = function checkValue(value, min, max) {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
return value;
|
|
18
|
-
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { checkValue };
|
package/esm/Steps/StepItem.js
CHANGED
|
@@ -12,7 +12,7 @@ var STEP_STATUS_ICON = {
|
|
|
12
12
|
error: /*#__PURE__*/React.createElement(Close, null)
|
|
13
13
|
};
|
|
14
14
|
var StepItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
|
-
var _withClassPrefix
|
|
15
|
+
var _withClassPrefix;
|
|
16
16
|
|
|
17
17
|
var _props$as = props.as,
|
|
18
18
|
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
@@ -43,7 +43,7 @@ var StepItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
43
43
|
|
|
44
44
|
var iconNode = /*#__PURE__*/React.createElement("span", {
|
|
45
45
|
className: prefix('icon', "icon-" + status)
|
|
46
|
-
},
|
|
46
|
+
}, status ? STEP_STATUS_ICON[status] : stepNumber);
|
|
47
47
|
|
|
48
48
|
if (icon) {
|
|
49
49
|
iconNode = /*#__PURE__*/React.createElement("span", {
|
package/esm/TagInput/index.js
CHANGED
package/esm/Toggle/Toggle.js
CHANGED
|
@@ -25,7 +25,7 @@ var Toggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
25
|
onChange = props.onChange,
|
|
26
26
|
rest = _objectWithoutPropertiesLoose(props, ["as", "disabled", "readOnly", "loading", "plaintext", "className", "checkedChildren", "unCheckedChildren", "classPrefix", "checked", "defaultChecked", "size", "locale", "onChange"]);
|
|
27
27
|
|
|
28
|
-
var inputRef = useRef();
|
|
28
|
+
var inputRef = useRef(null);
|
|
29
29
|
|
|
30
30
|
var _useControlled = useControlled(checkedProp, defaultChecked),
|
|
31
31
|
checked = _useControlled[0],
|
package/esm/Tree/Tree.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export interface TreeBaseProps<ValueType = string | number, ItemDataType = Recor
|
|
|
43
43
|
height?: number;
|
|
44
44
|
/** Whether display search input box */
|
|
45
45
|
searchable?: boolean;
|
|
46
|
+
/** Display an auxiliary line when the tree node is indented. */
|
|
47
|
+
showIndentLine?: boolean;
|
|
46
48
|
/** Whether using virtualized list */
|
|
47
49
|
virtualized?: boolean;
|
|
48
50
|
/**
|
|
@@ -59,7 +61,7 @@ export interface TreeBaseProps<ValueType = string | number, ItemDataType = Recor
|
|
|
59
61
|
/** Set the option value for the expand node with controlled*/
|
|
60
62
|
expandItemValues?: any[];
|
|
61
63
|
/** Callback function for data change */
|
|
62
|
-
onExpand?: (expandItemValues: ItemDataType[], activeNode: ItemDataType, concat: (data: ItemDataType[], children:
|
|
64
|
+
onExpand?: (expandItemValues: ItemDataType[], activeNode: ItemDataType, concat: (data: ItemDataType[], children: ItemDataType[]) => ItemDataType[]) => void;
|
|
63
65
|
/** Callback function after selecting tree node */
|
|
64
66
|
onSelect?: (activeNode: ItemDataType, value: ValueType, event: React.SyntheticEvent) => void;
|
|
65
67
|
/** Custom Render tree Node */
|
|
@@ -7,10 +7,9 @@ import ArrowDown from '@rsuite/icons/legacy/ArrowDown';
|
|
|
7
7
|
import Spinner from '@rsuite/icons/legacy/Spinner';
|
|
8
8
|
import TreeContext from '../Tree/TreeContext';
|
|
9
9
|
import reactToString from '../utils/reactToString';
|
|
10
|
-
import { useClassNames
|
|
10
|
+
import { useClassNames } from '../utils';
|
|
11
|
+
import { getTreeNodeIndent } from '../utils/treeUtils';
|
|
11
12
|
var TreeNode = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
12
|
-
var _extends2;
|
|
13
|
-
|
|
14
13
|
var _ref$as = _ref.as,
|
|
15
14
|
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
16
15
|
rtl = _ref.rtl,
|
|
@@ -174,11 +173,9 @@ var TreeNode = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
174
173
|
active: active,
|
|
175
174
|
'text-muted': disabled,
|
|
176
175
|
focus: focus
|
|
177
|
-
}));
|
|
178
|
-
|
|
179
|
-
var padding = (layer - 1) * TREE_NODE_PADDING + TREE_NODE_ROOT_PADDING;
|
|
176
|
+
}));
|
|
180
177
|
|
|
181
|
-
var styles = _extends({}, style, (
|
|
178
|
+
var styles = _extends({}, style, getTreeNodeIndent(rtl, layer - 1));
|
|
182
179
|
|
|
183
180
|
return visible ? /*#__PURE__*/React.createElement(Component, _extends({
|
|
184
181
|
role: "treeitem"
|
|
@@ -9,6 +9,7 @@ import React, { useState, useRef, useEffect, useCallback, useContext } from 'rea
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { List, AutoSizer } from '../Picker/VirtualizedList';
|
|
11
11
|
import TreeNode from './TreeNode';
|
|
12
|
+
import { getTreeNodeIndent } from '../utils/treeUtils';
|
|
12
13
|
import { createChainedFunction, useClassNames, useCustom, useControlled, TREE_NODE_DROP_POSITION, KEY_VALUES, mergeRefs, shallowEqual } from '../utils';
|
|
13
14
|
import { getExpandWhenSearching, hasVisibleChildren, getDragNodeKeys, calDropNodePosition, createUpdateTreeDataFunction, useTreeDrag, useFlattenTreeData, getTreeActiveNode, getDefaultExpandItemValues, useTreeNodeRefs, useTreeSearch, focusPreviousItem, getFocusableItems, focusNextItem, getActiveItem, toggleExpand, useGetTreeNodeChildren, focusToActiveTreeNode, leftArrowHandler, focusTreeNode, rightArrowHandler, isSearching } from '../utils/treeUtils';
|
|
14
15
|
import { PickerToggle, PickerOverlay, SearchBar, PickerToggleTrigger, createConcatChildrenFunction, usePickerClassName, onMenuKeyDown as _onMenuKeyDown, usePublicMethods, listPickerPropTypes, pickTriggerPropKeys, omitTriggerPropKeys, useToggleKeyDownEvent } from '../Picker';
|
|
@@ -24,6 +25,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
24
25
|
_props$appearance = props.appearance,
|
|
25
26
|
appearance = _props$appearance === void 0 ? 'default' : _props$appearance,
|
|
26
27
|
style = props.style,
|
|
28
|
+
showIndentLine = props.showIndentLine,
|
|
27
29
|
controlledValue = props.value,
|
|
28
30
|
overrideLocale = props.locale,
|
|
29
31
|
_props$height = props.height,
|
|
@@ -37,7 +39,8 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
37
39
|
menuStyle = props.menuStyle,
|
|
38
40
|
_props$searchable = props.searchable,
|
|
39
41
|
searchable = _props$searchable === void 0 ? true : _props$searchable,
|
|
40
|
-
virtualized = props.virtualized,
|
|
42
|
+
_props$virtualized = props.virtualized,
|
|
43
|
+
virtualized = _props$virtualized === void 0 ? false : _props$virtualized,
|
|
41
44
|
_props$classPrefix = props.classPrefix,
|
|
42
45
|
classPrefix = _props$classPrefix === void 0 ? 'picker' : _props$classPrefix,
|
|
43
46
|
defaultValue = props.defaultValue,
|
|
@@ -85,14 +88,14 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
85
88
|
renderMenu = props.renderMenu,
|
|
86
89
|
renderValue = props.renderValue,
|
|
87
90
|
renderDragNode = props.renderDragNode,
|
|
88
|
-
rest = _objectWithoutPropertiesLoose(props, ["as", "data", "appearance", "style", "value", "locale", "height", "className", "disabled", "placement", "cleanable", "menuStyle", "searchable", "virtualized", "classPrefix", "defaultValue", "placeholder", "searchKeyword", "menuClassName", "menuAutoWidth", "searchBy", "toggleAs", "labelKey", "valueKey", "childrenKey", "draggable", "defaultExpandAll", "disabledItemValues", "expandItemValues", "defaultExpandItemValues", "id", "listProps", "getChildren", "renderTreeIcon", "renderTreeNode", "onExit", "onExited", "onClean", "onOpen", "onSearch", "onSelect", "onChange", "onEntered", "onClose", "onDragEnd", "onDragStart", "onDragEnter", "onDragLeave", "onDragOver", "onDrop", "onExpand", "renderExtraFooter", "renderMenu", "renderValue", "renderDragNode"]);
|
|
91
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "data", "appearance", "style", "showIndentLine", "value", "locale", "height", "className", "disabled", "placement", "cleanable", "menuStyle", "searchable", "virtualized", "classPrefix", "defaultValue", "placeholder", "searchKeyword", "menuClassName", "menuAutoWidth", "searchBy", "toggleAs", "labelKey", "valueKey", "childrenKey", "draggable", "defaultExpandAll", "disabledItemValues", "expandItemValues", "defaultExpandItemValues", "id", "listProps", "getChildren", "renderTreeIcon", "renderTreeNode", "onExit", "onExited", "onClean", "onOpen", "onSearch", "onSelect", "onChange", "onEntered", "onClose", "onDragEnd", "onDragStart", "onDragEnter", "onDragLeave", "onDragOver", "onDrop", "onExpand", "renderExtraFooter", "renderMenu", "renderValue", "renderDragNode"]);
|
|
89
92
|
|
|
90
|
-
var triggerRef = useRef();
|
|
91
|
-
var targetRef = useRef();
|
|
92
|
-
var listRef = useRef();
|
|
93
|
-
var overlayRef = useRef();
|
|
94
|
-
var searchInputRef = useRef();
|
|
95
|
-
var treeViewRef = useRef();
|
|
93
|
+
var triggerRef = useRef(null);
|
|
94
|
+
var targetRef = useRef(null);
|
|
95
|
+
var listRef = useRef(null);
|
|
96
|
+
var overlayRef = useRef(null);
|
|
97
|
+
var searchInputRef = useRef(null);
|
|
98
|
+
var treeViewRef = useRef(null);
|
|
96
99
|
|
|
97
100
|
var _useCustom = useCustom('Picker', overrideLocale),
|
|
98
101
|
rtl = _useCustom.rtl,
|
|
@@ -184,21 +187,17 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
184
187
|
|
|
185
188
|
var activeNode = getTreeActiveNode(flattenNodes, value, valueKey);
|
|
186
189
|
var getFormattedNodes = useCallback(function (render) {
|
|
187
|
-
var formattedNodes = [];
|
|
188
|
-
|
|
189
190
|
if (virtualized) {
|
|
190
|
-
|
|
191
|
+
return formatVirtualizedTreeData(flattenNodes, filteredData, expandItemValues, {
|
|
191
192
|
searchKeyword: searchKeywordState
|
|
192
193
|
}).filter(function (n) {
|
|
193
194
|
return n.visible;
|
|
194
195
|
});
|
|
195
|
-
} else {
|
|
196
|
-
formattedNodes = filteredData.map(function (dataItem, index) {
|
|
197
|
-
return render === null || render === void 0 ? void 0 : render(dataItem, index, 1);
|
|
198
|
-
});
|
|
199
196
|
}
|
|
200
197
|
|
|
201
|
-
return
|
|
198
|
+
return filteredData.map(function (dataItem, index) {
|
|
199
|
+
return render === null || render === void 0 ? void 0 : render(dataItem, index, 1);
|
|
200
|
+
});
|
|
202
201
|
}, [searchKeywordState, expandItemValues, filteredData, flattenNodes, formatVirtualizedTreeData, virtualized]);
|
|
203
202
|
var focusActiveNode = useCallback(function () {
|
|
204
203
|
focusToActiveTreeNode({
|
|
@@ -412,10 +411,13 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
412
411
|
(_targetRef$current2 = targetRef.current) === null || _targetRef$current2 === void 0 ? void 0 : _targetRef$current2.focus();
|
|
413
412
|
}, [activeNode, setSearchKeyword, valueKey]);
|
|
414
413
|
usePublicMethods(ref, {
|
|
414
|
+
rootRef: inline ? treeViewRef : undefined,
|
|
415
415
|
triggerRef: triggerRef,
|
|
416
416
|
overlayRef: overlayRef,
|
|
417
|
-
targetRef: targetRef
|
|
418
|
-
|
|
417
|
+
targetRef: targetRef,
|
|
418
|
+
listRef: listRef,
|
|
419
|
+
inline: inline
|
|
420
|
+
});
|
|
419
421
|
var handleFocusItem = useCallback(function (key) {
|
|
420
422
|
var focusableItems = getFocusableItems(filteredData, {
|
|
421
423
|
disabledItemValues: disabledItemValues,
|
|
@@ -445,11 +447,13 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
445
447
|
}
|
|
446
448
|
}, [searchKeywordState, expandItemValues, filteredData, focusItemValue, treeNodesRefs, treePrefix, valueKey, childrenKey, disabledItemValues]);
|
|
447
449
|
var handleLeftArrow = useCallback(function () {
|
|
450
|
+
if (_isNil(focusItemValue)) return;
|
|
448
451
|
var focusItem = getActiveItem(focusItemValue, flattenNodes, valueKey);
|
|
449
452
|
leftArrowHandler({
|
|
450
453
|
focusItem: focusItem,
|
|
451
454
|
expand: expandItemValues.includes(focusItem === null || focusItem === void 0 ? void 0 : focusItem[valueKey]),
|
|
452
455
|
onExpand: handleExpand,
|
|
456
|
+
childrenKey: childrenKey,
|
|
453
457
|
onFocusItem: function onFocusItem() {
|
|
454
458
|
var _focusItem$parent, _focusItem$parent2;
|
|
455
459
|
|
|
@@ -457,8 +461,9 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
457
461
|
focusTreeNode(focusItem === null || focusItem === void 0 ? void 0 : (_focusItem$parent2 = focusItem.parent) === null || _focusItem$parent2 === void 0 ? void 0 : _focusItem$parent2.refKey, treeNodesRefs, "." + treePrefix('node-label'));
|
|
458
462
|
}
|
|
459
463
|
});
|
|
460
|
-
}, [expandItemValues, flattenNodes, focusItemValue, handleExpand, treeNodesRefs, treePrefix, valueKey]);
|
|
464
|
+
}, [expandItemValues, flattenNodes, focusItemValue, handleExpand, treeNodesRefs, treePrefix, valueKey, childrenKey]);
|
|
461
465
|
var handleRightArrow = useCallback(function () {
|
|
466
|
+
if (_isNil(focusItemValue)) return;
|
|
462
467
|
var focusItem = getActiveItem(focusItemValue, flattenNodes, valueKey);
|
|
463
468
|
rightArrowHandler({
|
|
464
469
|
focusItem: focusItem,
|
|
@@ -471,10 +476,12 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
471
476
|
});
|
|
472
477
|
}, [focusItemValue, flattenNodes, valueKey, expandItemValues, childrenKey, handleExpand, handleFocusItem]);
|
|
473
478
|
var selectActiveItem = useCallback(function (event) {
|
|
479
|
+
if (_isNil(focusItemValue)) return;
|
|
474
480
|
var activeItem = getActiveItem(focusItemValue, flattenNodes, valueKey);
|
|
475
481
|
handleSelect(activeItem, event);
|
|
476
482
|
}, [flattenNodes, valueKey, focusItemValue, handleSelect]);
|
|
477
483
|
var handleClean = useCallback(function (event) {
|
|
484
|
+
var nullValue = null;
|
|
478
485
|
var target = event.target; // exclude searchBar
|
|
479
486
|
|
|
480
487
|
if (target.matches('div[role="searchbox"] > input')) {
|
|
@@ -482,7 +489,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
482
489
|
}
|
|
483
490
|
|
|
484
491
|
setValue(null);
|
|
485
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
492
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nullValue, event);
|
|
486
493
|
}, [onChange, setValue]);
|
|
487
494
|
var onPickerKeydown = useToggleKeyDownEvent(_extends({
|
|
488
495
|
toggle: !activeNode || !active,
|
|
@@ -553,18 +560,21 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
553
560
|
key: node[valueKey]
|
|
554
561
|
}, /*#__PURE__*/React.createElement(TreeNode, _extends({}, nodeProps, {
|
|
555
562
|
ref: function ref(_ref) {
|
|
556
|
-
return saveTreeNodeRef(node.refKey
|
|
563
|
+
return saveTreeNodeRef(_ref, node.refKey);
|
|
557
564
|
}
|
|
558
565
|
})), /*#__PURE__*/React.createElement("div", {
|
|
559
566
|
className: treePrefix('children')
|
|
560
567
|
}, nodes.map(function (child, i) {
|
|
561
568
|
return renderNode(child, i, layer);
|
|
569
|
+
}), showIndentLine && /*#__PURE__*/React.createElement("span", {
|
|
570
|
+
className: treePrefix('indent-line'),
|
|
571
|
+
style: getTreeNodeIndent(rtl, layer - 1, true)
|
|
562
572
|
})));
|
|
563
573
|
}
|
|
564
574
|
|
|
565
575
|
return /*#__PURE__*/React.createElement(TreeNode, _extends({
|
|
566
576
|
ref: function ref(_ref2) {
|
|
567
|
-
return saveTreeNodeRef(node.refKey
|
|
577
|
+
return saveTreeNodeRef(_ref2, node.refKey);
|
|
568
578
|
},
|
|
569
579
|
key: node[valueKey]
|
|
570
580
|
}, nodeProps));
|
|
@@ -593,7 +603,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
593
603
|
|
|
594
604
|
return visible && /*#__PURE__*/React.createElement(TreeNode, _extends({
|
|
595
605
|
ref: function ref(_ref4) {
|
|
596
|
-
return saveTreeNodeRef(node.refKey
|
|
606
|
+
return saveTreeNodeRef(_ref4, node.refKey);
|
|
597
607
|
},
|
|
598
608
|
key: key
|
|
599
609
|
}, nodeProps));
|
|
@@ -601,7 +611,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
601
611
|
};
|
|
602
612
|
|
|
603
613
|
var renderDefaultDragNode = function renderDefaultDragNode() {
|
|
604
|
-
if (draggable) {
|
|
614
|
+
if (draggable && !_isNil(dragNode)) {
|
|
605
615
|
var dragNodeContent = dragNode === null || dragNode === void 0 ? void 0 : dragNode[labelKey];
|
|
606
616
|
|
|
607
617
|
if (_isFunction(renderDragNode)) {
|
|
@@ -627,7 +637,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
627
637
|
return /*#__PURE__*/React.createElement("div", {
|
|
628
638
|
role: "tree",
|
|
629
639
|
id: id ? id + "-listbox" : undefined,
|
|
630
|
-
ref:
|
|
640
|
+
ref: treeViewRef,
|
|
631
641
|
className: classes,
|
|
632
642
|
style: styles,
|
|
633
643
|
onKeyDown: inline ? handleTreeKeyDown : undefined
|
|
@@ -7,7 +7,7 @@ export interface UploadFileItemProps extends WithAsProps {
|
|
|
7
7
|
listType: 'text' | 'picture-text' | 'picture';
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
className?: string;
|
|
10
|
-
maxPreviewFileSize
|
|
10
|
+
maxPreviewFileSize?: number;
|
|
11
11
|
classPrefix?: string;
|
|
12
12
|
removable?: boolean;
|
|
13
13
|
allowReupload?: boolean;
|
|
@@ -275,8 +275,8 @@ var UploadFileItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
275
275
|
UploadFileItem.displayName = 'UploadFileItem';
|
|
276
276
|
UploadFileItem.propTypes = {
|
|
277
277
|
locale: PropTypes.any,
|
|
278
|
-
file: PropTypes.object,
|
|
279
|
-
listType: PropTypes.oneOf(['text', 'picture-text', 'picture']),
|
|
278
|
+
file: PropTypes.object.isRequired,
|
|
279
|
+
listType: PropTypes.oneOf(['text', 'picture-text', 'picture']).isRequired,
|
|
280
280
|
disabled: PropTypes.bool,
|
|
281
281
|
className: PropTypes.string,
|
|
282
282
|
maxPreviewFileSize: PropTypes.number,
|
|
@@ -32,13 +32,13 @@ var UploadTrigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
32
32
|
onDrop = props.onDrop,
|
|
33
33
|
rest = _objectWithoutPropertiesLoose(props, ["as", "name", "accept", "multiple", "disabled", "readOnly", "children", "classPrefix", "className", "draggable", "locale", "onChange", "onDragEnter", "onDragLeave", "onDragOver", "onDrop"]);
|
|
34
34
|
|
|
35
|
-
var rootRef = useRef();
|
|
35
|
+
var rootRef = useRef(null);
|
|
36
36
|
|
|
37
37
|
var _useState = useState(false),
|
|
38
38
|
dragOver = _useState[0],
|
|
39
39
|
setDragOver = _useState[1];
|
|
40
40
|
|
|
41
|
-
var inputRef = useRef();
|
|
41
|
+
var inputRef = useRef(null);
|
|
42
42
|
|
|
43
43
|
var _useClassNames = useClassNames(classPrefix),
|
|
44
44
|
merge = _useClassNames.merge,
|
|
@@ -151,7 +151,6 @@ UploadTrigger.propTypes = {
|
|
|
151
151
|
classPrefix: PropTypes.string,
|
|
152
152
|
className: PropTypes.string,
|
|
153
153
|
children: PropTypes.node,
|
|
154
|
-
as: PropTypes.elementType,
|
|
155
154
|
draggable: PropTypes.bool,
|
|
156
155
|
onDragEnter: PropTypes.func,
|
|
157
156
|
onDragLeave: PropTypes.func,
|
|
@@ -21,7 +21,7 @@ export interface UploaderInstance {
|
|
|
21
21
|
}
|
|
22
22
|
export interface UploaderProps extends WithAsProps {
|
|
23
23
|
/** Uploading URL */
|
|
24
|
-
action
|
|
24
|
+
action: string;
|
|
25
25
|
/** File types that can be accepted. See input accept Attribute */
|
|
26
26
|
accept?: string;
|
|
27
27
|
/** Automatically upload files after selecting them */
|
|
@@ -62,7 +62,7 @@ export interface UploaderProps extends WithAsProps {
|
|
|
62
62
|
/** Max file size limit of the preview file */
|
|
63
63
|
maxPreviewFileSize?: number;
|
|
64
64
|
/** You can use a custom element for this component */
|
|
65
|
-
toggleAs?: React.ElementType
|
|
65
|
+
toggleAs?: React.ElementType;
|
|
66
66
|
/** Removable list file */
|
|
67
67
|
removable?: boolean;
|
|
68
68
|
/** File list can be rendered */
|
|
@@ -84,11 +84,11 @@ export interface UploaderProps extends WithAsProps {
|
|
|
84
84
|
/** In the file list, click the callback function for the uploaded file */
|
|
85
85
|
onPreview?: (file: FileType, event: React.SyntheticEvent) => void;
|
|
86
86
|
/** Upload callback function with erro */
|
|
87
|
-
onError?: (status: any, file: FileType, event:
|
|
87
|
+
onError?: (status: any, file: FileType, event: ProgressEvent, xhr: XMLHttpRequest) => void;
|
|
88
88
|
/** callback function after successful upload */
|
|
89
|
-
onSuccess?: (response: any, file: FileType, event:
|
|
89
|
+
onSuccess?: (response: any, file: FileType, event: ProgressEvent, xhr: XMLHttpRequest) => void;
|
|
90
90
|
/** Callback functions that upload progress change */
|
|
91
|
-
onProgress?: (percent: number, file: FileType, event:
|
|
91
|
+
onProgress?: (percent: number, file: FileType, event: ProgressEvent, xhr: XMLHttpRequest) => void;
|
|
92
92
|
/** In the file list, click the callback function to delete a file */
|
|
93
93
|
onRemove?: (file: FileType) => void;
|
|
94
94
|
/** Custom render file information */
|
package/esm/Uploader/Uploader.js
CHANGED
|
@@ -428,7 +428,7 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
428
428
|
});
|
|
429
429
|
Uploader.displayName = 'Uploader';
|
|
430
430
|
Uploader.propTypes = {
|
|
431
|
-
action: PropTypes.string,
|
|
431
|
+
action: PropTypes.string.isRequired,
|
|
432
432
|
accept: PropTypes.string,
|
|
433
433
|
autoUpload: PropTypes.bool,
|
|
434
434
|
children: PropTypes.node,
|
|
@@ -458,7 +458,6 @@ Uploader.propTypes = {
|
|
|
458
458
|
onRemove: PropTypes.func,
|
|
459
459
|
maxPreviewFileSize: PropTypes.number,
|
|
460
460
|
style: PropTypes.object,
|
|
461
|
-
toggleAs: PropTypes.elementType,
|
|
462
461
|
renderFileInfo: PropTypes.func,
|
|
463
462
|
renderThumbnail: PropTypes.func,
|
|
464
463
|
removable: PropTypes.bool,
|
package/esm/index.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export { default as Badge } from './Badge';
|
|
|
32
32
|
export type { BadgeProps } from './Badge';
|
|
33
33
|
export { default as Avatar } from './Avatar';
|
|
34
34
|
export type { AvatarProps } from './Avatar';
|
|
35
|
+
export { default as AvatarGroup } from './AvatarGroup';
|
|
36
|
+
export type { AvatarGroupProps } from './AvatarGroup';
|
|
35
37
|
export { default as toaster } from './toaster';
|
|
36
38
|
export type { Toaster } from './toaster';
|
|
37
39
|
export { default as Dropdown } from './Dropdown';
|
package/esm/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { default as Divider } from './Divider';
|
|
|
16
16
|
export { default as Placeholder } from './Placeholder';
|
|
17
17
|
export { default as Badge } from './Badge';
|
|
18
18
|
export { default as Avatar } from './Avatar';
|
|
19
|
+
export { default as AvatarGroup } from './AvatarGroup';
|
|
19
20
|
export { default as toaster } from './toaster';
|
|
20
21
|
// Nav
|
|
21
22
|
export { default as Dropdown } from './Dropdown';
|
package/esm/locales/index.d.ts
CHANGED
|
@@ -19,15 +19,15 @@ declare type PickKeys<T> = {
|
|
|
19
19
|
[keys in keyof T]?: T[keys];
|
|
20
20
|
};
|
|
21
21
|
export declare type Locale = PickKeys<typeof defaultLocale>;
|
|
22
|
-
export declare type CommonLocale =
|
|
22
|
+
export declare type CommonLocale = typeof defaultLocale.common;
|
|
23
23
|
export declare type CalendarLocale = PickKeys<typeof defaultLocale.Calendar>;
|
|
24
24
|
export declare type PlaintextLocale = PickKeys<typeof defaultLocale.Plaintext>;
|
|
25
25
|
export declare type PaginationLocale = PickKeys<typeof defaultLocale.Pagination>;
|
|
26
26
|
export declare type TableLocale = CommonLocale;
|
|
27
27
|
export declare type DatePickerLocale = PickKeys<typeof defaultLocale.DatePicker>;
|
|
28
28
|
export declare type DateRangePickerLocale = PickKeys<typeof defaultLocale.DateRangePicker>;
|
|
29
|
-
export declare type PickerLocale =
|
|
30
|
-
export declare type InputPickerLocale = PickerLocale &
|
|
29
|
+
export declare type PickerLocale = typeof defaultLocale.Picker & CommonLocale;
|
|
30
|
+
export declare type InputPickerLocale = PickerLocale & typeof defaultLocale.InputPicker;
|
|
31
31
|
export declare type UploaderLocale = PickKeys<typeof defaultLocale.Uploader>;
|
|
32
32
|
export declare type CloseButtonLocale = PickKeys<typeof defaultLocale.CloseButton>;
|
|
33
33
|
export declare type BreadcrumbLocale = PickKeys<typeof defaultLocale.Breadcrumb>;
|
|
@@ -18,7 +18,7 @@ export interface NodeProps extends WithAsProps {
|
|
|
18
18
|
onClose?: (event?: React.MouseEvent<HTMLDivElement>) => void;
|
|
19
19
|
}
|
|
20
20
|
interface ToastContainerComponent extends RsRefForwardingComponent<'div', ToastContainerProps> {
|
|
21
|
-
getInstance
|
|
21
|
+
getInstance: (props: ToastContainerProps) => [React.RefObject<ToastContainerInstance>, () => void];
|
|
22
22
|
}
|
|
23
23
|
declare const ToastContainer: ToastContainerComponent;
|
|
24
24
|
export default ToastContainer;
|
package/esm/toaster/toaster.js
CHANGED
|
@@ -40,7 +40,9 @@ toaster.push = function (message, options) {
|
|
|
40
40
|
var container = getContainer(options.placement);
|
|
41
41
|
|
|
42
42
|
if (!container) {
|
|
43
|
-
|
|
43
|
+
var _options$placement;
|
|
44
|
+
|
|
45
|
+
container = createContainer((_options$placement = options.placement) !== null && _options$placement !== void 0 ? _options$placement : '', options);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
return container.current.push(message);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare function find(children: React.ReactNode, func: any, context?: any): React.ReactNode;
|
|
3
|
-
export declare function map(children: React.ReactNode, func: any, context?: any): any[];
|
|
4
|
-
export declare function mapCloneElement(children: React.ReactNode, func: any, context?: any): any[];
|
|
3
|
+
export declare function map(children: React.ReactNode, func: any, context?: any): any[] | null | undefined;
|
|
4
|
+
export declare function mapCloneElement(children: React.ReactNode, func: any, context?: any): any[] | null | undefined;
|
|
5
5
|
export declare function count(children: React.ReactChildren): number;
|
|
6
6
|
declare function some(children: React.ReactNode, func: any, context?: any): boolean;
|
|
7
7
|
declare const _default: {
|
package/esm/utils/ajaxUpload.js
CHANGED
|
@@ -27,15 +27,16 @@ export default function ajaxUpload(options) {
|
|
|
27
27
|
withCredentials = options.withCredentials,
|
|
28
28
|
disableMultipart = options.disableMultipart;
|
|
29
29
|
var xhr = new XMLHttpRequest();
|
|
30
|
-
var sendableData
|
|
30
|
+
var sendableData;
|
|
31
31
|
xhr.open('POST', url, true);
|
|
32
32
|
|
|
33
33
|
if (!disableMultipart) {
|
|
34
34
|
sendableData = new FormData();
|
|
35
35
|
sendableData.append(name, file, file.name);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
for (var key in data) {
|
|
38
|
+
sendableData.append(key, data[key]);
|
|
39
|
+
}
|
|
39
40
|
} else {
|
|
40
41
|
sendableData = file;
|
|
41
42
|
}
|
|
@@ -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/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 {};
|