rsuite 5.74.2 → 5.76.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/CHANGELOG.md +25 -0
- package/Card/package.json +7 -0
- package/Card/styles/index.css +105 -0
- package/Card/styles/index.less +62 -0
- package/CardBody/package.json +7 -0
- package/CardFooter/package.json +7 -0
- package/CardGroup/package.json +7 -0
- package/CardGroup/styles/index.css +7 -0
- package/CardGroup/styles/index.less +8 -0
- package/CardHeader/package.json +7 -0
- package/Image/package.json +7 -0
- package/Image/styles/index.css +33 -0
- package/Image/styles/index.less +34 -0
- package/List/styles/index.css +10 -12
- package/List/styles/index.less +12 -4
- package/Stat/package.json +7 -0
- package/Stat/styles/index.css +1749 -0
- package/Stat/styles/index.less +106 -0
- package/StatGroup/package.json +7 -0
- package/StatGroup/styles/index.css +7 -0
- package/StatGroup/styles/index.less +8 -0
- package/StatHelpText/package.json +7 -0
- package/StatLabel/package.json +7 -0
- package/StatTrend/package.json +7 -0
- package/StatValue/package.json +7 -0
- package/StatValueUnit/package.json +7 -0
- package/cjs/Affix/Affix.js +2 -2
- package/cjs/Animation/Transition.js +7 -7
- package/cjs/AutoComplete/AutoComplete.js +7 -7
- package/cjs/Avatar/useImage.js +1 -1
- package/cjs/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/Calendar/Calendar.js +3 -3
- package/cjs/Calendar/CalendarContainer.js +1 -1
- package/cjs/Calendar/Grid/GridRow.js +3 -3
- package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/cjs/Calendar/TimeDropdown/TimeDropdown.js +3 -3
- package/cjs/Calendar/hooks/useCalendarState.js +6 -6
- package/cjs/Card/Card.d.ts +33 -0
- package/cjs/Card/Card.js +63 -0
- package/cjs/Card/CardBody.d.ts +4 -0
- package/cjs/Card/CardBody.js +11 -0
- package/cjs/Card/CardFooter.d.ts +4 -0
- package/cjs/Card/CardFooter.js +11 -0
- package/cjs/Card/CardHeader.d.ts +4 -0
- package/cjs/Card/CardHeader.js +11 -0
- package/cjs/Card/index.d.ts +6 -0
- package/cjs/Card/index.js +8 -0
- package/cjs/CardGroup/CardGroup.d.ts +13 -0
- package/cjs/CardGroup/CardGroup.js +47 -0
- package/cjs/CardGroup/index.d.ts +3 -0
- package/cjs/CardGroup/index.js +8 -0
- package/cjs/Carousel/Carousel.js +5 -4
- package/cjs/CascadeTree/CascadeTree.js +1 -1
- package/cjs/CascadeTree/TreeView.js +1 -1
- package/cjs/CascadeTree/hooks/useSearch.js +4 -4
- package/cjs/CascadeTree/hooks/useSelect.js +2 -2
- package/cjs/Cascader/Cascader.js +13 -13
- package/cjs/Cascader/useActive.js +4 -4
- package/cjs/CheckPicker/CheckPicker.js +5 -5
- package/cjs/CheckTree/CheckTree.js +1 -1
- package/cjs/CheckTree/CheckTreeNode.js +3 -3
- package/cjs/CheckTree/CheckTreeView.js +7 -7
- package/cjs/CheckTree/utils.js +3 -3
- package/cjs/CheckTreePicker/CheckTreePicker.js +2 -2
- package/cjs/CheckTreePicker/hooks/useFocusState.js +3 -3
- package/cjs/Checkbox/Checkbox.js +2 -2
- package/cjs/CheckboxGroup/CheckboxGroup.js +1 -1
- package/cjs/CustomProvider/FormattedNumber.d.ts +7 -0
- package/cjs/CustomProvider/FormattedNumber.js +19 -0
- package/cjs/CustomProvider/index.d.ts +1 -0
- package/cjs/CustomProvider/index.js +3 -1
- package/cjs/CustomProvider/types.d.ts +10 -0
- package/cjs/CustomProvider/useCustom.d.ts +1 -0
- package/cjs/CustomProvider/useCustom.js +3 -1
- package/cjs/DateInput/DateField.js +2 -2
- package/cjs/DateInput/DateInput.js +2 -2
- package/cjs/DateInput/hooks/useDateInputState.js +2 -2
- package/cjs/DateInput/hooks/useIsFocused.js +2 -2
- package/cjs/DateInput/hooks/useKeyboardInputEvent.js +5 -5
- package/cjs/DatePicker/DatePicker.js +14 -14
- package/cjs/DatePicker/PredefinedRanges.js +1 -1
- package/cjs/DatePicker/hooks/useFocus.js +1 -1
- package/cjs/DatePicker/hooks/useMonthView.js +1 -1
- package/cjs/DateRangeInput/DateRangeInput.js +4 -4
- package/cjs/DateRangePicker/DateRangePicker.js +8 -8
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/cjs/Dropdown/Dropdown.js +3 -3
- package/cjs/Dropdown/DropdownItem.js +2 -2
- package/cjs/Dropdown/DropdownMenu.js +1 -1
- package/cjs/Form/Form.js +8 -8
- package/cjs/Form/hooks/useFormValidate.js +19 -19
- package/cjs/FormControl/FormControl.js +5 -5
- package/cjs/FormControl/hooks/useField.js +1 -1
- package/cjs/FormControl/hooks/useRegisterModel.js +2 -2
- package/cjs/Image/Image.d.ts +42 -0
- package/cjs/Image/Image.js +102 -0
- package/cjs/Image/ImageWrapper.d.ts +1 -0
- package/cjs/Image/ImageWrapper.js +10 -0
- package/cjs/Image/hooks/useImage.d.ts +14 -0
- package/cjs/Image/hooks/useImage.js +68 -0
- package/cjs/Image/index.d.ts +3 -0
- package/cjs/Image/index.js +8 -0
- package/cjs/InlineEdit/renderChildren.js +1 -1
- package/cjs/InlineEdit/useEditState.js +7 -7
- package/cjs/InlineEdit/useFocusEvent.js +5 -5
- package/cjs/Input/Input.js +3 -3
- package/cjs/InputGroup/InputGroup.js +2 -2
- package/cjs/InputNumber/InputNumber.js +3 -3
- package/cjs/InputPicker/InputAutosize.js +1 -1
- package/cjs/InputPicker/InputPicker.js +13 -13
- package/cjs/InputPicker/InputSearch.js +1 -1
- package/cjs/InputPicker/hooks/useData.js +1 -1
- package/cjs/InputPicker/hooks/useInput.js +2 -2
- package/cjs/List/List.d.ts +19 -1
- package/cjs/List/List.js +11 -7
- package/cjs/List/ListItem.d.ts +1 -1
- package/cjs/List/helper/useSortHelper.js +10 -10
- package/cjs/MaskedInput/TextMask.js +3 -3
- package/cjs/Message/Message.js +1 -1
- package/cjs/Modal/Modal.js +6 -6
- package/cjs/Modal/utils.js +2 -2
- package/cjs/MultiCascadeTree/SearchView.js +1 -1
- package/cjs/MultiCascadeTree/TreeView.js +1 -1
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.js +5 -5
- package/cjs/MultiCascadeTree/hooks/useSearch.js +1 -1
- package/cjs/MultiCascadeTree/hooks/useSelect.js +1 -1
- package/cjs/MultiCascadeTree/utils.js +9 -9
- package/cjs/MultiCascader/MultiCascader.js +5 -5
- package/cjs/Nav/Nav.js +2 -2
- package/cjs/Nav/NavDropdown.js +3 -3
- package/cjs/Nav/NavDropdownItem.js +2 -2
- package/cjs/Nav/NavDropdownMenu.js +1 -1
- package/cjs/Nav/NavItem.js +3 -3
- package/cjs/Navbar/NavbarDropdown.js +3 -3
- package/cjs/Navbar/NavbarDropdownItem.js +4 -4
- package/cjs/Navbar/NavbarItem.js +3 -3
- package/cjs/Notification/Notification.js +1 -1
- package/cjs/Pagination/PaginationButton.js +1 -1
- package/cjs/Pagination/PaginationGroup.js +3 -3
- package/cjs/Panel/Panel.js +2 -2
- package/cjs/PanelGroup/PanelGroup.js +1 -1
- package/cjs/Placeholder/PlaceholderGrid.js +2 -2
- package/cjs/Placeholder/PlaceholderParagraph.js +1 -1
- package/cjs/Radio/Radio.js +2 -2
- package/cjs/RadioGroup/RadioGroup.js +1 -1
- package/cjs/RadioTile/RadioTile.js +2 -2
- package/cjs/RadioTileGroup/RadioTileGroup.js +1 -1
- package/cjs/RangeSlider/RangeSlider.js +5 -5
- package/cjs/Rate/Character.js +2 -2
- package/cjs/Rate/Rate.js +3 -3
- package/cjs/SafeAnchor/SafeAnchor.js +1 -1
- package/cjs/SelectPicker/SelectPicker.js +7 -7
- package/cjs/Sidebar/Sidebar.js +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdown.js +4 -4
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +3 -3
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +2 -2
- package/cjs/Sidenav/Sidenav.js +1 -1
- package/cjs/Sidenav/SidenavDropdown.js +4 -4
- package/cjs/Sidenav/SidenavDropdownItem.js +2 -2
- package/cjs/Sidenav/SidenavDropdownMenu.js +1 -1
- package/cjs/Sidenav/SidenavItem.js +4 -4
- package/cjs/Sidenav/SidenavToggle.js +1 -1
- package/cjs/Slider/Graduated.js +1 -1
- package/cjs/Slider/Slider.js +3 -3
- package/cjs/Slider/useDrag.js +6 -6
- package/cjs/Stack/HStack.d.ts +6 -3
- package/cjs/Stack/HStack.js +1 -0
- package/cjs/Stack/Stack.d.ts +6 -2
- package/cjs/Stack/Stack.js +1 -1
- package/cjs/Stack/VStack.d.ts +6 -3
- package/cjs/Stack/VStack.js +1 -0
- package/cjs/Stat/Stat.d.ts +26 -0
- package/cjs/Stat/Stat.js +57 -0
- package/cjs/Stat/StatHelpText.d.ts +4 -0
- package/cjs/Stat/StatHelpText.js +11 -0
- package/cjs/Stat/StatLabel.d.ts +14 -0
- package/cjs/Stat/StatLabel.js +53 -0
- package/cjs/Stat/StatTrend.d.ts +7 -0
- package/cjs/Stat/StatTrend.js +68 -0
- package/cjs/Stat/StatValue.d.ts +7 -0
- package/cjs/Stat/StatValue.js +41 -0
- package/cjs/Stat/StatValueUnit.d.ts +4 -0
- package/cjs/Stat/StatValueUnit.js +11 -0
- package/cjs/Stat/index.d.ts +3 -0
- package/cjs/Stat/index.js +8 -0
- package/cjs/StatGroup/StatGroup.d.ts +13 -0
- package/cjs/StatGroup/StatGroup.js +47 -0
- package/cjs/StatGroup/index.d.ts +3 -0
- package/cjs/StatGroup/index.js +8 -0
- package/cjs/Tabs/Tabs.js +1 -1
- package/cjs/Timeline/Timeline.js +1 -1
- package/cjs/Toggle/Toggle.js +1 -1
- package/cjs/Tree/Tree.js +1 -1
- package/cjs/Tree/TreeNode.js +9 -9
- package/cjs/Tree/TreeView.js +7 -7
- package/cjs/Tree/hooks/useExpandTree.js +1 -1
- package/cjs/Tree/hooks/useFlattenTree.js +1 -1
- package/cjs/Tree/hooks/useFocusTree.js +6 -6
- package/cjs/Tree/hooks/useTreeDrag.js +17 -17
- package/cjs/Tree/hooks/useTreeSearch.js +1 -1
- package/cjs/Tree/utils/flattenTree.js +6 -6
- package/cjs/Tree/utils/focusableTree.js +6 -6
- package/cjs/Tree/utils/getNodeParentKeys.js +4 -4
- package/cjs/Tree/utils/treeKeyboardInteractions.js +2 -2
- package/cjs/TreePicker/TreePicker.js +5 -5
- package/cjs/TreePicker/hooks/useFocusState.js +4 -4
- package/cjs/Uploader/UploadFileItem.js +5 -5
- package/cjs/Uploader/UploadTrigger.js +11 -11
- package/cjs/Uploader/Uploader.js +16 -16
- package/cjs/Uploader/utils/ajaxUpload.js +5 -5
- package/cjs/index.d.ts +10 -0
- package/cjs/index.js +12 -2
- package/cjs/internals/Disclosure/Disclosure.js +3 -3
- package/cjs/internals/Disclosure/DisclosureButton.js +2 -2
- package/cjs/internals/Menu/Menu.js +3 -3
- package/cjs/internals/Menu/MenuItem.js +1 -1
- package/cjs/internals/Menu/Menubar.js +2 -2
- package/cjs/internals/Overlay/Modal.js +7 -7
- package/cjs/internals/Overlay/Overlay.js +1 -1
- package/cjs/internals/Overlay/OverlayTrigger.js +3 -3
- package/cjs/internals/Overlay/Position.js +5 -5
- package/cjs/internals/Picker/ListCheckItem.js +3 -3
- package/cjs/internals/Picker/ListItem.js +1 -1
- package/cjs/internals/Picker/Listbox.js +4 -4
- package/cjs/internals/Picker/PickerToggle.js +2 -2
- package/cjs/internals/Picker/SelectedElement.js +1 -1
- package/cjs/internals/Picker/hooks/useFocusItemValue.js +2 -2
- package/cjs/internals/Picker/hooks/usePickerRef.js +4 -4
- package/cjs/internals/Picker/hooks/useSearch.js +1 -1
- package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.js +9 -9
- package/cjs/internals/Picker/utils.js +8 -8
- package/cjs/internals/Ripple/Ripple.js +2 -2
- package/cjs/internals/ScrollView/hooks/useScrollState.js +1 -1
- package/cjs/internals/Tree/utils/filterNodesOfTree.js +3 -3
- package/cjs/internals/Tree/utils/findNodeOfTree.js +3 -3
- package/cjs/internals/Tree/utils/getParentMap.js +3 -3
- package/cjs/internals/Windowing/AutoSizer.js +1 -1
- package/cjs/internals/Windowing/List.js +4 -4
- package/cjs/internals/hooks/useClickOutside.js +1 -1
- package/cjs/internals/hooks/useElementResize.js +1 -1
- package/cjs/internals/hooks/useEventListener.js +1 -1
- package/cjs/internals/hooks/useFocus.js +2 -2
- package/cjs/internals/hooks/useMount.js +1 -1
- package/cjs/internals/hooks/useRootClose.js +4 -4
- package/cjs/internals/hooks/useTimeout.js +1 -1
- package/cjs/internals/utils/getDOMNode.js +2 -1
- package/cjs/internals/utils/stringifyReactNode.js +5 -5
- package/cjs/toaster/ToastContainer.d.ts +1 -0
- package/cjs/toaster/ToastContainer.js +19 -14
- package/cjs/toaster/hooks/useDelayedClosure.js +2 -2
- package/cjs/toaster/toaster.js +7 -7
- package/cjs/useToaster/useToaster.js +1 -1
- package/dist/rsuite-no-reset-rtl.css +274 -36
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +274 -36
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +274 -36
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +274 -36
- package/dist/rsuite.js +427 -174
- 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/Affix/Affix.js +2 -2
- package/esm/Animation/Transition.js +7 -7
- package/esm/AutoComplete/AutoComplete.js +7 -7
- package/esm/Avatar/useImage.js +1 -1
- package/esm/Breadcrumb/Breadcrumb.js +1 -1
- package/esm/Calendar/Calendar.js +3 -3
- package/esm/Calendar/CalendarContainer.js +1 -1
- package/esm/Calendar/Grid/GridRow.js +3 -3
- package/esm/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/esm/Calendar/TimeDropdown/TimeDropdown.js +3 -3
- package/esm/Calendar/hooks/useCalendarState.js +6 -6
- package/esm/Card/Card.d.ts +33 -0
- package/esm/Card/Card.js +58 -0
- package/esm/Card/CardBody.d.ts +4 -0
- package/esm/Card/CardBody.js +7 -0
- package/esm/Card/CardFooter.d.ts +4 -0
- package/esm/Card/CardFooter.js +7 -0
- package/esm/Card/CardHeader.d.ts +4 -0
- package/esm/Card/CardHeader.js +7 -0
- package/esm/Card/index.d.ts +6 -0
- package/esm/Card/index.js +3 -0
- package/esm/CardGroup/CardGroup.d.ts +13 -0
- package/esm/CardGroup/CardGroup.js +42 -0
- package/esm/CardGroup/index.d.ts +3 -0
- package/esm/CardGroup/index.js +3 -0
- package/esm/Carousel/Carousel.js +5 -4
- package/esm/CascadeTree/CascadeTree.js +1 -1
- package/esm/CascadeTree/TreeView.js +1 -1
- package/esm/CascadeTree/hooks/useSearch.js +4 -4
- package/esm/CascadeTree/hooks/useSelect.js +2 -2
- package/esm/Cascader/Cascader.js +13 -13
- package/esm/Cascader/useActive.js +4 -4
- package/esm/CheckPicker/CheckPicker.js +5 -5
- package/esm/CheckTree/CheckTree.js +1 -1
- package/esm/CheckTree/CheckTreeNode.js +3 -3
- package/esm/CheckTree/CheckTreeView.js +7 -7
- package/esm/CheckTree/utils.js +3 -3
- package/esm/CheckTreePicker/CheckTreePicker.js +2 -2
- package/esm/CheckTreePicker/hooks/useFocusState.js +3 -3
- package/esm/Checkbox/Checkbox.js +2 -2
- package/esm/CheckboxGroup/CheckboxGroup.js +1 -1
- package/esm/CustomProvider/FormattedNumber.d.ts +7 -0
- package/esm/CustomProvider/FormattedNumber.js +13 -0
- package/esm/CustomProvider/index.d.ts +1 -0
- package/esm/CustomProvider/index.js +1 -0
- package/esm/CustomProvider/types.d.ts +10 -0
- package/esm/CustomProvider/useCustom.d.ts +1 -0
- package/esm/CustomProvider/useCustom.js +3 -1
- package/esm/DateInput/DateField.js +2 -2
- package/esm/DateInput/DateInput.js +2 -2
- package/esm/DateInput/hooks/useDateInputState.js +2 -2
- package/esm/DateInput/hooks/useIsFocused.js +2 -2
- package/esm/DateInput/hooks/useKeyboardInputEvent.js +5 -5
- package/esm/DatePicker/DatePicker.js +14 -14
- package/esm/DatePicker/PredefinedRanges.js +1 -1
- package/esm/DatePicker/hooks/useFocus.js +1 -1
- package/esm/DatePicker/hooks/useMonthView.js +1 -1
- package/esm/DateRangeInput/DateRangeInput.js +4 -4
- package/esm/DateRangePicker/DateRangePicker.js +8 -8
- package/esm/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/esm/Dropdown/Dropdown.js +3 -3
- package/esm/Dropdown/DropdownItem.js +2 -2
- package/esm/Dropdown/DropdownMenu.js +1 -1
- package/esm/Form/Form.js +8 -8
- package/esm/Form/hooks/useFormValidate.js +19 -19
- package/esm/FormControl/FormControl.js +5 -5
- package/esm/FormControl/hooks/useField.js +1 -1
- package/esm/FormControl/hooks/useRegisterModel.js +2 -2
- package/esm/Image/Image.d.ts +42 -0
- package/esm/Image/Image.js +97 -0
- package/esm/Image/ImageWrapper.d.ts +1 -0
- package/esm/Image/ImageWrapper.js +6 -0
- package/esm/Image/hooks/useImage.d.ts +14 -0
- package/esm/Image/hooks/useImage.js +63 -0
- package/esm/Image/index.d.ts +3 -0
- package/esm/Image/index.js +3 -0
- package/esm/InlineEdit/renderChildren.js +1 -1
- package/esm/InlineEdit/useEditState.js +7 -7
- package/esm/InlineEdit/useFocusEvent.js +5 -5
- package/esm/Input/Input.js +3 -3
- package/esm/InputGroup/InputGroup.js +2 -2
- package/esm/InputNumber/InputNumber.js +3 -3
- package/esm/InputPicker/InputAutosize.js +1 -1
- package/esm/InputPicker/InputPicker.js +13 -13
- package/esm/InputPicker/InputSearch.js +1 -1
- package/esm/InputPicker/hooks/useData.js +1 -1
- package/esm/InputPicker/hooks/useInput.js +2 -2
- package/esm/List/List.d.ts +19 -1
- package/esm/List/List.js +11 -7
- package/esm/List/ListItem.d.ts +1 -1
- package/esm/List/helper/useSortHelper.js +10 -10
- package/esm/MaskedInput/TextMask.js +3 -3
- package/esm/Message/Message.js +1 -1
- package/esm/Modal/Modal.js +6 -6
- package/esm/Modal/utils.js +2 -2
- package/esm/MultiCascadeTree/SearchView.js +1 -1
- package/esm/MultiCascadeTree/TreeView.js +1 -1
- package/esm/MultiCascadeTree/hooks/useCascadeValue.js +5 -5
- package/esm/MultiCascadeTree/hooks/useSearch.js +1 -1
- package/esm/MultiCascadeTree/hooks/useSelect.js +1 -1
- package/esm/MultiCascadeTree/utils.js +13 -10
- package/esm/MultiCascader/MultiCascader.js +5 -5
- package/esm/Nav/Nav.js +2 -2
- package/esm/Nav/NavDropdown.js +3 -3
- package/esm/Nav/NavDropdownItem.js +2 -2
- package/esm/Nav/NavDropdownMenu.js +1 -1
- package/esm/Nav/NavItem.js +3 -3
- package/esm/Navbar/NavbarDropdown.js +3 -3
- package/esm/Navbar/NavbarDropdownItem.js +4 -4
- package/esm/Navbar/NavbarItem.js +3 -3
- package/esm/Notification/Notification.js +1 -1
- package/esm/Pagination/PaginationButton.js +1 -1
- package/esm/Pagination/PaginationGroup.js +3 -3
- package/esm/Panel/Panel.js +2 -2
- package/esm/PanelGroup/PanelGroup.js +1 -1
- package/esm/Placeholder/PlaceholderGrid.js +2 -2
- package/esm/Placeholder/PlaceholderParagraph.js +1 -1
- package/esm/Radio/Radio.js +2 -2
- package/esm/RadioGroup/RadioGroup.js +1 -1
- package/esm/RadioTile/RadioTile.js +2 -2
- package/esm/RadioTileGroup/RadioTileGroup.js +1 -1
- package/esm/RangeSlider/RangeSlider.js +5 -5
- package/esm/Rate/Character.js +2 -2
- package/esm/Rate/Rate.js +3 -3
- package/esm/SafeAnchor/SafeAnchor.js +1 -1
- package/esm/SelectPicker/SelectPicker.js +7 -7
- package/esm/Sidebar/Sidebar.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdown.js +4 -4
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +3 -3
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +2 -2
- package/esm/Sidenav/Sidenav.js +1 -1
- package/esm/Sidenav/SidenavDropdown.js +4 -4
- package/esm/Sidenav/SidenavDropdownItem.js +2 -2
- package/esm/Sidenav/SidenavDropdownMenu.js +1 -1
- package/esm/Sidenav/SidenavItem.js +4 -4
- package/esm/Sidenav/SidenavToggle.js +1 -1
- package/esm/Slider/Graduated.js +1 -1
- package/esm/Slider/Slider.js +3 -3
- package/esm/Slider/useDrag.js +6 -6
- package/esm/Stack/HStack.d.ts +6 -3
- package/esm/Stack/HStack.js +1 -0
- package/esm/Stack/Stack.d.ts +6 -2
- package/esm/Stack/Stack.js +1 -1
- package/esm/Stack/VStack.d.ts +6 -3
- package/esm/Stack/VStack.js +1 -0
- package/esm/Stat/Stat.d.ts +26 -0
- package/esm/Stat/Stat.js +52 -0
- package/esm/Stat/StatHelpText.d.ts +4 -0
- package/esm/Stat/StatHelpText.js +7 -0
- package/esm/Stat/StatLabel.d.ts +14 -0
- package/esm/Stat/StatLabel.js +48 -0
- package/esm/Stat/StatTrend.d.ts +7 -0
- package/esm/Stat/StatTrend.js +63 -0
- package/esm/Stat/StatValue.d.ts +7 -0
- package/esm/Stat/StatValue.js +36 -0
- package/esm/Stat/StatValueUnit.d.ts +4 -0
- package/esm/Stat/StatValueUnit.js +7 -0
- package/esm/Stat/index.d.ts +3 -0
- package/esm/Stat/index.js +3 -0
- package/esm/StatGroup/StatGroup.d.ts +13 -0
- package/esm/StatGroup/StatGroup.js +42 -0
- package/esm/StatGroup/index.d.ts +3 -0
- package/esm/StatGroup/index.js +3 -0
- package/esm/Tabs/Tabs.js +1 -1
- package/esm/Timeline/Timeline.js +1 -1
- package/esm/Toggle/Toggle.js +1 -1
- package/esm/Tree/Tree.js +1 -1
- package/esm/Tree/TreeNode.js +9 -9
- package/esm/Tree/TreeView.js +7 -7
- package/esm/Tree/hooks/useExpandTree.js +1 -1
- package/esm/Tree/hooks/useFlattenTree.js +1 -1
- package/esm/Tree/hooks/useFocusTree.js +6 -6
- package/esm/Tree/hooks/useTreeDrag.js +17 -17
- package/esm/Tree/hooks/useTreeSearch.js +1 -1
- package/esm/Tree/utils/flattenTree.js +6 -6
- package/esm/Tree/utils/focusableTree.js +6 -6
- package/esm/Tree/utils/getNodeParentKeys.js +4 -4
- package/esm/Tree/utils/treeKeyboardInteractions.js +2 -2
- package/esm/TreePicker/TreePicker.js +5 -5
- package/esm/TreePicker/hooks/useFocusState.js +4 -4
- package/esm/Uploader/UploadFileItem.js +5 -5
- package/esm/Uploader/UploadTrigger.js +11 -11
- package/esm/Uploader/Uploader.js +16 -16
- package/esm/Uploader/utils/ajaxUpload.js +5 -5
- package/esm/index.d.ts +10 -0
- package/esm/index.js +5 -0
- package/esm/internals/Disclosure/Disclosure.js +3 -3
- package/esm/internals/Disclosure/DisclosureButton.js +2 -2
- package/esm/internals/Menu/Menu.js +3 -3
- package/esm/internals/Menu/MenuItem.js +1 -1
- package/esm/internals/Menu/Menubar.js +2 -2
- package/esm/internals/Overlay/Modal.js +7 -7
- package/esm/internals/Overlay/Overlay.js +1 -1
- package/esm/internals/Overlay/OverlayTrigger.js +3 -3
- package/esm/internals/Overlay/Position.js +5 -5
- package/esm/internals/Picker/ListCheckItem.js +3 -3
- package/esm/internals/Picker/ListItem.js +1 -1
- package/esm/internals/Picker/Listbox.js +4 -4
- package/esm/internals/Picker/PickerToggle.js +2 -2
- package/esm/internals/Picker/SelectedElement.js +1 -1
- package/esm/internals/Picker/hooks/useFocusItemValue.js +2 -2
- package/esm/internals/Picker/hooks/usePickerRef.js +4 -4
- package/esm/internals/Picker/hooks/useSearch.js +1 -1
- package/esm/internals/Picker/hooks/useToggleKeyDownEvent.js +9 -9
- package/esm/internals/Picker/utils.js +8 -8
- package/esm/internals/Ripple/Ripple.js +2 -2
- package/esm/internals/ScrollView/hooks/useScrollState.js +1 -1
- package/esm/internals/Tree/utils/filterNodesOfTree.js +3 -3
- package/esm/internals/Tree/utils/findNodeOfTree.js +3 -3
- package/esm/internals/Tree/utils/getParentMap.js +3 -3
- package/esm/internals/Windowing/AutoSizer.js +1 -1
- package/esm/internals/Windowing/List.js +4 -4
- package/esm/internals/hooks/useClickOutside.js +1 -1
- package/esm/internals/hooks/useElementResize.js +1 -1
- package/esm/internals/hooks/useEventListener.js +1 -1
- package/esm/internals/hooks/useFocus.js +2 -2
- package/esm/internals/hooks/useMount.js +1 -1
- package/esm/internals/hooks/useRootClose.js +4 -4
- package/esm/internals/hooks/useTimeout.js +1 -1
- package/esm/internals/utils/getDOMNode.js +2 -1
- package/esm/internals/utils/stringifyReactNode.js +5 -5
- package/esm/toaster/ToastContainer.d.ts +1 -0
- package/esm/toaster/ToastContainer.js +19 -14
- package/esm/toaster/hooks/useDelayedClosure.js +2 -2
- package/esm/toaster/toaster.js +7 -7
- package/esm/useToaster/useToaster.js +1 -1
- package/package.json +1 -1
- package/styles/color-modes/dark.less +6 -0
- package/styles/color-modes/high-contrast.less +6 -0
- package/styles/color-modes/light.less +6 -0
- package/styles/index.less +5 -0
- package/toaster/styles/index.css +24 -24
- package/toaster/styles/index.less +29 -29
- package/useToaster/styles/index.css +24 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ImageWrapper: import("../internals/types").RsRefForwardingComponent<"div", import("../internals/utils").ComponentProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface UseImageProps {
|
|
2
|
+
src?: string;
|
|
3
|
+
fallbackSrc?: string;
|
|
4
|
+
crossOrigin?: string;
|
|
5
|
+
srcSet?: string;
|
|
6
|
+
sizes?: string;
|
|
7
|
+
loading?: 'lazy' | 'eager';
|
|
8
|
+
}
|
|
9
|
+
export declare const useImage: (props: UseImageProps) => {
|
|
10
|
+
imgSrc: string | null;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
error: boolean;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
|
+
import useIsomorphicLayoutEffect from "../../internals/hooks/useIsomorphicLayoutEffect.js";
|
|
4
|
+
export var useImage = function useImage(props) {
|
|
5
|
+
var src = props.src,
|
|
6
|
+
fallbackSrc = props.fallbackSrc,
|
|
7
|
+
crossOrigin = props.crossOrigin,
|
|
8
|
+
srcSet = props.srcSet,
|
|
9
|
+
sizes = props.sizes,
|
|
10
|
+
loading = props.loading;
|
|
11
|
+
var _useState = useState(src || fallbackSrc || null),
|
|
12
|
+
imgSrc = _useState[0],
|
|
13
|
+
setImgSrc = _useState[1];
|
|
14
|
+
var _useState2 = useState(!!src),
|
|
15
|
+
isLoading = _useState2[0],
|
|
16
|
+
setIsLoading = _useState2[1];
|
|
17
|
+
var _useState3 = useState(false),
|
|
18
|
+
error = _useState3[0],
|
|
19
|
+
setError = _useState3[1];
|
|
20
|
+
var imageRef = useRef(null);
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
setIsLoading(!!src); // true if src exists, false otherwise
|
|
23
|
+
}, [src]);
|
|
24
|
+
var flush = function flush() {
|
|
25
|
+
if (imageRef.current) {
|
|
26
|
+
imageRef.current.onload = null;
|
|
27
|
+
imageRef.current.onerror = null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var loadImage = useCallback(function () {
|
|
31
|
+
if (!src) return;
|
|
32
|
+
flush();
|
|
33
|
+
var image = new Image();
|
|
34
|
+
image.src = src;
|
|
35
|
+
if (crossOrigin) image.crossOrigin = crossOrigin;
|
|
36
|
+
if (srcSet) image.srcset = srcSet;
|
|
37
|
+
if (sizes) image.sizes = sizes;
|
|
38
|
+
if (loading) image.loading = loading;
|
|
39
|
+
image.onload = function () {
|
|
40
|
+
flush();
|
|
41
|
+
setImgSrc(src);
|
|
42
|
+
setIsLoading(false);
|
|
43
|
+
};
|
|
44
|
+
image.onerror = function () {
|
|
45
|
+
flush();
|
|
46
|
+
setError(true);
|
|
47
|
+
setImgSrc(fallbackSrc || null);
|
|
48
|
+
setIsLoading(false);
|
|
49
|
+
};
|
|
50
|
+
imageRef.current = image;
|
|
51
|
+
}, [crossOrigin, fallbackSrc, loading, sizes, src, srcSet]);
|
|
52
|
+
useIsomorphicLayoutEffect(function () {
|
|
53
|
+
loadImage();
|
|
54
|
+
return function () {
|
|
55
|
+
flush();
|
|
56
|
+
};
|
|
57
|
+
}, [loadImage]);
|
|
58
|
+
return {
|
|
59
|
+
imgSrc: imgSrc,
|
|
60
|
+
isLoading: isLoading,
|
|
61
|
+
error: error
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -16,7 +16,7 @@ function getDisplayName(Component) {
|
|
|
16
16
|
if (typeof (Component === null || Component === void 0 ? void 0 : Component.type) === 'string') {
|
|
17
17
|
return Component === null || Component === void 0 ? void 0 : Component.type;
|
|
18
18
|
}
|
|
19
|
-
return (Component === null || Component === void 0
|
|
19
|
+
return (Component === null || Component === void 0 || (_Component$type = Component.type) === null || _Component$type === void 0 ? void 0 : _Component$type.displayName) || '';
|
|
20
20
|
}
|
|
21
21
|
export function renderChildren(children, props, ref) {
|
|
22
22
|
if (typeof children === 'function') {
|
|
@@ -28,27 +28,27 @@ var useEditState = function useEditState(props) {
|
|
|
28
28
|
if (disabled) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
onClick === null || onClick === void 0
|
|
32
|
-
onEdit === null || onEdit === void 0
|
|
31
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
32
|
+
onEdit === null || onEdit === void 0 || onEdit(event);
|
|
33
33
|
setIsEditing(true);
|
|
34
34
|
setResetValue(value);
|
|
35
35
|
});
|
|
36
36
|
var handleChange = useEventCallback(function (value, event) {
|
|
37
37
|
setValue(value);
|
|
38
|
-
onChange === null || onChange === void 0
|
|
38
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
39
39
|
});
|
|
40
40
|
var handleCancel = useEventCallback(function (event) {
|
|
41
41
|
var _event$stopPropagatio;
|
|
42
42
|
setIsEditing(false);
|
|
43
43
|
setValue(resetValue);
|
|
44
|
-
onCancel === null || onCancel === void 0
|
|
45
|
-
event === null || event === void 0
|
|
44
|
+
onCancel === null || onCancel === void 0 || onCancel(event);
|
|
45
|
+
event === null || event === void 0 || (_event$stopPropagatio = event.stopPropagation) === null || _event$stopPropagatio === void 0 || _event$stopPropagatio.call(event);
|
|
46
46
|
});
|
|
47
47
|
var handleSave = useEventCallback(function (event) {
|
|
48
48
|
var _event$stopPropagatio2;
|
|
49
49
|
setIsEditing(false);
|
|
50
|
-
onSave === null || onSave === void 0
|
|
51
|
-
event === null || event === void 0
|
|
50
|
+
onSave === null || onSave === void 0 || onSave(event);
|
|
51
|
+
event === null || event === void 0 || (_event$stopPropagatio2 = event.stopPropagation) === null || _event$stopPropagatio2 === void 0 || _event$stopPropagatio2.call(event);
|
|
52
52
|
});
|
|
53
53
|
var handleKeyDown = useEventCallback(function (event) {
|
|
54
54
|
var _event$target;
|
|
@@ -18,14 +18,14 @@ var useFocusEvent = function useFocusEvent(_ref) {
|
|
|
18
18
|
var _picker$target, _picker$target$focus, _picker$open;
|
|
19
19
|
var picker = ref.current;
|
|
20
20
|
// Auto focus the search input
|
|
21
|
-
picker === null || picker === void 0
|
|
21
|
+
picker === null || picker === void 0 || (_picker$target = picker.target) === null || _picker$target === void 0 || (_picker$target$focus = _picker$target.focus) === null || _picker$target$focus === void 0 || _picker$target$focus.call(_picker$target);
|
|
22
22
|
|
|
23
23
|
// Open the picker
|
|
24
|
-
picker === null || picker === void 0
|
|
24
|
+
picker === null || picker === void 0 || (_picker$open = picker.open) === null || _picker$open === void 0 || _picker$open.call(picker);
|
|
25
25
|
}, 100);
|
|
26
26
|
} else {
|
|
27
27
|
var _ref$current2, _ref$current2$focus;
|
|
28
|
-
(_ref$current2 = ref.current) === null || _ref$current2 === void 0
|
|
28
|
+
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 || (_ref$current2$focus = _ref$current2.focus) === null || _ref$current2$focus === void 0 || _ref$current2$focus.call(_ref$current2);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
var handleBlur = useEventCallback(function (event) {
|
|
@@ -37,9 +37,9 @@ var useFocusEvent = function useFocusEvent(_ref) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
if (stateOnBlur === 'save') {
|
|
40
|
-
onSave === null || onSave === void 0
|
|
40
|
+
onSave === null || onSave === void 0 || onSave(event);
|
|
41
41
|
} else if (stateOnBlur === 'cancel') {
|
|
42
|
-
onCancel === null || onCancel === void 0
|
|
42
|
+
onCancel === null || onCancel === void 0 || onCancel(event);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
useIsomorphicLayoutEffect(function () {
|
package/esm/Input/Input.js
CHANGED
|
@@ -45,13 +45,13 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
45
45
|
rest = _objectWithoutPropertiesLoose(propsWithDefaults, _excluded);
|
|
46
46
|
var handleKeyDown = function handleKeyDown(event) {
|
|
47
47
|
if (event.key === KEY_VALUES.ENTER) {
|
|
48
|
-
onPressEnter === null || onPressEnter === void 0
|
|
48
|
+
onPressEnter === null || onPressEnter === void 0 || onPressEnter(event);
|
|
49
49
|
}
|
|
50
|
-
onKeyDown === null || onKeyDown === void 0
|
|
50
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
51
51
|
};
|
|
52
52
|
var handleChange = function handleChange(event) {
|
|
53
53
|
var _event$target;
|
|
54
|
-
onChange === null || onChange === void 0
|
|
54
|
+
onChange === null || onChange === void 0 || onChange((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, event);
|
|
55
55
|
};
|
|
56
56
|
var _useClassNames = useClassNames(classPrefix),
|
|
57
57
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
@@ -46,8 +46,8 @@ var InputGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
46
46
|
}));
|
|
47
47
|
var renderChildren = useCallback(function () {
|
|
48
48
|
return React.Children.map(children, function (item) {
|
|
49
|
-
if (
|
|
50
|
-
if (
|
|
49
|
+
if (/*#__PURE__*/React.isValidElement(item)) {
|
|
50
|
+
if (/*#__PURE__*/React.isValidElement(item)) {
|
|
51
51
|
// Fix: Add type assertion to pass the disabled prop to the child element
|
|
52
52
|
return disabled ? /*#__PURE__*/React.cloneElement(item, {
|
|
53
53
|
disabled: disabled
|
|
@@ -140,7 +140,7 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
140
140
|
var handleChangeValue = useEventCallback(function (currentValue, event) {
|
|
141
141
|
if (currentValue !== value) {
|
|
142
142
|
setValue(currentValue);
|
|
143
|
-
onChange === null || onChange === void 0
|
|
143
|
+
onChange === null || onChange === void 0 || onChange(currentValue, event);
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
|
|
@@ -202,7 +202,7 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
202
202
|
handleStepUp(event);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
onWheel === null || onWheel === void 0
|
|
205
|
+
onWheel === null || onWheel === void 0 || onWheel(event);
|
|
206
206
|
});
|
|
207
207
|
var handleChange = useEventCallback(function (value, event) {
|
|
208
208
|
var separator = decimalSeparator || '.';
|
|
@@ -241,7 +241,7 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
241
241
|
}
|
|
242
242
|
return function () {
|
|
243
243
|
var _wheelListener;
|
|
244
|
-
(_wheelListener = wheelListener) === null || _wheelListener === void 0
|
|
244
|
+
(_wheelListener = wheelListener) === null || _wheelListener === void 0 || _wheelListener.off();
|
|
245
245
|
};
|
|
246
246
|
}, [handleWheel, scrollable]);
|
|
247
247
|
var inputValue = useMemo(function () {
|
|
@@ -51,7 +51,7 @@ var useInputWidth = function useInputWidth(props, sizerRef, placeholderRef) {
|
|
|
51
51
|
}
|
|
52
52
|
if (width !== inputWidth) {
|
|
53
53
|
setInputWidth(width);
|
|
54
|
-
onAutosize === null || onAutosize === void 0
|
|
54
|
+
onAutosize === null || onAutosize === void 0 || onAutosize(width);
|
|
55
55
|
}
|
|
56
56
|
}, [minWidth, placeholder, inputWidth, value, placeholderRef, sizerRef, onAutosize]);
|
|
57
57
|
return inputWidth;
|
|
@@ -138,7 +138,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
138
138
|
blur = _useInput.blur;
|
|
139
139
|
var handleDataChange = function handleDataChange(data) {
|
|
140
140
|
var _data$;
|
|
141
|
-
setFocusItemValue(data === null || data === void 0
|
|
141
|
+
setFocusItemValue(data === null || data === void 0 || (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$[valueKey]);
|
|
142
142
|
};
|
|
143
143
|
var _useData = useData({
|
|
144
144
|
controlledData: controlledData,
|
|
@@ -158,10 +158,10 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
158
158
|
};
|
|
159
159
|
var handleClose = useEventCallback(function () {
|
|
160
160
|
var _triggerRef$current, _target$current, _target$current$focus;
|
|
161
|
-
triggerRef === null || triggerRef === void 0
|
|
161
|
+
triggerRef === null || triggerRef === void 0 || (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 || _triggerRef$current.close();
|
|
162
162
|
|
|
163
163
|
// The focus is on the trigger button after closing
|
|
164
|
-
(_target$current = target.current) === null || _target$current === void 0
|
|
164
|
+
(_target$current = target.current) === null || _target$current === void 0 || (_target$current$focus = _target$current.focus) === null || _target$current$focus === void 0 || _target$current$focus.call(_target$current);
|
|
165
165
|
});
|
|
166
166
|
var focusItemValueOptions = {
|
|
167
167
|
data: dataWithCache,
|
|
@@ -180,7 +180,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
180
180
|
if (!disabledOptions) {
|
|
181
181
|
var _filteredData$;
|
|
182
182
|
// The first option after filtering is the focus.
|
|
183
|
-
var firstItemValue = filteredData === null || filteredData === void 0
|
|
183
|
+
var firstItemValue = filteredData === null || filteredData === void 0 || (_filteredData$ = filteredData[0]) === null || _filteredData$ === void 0 ? void 0 : _filteredData$[valueKey];
|
|
184
184
|
|
|
185
185
|
// If there is no value in the option and new options are supported, the search keyword is the first option
|
|
186
186
|
if (!firstItemValue && creatable) {
|
|
@@ -188,7 +188,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
188
188
|
}
|
|
189
189
|
setFocusItemValue(firstItemValue);
|
|
190
190
|
}
|
|
191
|
-
onSearch === null || onSearch === void 0
|
|
191
|
+
onSearch === null || onSearch === void 0 || onSearch(searchKeyword, event);
|
|
192
192
|
});
|
|
193
193
|
var searchOptions = {
|
|
194
194
|
labelKey: labelKey,
|
|
@@ -206,7 +206,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
206
206
|
// Update the position of the menu when the search keyword and value change
|
|
207
207
|
useEffect(function () {
|
|
208
208
|
var _triggerRef$current2, _triggerRef$current2$;
|
|
209
|
-
(_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0
|
|
209
|
+
(_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 || (_triggerRef$current2$ = _triggerRef$current2.updatePosition) === null || _triggerRef$current2$ === void 0 || _triggerRef$current2$.call(_triggerRef$current2);
|
|
210
210
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
211
|
}, [searchKeyword, value]);
|
|
212
212
|
var getDataItem = function getDataItem(value) {
|
|
@@ -240,7 +240,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
240
240
|
return option;
|
|
241
241
|
};
|
|
242
242
|
var handleChange = useEventCallback(function (value, event) {
|
|
243
|
-
onChange === null || onChange === void 0
|
|
243
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
244
244
|
});
|
|
245
245
|
var handleRemoveItemByTag = useEventCallback(function (tag, event) {
|
|
246
246
|
event.stopPropagation();
|
|
@@ -250,13 +250,13 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
250
250
|
});
|
|
251
251
|
setValue(val);
|
|
252
252
|
handleChange(val, event);
|
|
253
|
-
onTagRemove === null || onTagRemove === void 0
|
|
253
|
+
onTagRemove === null || onTagRemove === void 0 || onTagRemove(tag, event);
|
|
254
254
|
});
|
|
255
255
|
var handleSelect = useEventCallback(function (value, item, event) {
|
|
256
|
-
onSelect === null || onSelect === void 0
|
|
256
|
+
onSelect === null || onSelect === void 0 || onSelect(value, item, event);
|
|
257
257
|
if (creatable && item.create) {
|
|
258
258
|
delete item.create;
|
|
259
|
-
onCreate === null || onCreate === void 0
|
|
259
|
+
onCreate === null || onCreate === void 0 || onCreate(value, item, event);
|
|
260
260
|
setNewData(newData.concat(item));
|
|
261
261
|
}
|
|
262
262
|
});
|
|
@@ -401,7 +401,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
401
401
|
} else {
|
|
402
402
|
handleChange(null, event);
|
|
403
403
|
}
|
|
404
|
-
onClean === null || onClean === void 0
|
|
404
|
+
onClean === null || onClean === void 0 || onClean(event);
|
|
405
405
|
});
|
|
406
406
|
var events = {
|
|
407
407
|
onMenuPressBackspace: multi ? removeLastItem : handleClean,
|
|
@@ -445,9 +445,9 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
445
445
|
if (!readOnly) {
|
|
446
446
|
var _triggerRef$current3;
|
|
447
447
|
setOpen(true);
|
|
448
|
-
(_triggerRef$current3 = triggerRef.current) === null || _triggerRef$current3 === void 0
|
|
448
|
+
(_triggerRef$current3 = triggerRef.current) === null || _triggerRef$current3 === void 0 || _triggerRef$current3.open();
|
|
449
449
|
}
|
|
450
|
-
onFocus === null || onFocus === void 0
|
|
450
|
+
onFocus === null || onFocus === void 0 || onFocus(event);
|
|
451
451
|
});
|
|
452
452
|
var handleEnter = useEventCallback(function () {
|
|
453
453
|
focus();
|
|
@@ -21,7 +21,7 @@ var InputSearch = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
21
21
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
22
22
|
var handleChange = useEventCallback(function (event) {
|
|
23
23
|
var _event$target;
|
|
24
|
-
onChange === null || onChange === void 0
|
|
24
|
+
onChange === null || onChange === void 0 || onChange(event === null || event === void 0 || (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value, event);
|
|
25
25
|
});
|
|
26
26
|
var _useClassNames = useClassNames(classPrefix),
|
|
27
27
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
@@ -25,7 +25,7 @@ function useData(props) {
|
|
|
25
25
|
if (controlledData && !shallowEqual(controlledData, uncontrolledData)) {
|
|
26
26
|
setData(controlledData);
|
|
27
27
|
setNewData([]);
|
|
28
|
-
onChange === null || onChange === void 0
|
|
28
|
+
onChange === null || onChange === void 0 || onChange(controlledData);
|
|
29
29
|
}
|
|
30
30
|
}, [controlledData, uncontrolledData, onChange]);
|
|
31
31
|
return {
|
|
@@ -14,11 +14,11 @@ function useInput(props) {
|
|
|
14
14
|
}, [multi]);
|
|
15
15
|
var focus = useCallback(function () {
|
|
16
16
|
var _getInput;
|
|
17
|
-
(_getInput = getInput()) === null || _getInput === void 0
|
|
17
|
+
(_getInput = getInput()) === null || _getInput === void 0 || _getInput.focus();
|
|
18
18
|
}, [getInput]);
|
|
19
19
|
var blur = useCallback(function () {
|
|
20
20
|
var _getInput2;
|
|
21
|
-
(_getInput2 = getInput()) === null || _getInput2 === void 0
|
|
21
|
+
(_getInput2 = getInput()) === null || _getInput2 === void 0 || _getInput2.blur();
|
|
22
22
|
}, [getInput]);
|
|
23
23
|
var inputProps = useMemo(function () {
|
|
24
24
|
return multi ? {
|
package/esm/List/List.d.ts
CHANGED
|
@@ -2,10 +2,28 @@ import { SortConfig } from './helper/useSortHelper';
|
|
|
2
2
|
import ListItem from './ListItem';
|
|
3
3
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
4
4
|
export interface ListProps extends WithAsProps, SortConfig {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Size of list item.
|
|
7
|
+
*/
|
|
8
|
+
size?: 'lg' | 'md' | 'sm' | 'xs';
|
|
9
|
+
/**
|
|
10
|
+
* Whether the list is bordered.
|
|
11
|
+
*/
|
|
6
12
|
bordered?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the list is hoverable.
|
|
15
|
+
*/
|
|
7
16
|
hover?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the list is sortable.
|
|
19
|
+
*/
|
|
8
20
|
sortable?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to display a divider between items.
|
|
23
|
+
*
|
|
24
|
+
* @version 5.75.0
|
|
25
|
+
*/
|
|
26
|
+
divider?: boolean;
|
|
9
27
|
}
|
|
10
28
|
export interface ListComponent extends RsRefForwardingComponent<'div', ListProps> {
|
|
11
29
|
Item: typeof ListItem;
|
package/esm/List/List.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["as", "classPrefix", "className", "
|
|
4
|
+
var _excluded = ["as", "autoScroll", "bordered", "classPrefix", "className", "children", "divider", "hover", "size", "sortable", "pressDelay", "transitionDuration", "onSort", "onSortEnd", "onSortMove", "onSortStart"];
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import React, { useMemo } from 'react';
|
|
7
7
|
import useSortHelper from "./helper/useSortHelper.js";
|
|
@@ -20,21 +20,23 @@ var List = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
20
20
|
propsWithDefaults = _useCustom.propsWithDefaults;
|
|
21
21
|
var _propsWithDefaults$as = propsWithDefaults.as,
|
|
22
22
|
Component = _propsWithDefaults$as === void 0 ? 'div' : _propsWithDefaults$as,
|
|
23
|
+
_propsWithDefaults$au = propsWithDefaults.autoScroll,
|
|
24
|
+
autoScroll = _propsWithDefaults$au === void 0 ? true : _propsWithDefaults$au,
|
|
25
|
+
bordered = propsWithDefaults.bordered,
|
|
23
26
|
_propsWithDefaults$cl = propsWithDefaults.classPrefix,
|
|
24
27
|
classPrefix = _propsWithDefaults$cl === void 0 ? 'list' : _propsWithDefaults$cl,
|
|
25
28
|
className = propsWithDefaults.className,
|
|
26
|
-
|
|
29
|
+
children = propsWithDefaults.children,
|
|
30
|
+
_propsWithDefaults$di = propsWithDefaults.divider,
|
|
31
|
+
divider = _propsWithDefaults$di === void 0 ? true : _propsWithDefaults$di,
|
|
27
32
|
hover = propsWithDefaults.hover,
|
|
28
33
|
_propsWithDefaults$si = propsWithDefaults.size,
|
|
29
34
|
size = _propsWithDefaults$si === void 0 ? 'md' : _propsWithDefaults$si,
|
|
30
35
|
sortable = propsWithDefaults.sortable,
|
|
31
|
-
_propsWithDefaults$au = propsWithDefaults.autoScroll,
|
|
32
|
-
autoScroll = _propsWithDefaults$au === void 0 ? true : _propsWithDefaults$au,
|
|
33
36
|
_propsWithDefaults$pr = propsWithDefaults.pressDelay,
|
|
34
37
|
pressDelay = _propsWithDefaults$pr === void 0 ? 0 : _propsWithDefaults$pr,
|
|
35
38
|
_propsWithDefaults$tr = propsWithDefaults.transitionDuration,
|
|
36
39
|
transitionDuration = _propsWithDefaults$tr === void 0 ? 300 : _propsWithDefaults$tr,
|
|
37
|
-
children = propsWithDefaults.children,
|
|
38
40
|
onSort = propsWithDefaults.onSort,
|
|
39
41
|
onSortEnd = propsWithDefaults.onSortEnd,
|
|
40
42
|
onSortMove = propsWithDefaults.onSortMove,
|
|
@@ -61,7 +63,8 @@ var List = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
61
63
|
bordered: bordered,
|
|
62
64
|
sortable: sortable,
|
|
63
65
|
sorting: sorting,
|
|
64
|
-
hover: hover
|
|
66
|
+
hover: hover,
|
|
67
|
+
divider: divider
|
|
65
68
|
}));
|
|
66
69
|
var contextValue = useMemo(function () {
|
|
67
70
|
return {
|
|
@@ -87,9 +90,10 @@ List.propTypes = {
|
|
|
87
90
|
className: PropTypes.string,
|
|
88
91
|
classPrefix: PropTypes.string,
|
|
89
92
|
bordered: PropTypes.bool,
|
|
93
|
+
divider: PropTypes.bool,
|
|
90
94
|
hover: PropTypes.bool,
|
|
91
95
|
sortable: PropTypes.bool,
|
|
92
|
-
size: oneOf(['lg', 'md', 'sm']),
|
|
96
|
+
size: oneOf(['lg', 'md', 'sm', 'xs']),
|
|
93
97
|
autoScroll: PropTypes.bool,
|
|
94
98
|
pressDelay: PropTypes.number,
|
|
95
99
|
transitionDuration: PropTypes.number,
|
package/esm/List/ListItem.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface ListItemProps extends WithAsProps, React.HTMLAttributes<HTMLEle
|
|
|
5
5
|
index?: number;
|
|
6
6
|
collection?: Collection;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
size?: 'lg' | 'md' | 'sm';
|
|
8
|
+
size?: 'lg' | 'md' | 'sm' | 'xs';
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* The `List.Item` component is used to specify the layout of the list item.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
function _createForOfIteratorHelperLoose(
|
|
3
|
-
function _unsupportedIterableToArray(
|
|
4
|
-
function _arrayLikeToArray(
|
|
2
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
5
|
import on from 'dom-lib/on';
|
|
6
6
|
import { useCallback, useRef, useState } from 'react';
|
|
7
7
|
import AutoScroller from "./AutoScroller.js";
|
|
@@ -60,7 +60,7 @@ var useSortHelper = function useSortHelper(config) {
|
|
|
60
60
|
var activeNodeOffsetEdge = getEdgeOffset(activeNode, containerElement);
|
|
61
61
|
var activeNodeStyle = getComputedStyle(activeNode);
|
|
62
62
|
var activeNodeHelper = activeNode.cloneNode(true);
|
|
63
|
-
(_activeNodeHelper = activeNodeHelper) === null || _activeNodeHelper === void 0
|
|
63
|
+
(_activeNodeHelper = activeNodeHelper) === null || _activeNodeHelper === void 0 || _activeNodeHelper.classList.add(helperElementClass);
|
|
64
64
|
setInlineStyles(activeNodeHelper, {
|
|
65
65
|
position: 'fixed',
|
|
66
66
|
width: activeNodeBoundingClientRect.width + "px",
|
|
@@ -192,7 +192,7 @@ var useSortHelper = function useSortHelper(config) {
|
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
onSortMove === null || onSortMove === void 0
|
|
195
|
+
onSortMove === null || onSortMove === void 0 || onSortMove({
|
|
196
196
|
collection: curManagedItem.info.collection,
|
|
197
197
|
node: activeNode,
|
|
198
198
|
oldIndex: activeNodeOldIndex,
|
|
@@ -217,10 +217,10 @@ var useSortHelper = function useSortHelper(config) {
|
|
|
217
217
|
|
|
218
218
|
// wait for animation
|
|
219
219
|
setTimeout(function () {
|
|
220
|
-
var _activeNodeHelper2
|
|
220
|
+
var _activeNodeHelper2;
|
|
221
221
|
if (!isMounted()) return;
|
|
222
222
|
// Remove the helper from the DOM
|
|
223
|
-
(_activeNodeHelper2 = activeNodeHelper) === null || _activeNodeHelper2 === void 0
|
|
223
|
+
(_activeNodeHelper2 = activeNodeHelper) === null || _activeNodeHelper2 === void 0 || (_activeNodeHelper2 = _activeNodeHelper2.parentNode) === null || _activeNodeHelper2 === void 0 || _activeNodeHelper2.removeChild(activeNodeHelper);
|
|
224
224
|
activeNodeHelper = null;
|
|
225
225
|
|
|
226
226
|
// Remove redundant styles
|
|
@@ -251,15 +251,15 @@ var useSortHelper = function useSortHelper(config) {
|
|
|
251
251
|
newIndex: activeNodeNextIndex,
|
|
252
252
|
oldIndex: activeNodeOldIndex
|
|
253
253
|
};
|
|
254
|
-
onSortEnd === null || onSortEnd === void 0
|
|
255
|
-
onSort === null || onSort === void 0
|
|
254
|
+
onSortEnd === null || onSortEnd === void 0 || onSortEnd(callbackPayload, event);
|
|
255
|
+
onSort === null || onSort === void 0 || onSort(callbackPayload, event);
|
|
256
256
|
}, transitionDuration);
|
|
257
257
|
}, {
|
|
258
258
|
passive: false
|
|
259
259
|
});
|
|
260
260
|
setSorting(true);
|
|
261
261
|
// start callback
|
|
262
|
-
onSortStart === null || onSortStart === void 0
|
|
262
|
+
onSortStart === null || onSortStart === void 0 || onSortStart({
|
|
263
263
|
collection: curManagedItem.info.collection,
|
|
264
264
|
node: activeNode,
|
|
265
265
|
oldIndex: activeNodeOldIndex,
|
|
@@ -41,12 +41,12 @@ var TextMask = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
41
41
|
textMaskInputElement.current = createTextMaskInputElement(_extends({
|
|
42
42
|
inputElement: inputRef.current
|
|
43
43
|
}, props));
|
|
44
|
-
(_textMaskInputElement = textMaskInputElement.current) === null || _textMaskInputElement === void 0
|
|
44
|
+
(_textMaskInputElement = textMaskInputElement.current) === null || _textMaskInputElement === void 0 || _textMaskInputElement.update(value);
|
|
45
45
|
}, [props, value]);
|
|
46
46
|
var handleChange = useCallback(function (event) {
|
|
47
47
|
var _textMaskInputElement2;
|
|
48
|
-
(_textMaskInputElement2 = textMaskInputElement.current) === null || _textMaskInputElement2 === void 0
|
|
49
|
-
onChange === null || onChange === void 0
|
|
48
|
+
(_textMaskInputElement2 = textMaskInputElement.current) === null || _textMaskInputElement2 === void 0 || _textMaskInputElement2.update();
|
|
49
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
50
50
|
}, [onChange]);
|
|
51
51
|
useEffect(function () {
|
|
52
52
|
initTextMask();
|
package/esm/Message/Message.js
CHANGED
|
@@ -59,7 +59,7 @@ var Message = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
59
59
|
clear = _useDelayedClosure.clear;
|
|
60
60
|
var handleClose = useEventCallback(function (event) {
|
|
61
61
|
setDisplay('hiding');
|
|
62
|
-
onClose === null || onClose === void 0
|
|
62
|
+
onClose === null || onClose === void 0 || onClose(event);
|
|
63
63
|
clear();
|
|
64
64
|
setTimeout(function () {
|
|
65
65
|
if (isMounted()) {
|
package/esm/Modal/Modal.js
CHANGED
|
@@ -106,17 +106,17 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
106
106
|
}, [dialogId, onClose, closeButton, isDrawer, bodyStyles]);
|
|
107
107
|
var handleExited = useCallback(function (node) {
|
|
108
108
|
var _transitionEndListene;
|
|
109
|
-
onExited === null || onExited === void 0
|
|
109
|
+
onExited === null || onExited === void 0 || onExited(node);
|
|
110
110
|
onDestroyEvents();
|
|
111
|
-
(_transitionEndListene = transitionEndListener.current) === null || _transitionEndListene === void 0
|
|
111
|
+
(_transitionEndListene = transitionEndListener.current) === null || _transitionEndListene === void 0 || _transitionEndListene.off();
|
|
112
112
|
transitionEndListener.current = null;
|
|
113
113
|
}, [onDestroyEvents, onExited]);
|
|
114
114
|
var handleEntered = useCallback(function (node) {
|
|
115
|
-
onEntered === null || onEntered === void 0
|
|
115
|
+
onEntered === null || onEntered === void 0 || onEntered(node);
|
|
116
116
|
onChangeBodyStyles();
|
|
117
117
|
}, [onChangeBodyStyles, onEntered]);
|
|
118
118
|
var handleEntering = useCallback(function (node) {
|
|
119
|
-
onEntering === null || onEntering === void 0
|
|
119
|
+
onEntering === null || onEntering === void 0 || onEntering(node);
|
|
120
120
|
onChangeBodyStyles(true);
|
|
121
121
|
}, [onChangeBodyStyles, onEntering]);
|
|
122
122
|
var backdropClick = React.useRef();
|
|
@@ -151,11 +151,11 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
151
151
|
}
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
onClose === null || onClose === void 0
|
|
154
|
+
onClose === null || onClose === void 0 || onClose(event);
|
|
155
155
|
}, [backdrop, onClose]);
|
|
156
156
|
useWillUnmount(function () {
|
|
157
157
|
var _transitionEndListene2;
|
|
158
|
-
(_transitionEndListene2 = transitionEndListener.current) === null || _transitionEndListene2 === void 0
|
|
158
|
+
(_transitionEndListene2 = transitionEndListener.current) === null || _transitionEndListene2 === void 0 || _transitionEndListene2.off();
|
|
159
159
|
});
|
|
160
160
|
var sizeKey = 'width';
|
|
161
161
|
if (isDrawer) {
|
package/esm/Modal/utils.js
CHANGED
|
@@ -40,8 +40,8 @@ export var useBodyStyles = function useBodyStyles(ref, options) {
|
|
|
40
40
|
}, [prefix, ref]);
|
|
41
41
|
var onDestroyEvents = useCallback(function () {
|
|
42
42
|
var _windowResizeListener, _windowResizeListener2, _contentElementResize;
|
|
43
|
-
(_windowResizeListener = windowResizeListener.current) === null || _windowResizeListener === void 0
|
|
44
|
-
(_contentElementResize = contentElementResizeObserver.current) === null || _contentElementResize === void 0
|
|
43
|
+
(_windowResizeListener = windowResizeListener.current) === null || _windowResizeListener === void 0 || (_windowResizeListener2 = _windowResizeListener.off) === null || _windowResizeListener2 === void 0 || _windowResizeListener2.call(_windowResizeListener);
|
|
44
|
+
(_contentElementResize = contentElementResizeObserver.current) === null || _contentElementResize === void 0 || _contentElementResize.disconnect();
|
|
45
45
|
windowResizeListener.current = null;
|
|
46
46
|
contentElementResizeObserver.current = null;
|
|
47
47
|
}, []);
|
|
@@ -68,7 +68,7 @@ function SearchView(props) {
|
|
|
68
68
|
childrenKey: childrenKey
|
|
69
69
|
});
|
|
70
70
|
var handleChange = function handleChange(_value, checked, event) {
|
|
71
|
-
onCheck === null || onCheck === void 0
|
|
71
|
+
onCheck === null || onCheck === void 0 || onCheck(item, event, checked);
|
|
72
72
|
};
|
|
73
73
|
return /*#__PURE__*/React.createElement("div", {
|
|
74
74
|
role: "treeitem",
|