rsuite 5.72.0 → 5.73.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/Calendar/styles/index.css +28 -31
- package/Calendar/styles/index.less +21 -27
- package/CheckPicker/styles/index.css +0 -1
- package/CheckTree/styles/index.css +0 -1
- package/CheckTree/styles/index.less +0 -1
- package/CheckTreePicker/styles/index.css +0 -1
- package/Checkbox/styles/mixin.less +1 -1
- package/DatePicker/styles/index.css +28 -34
- package/DatePicker/styles/index.less +0 -4
- package/DateRangePicker/styles/index.css +28 -37
- package/DateRangePicker/styles/index.less +0 -4
- package/InputPicker/styles/index.css +0 -1
- package/Pagination/styles/index.css +0 -1
- package/RadioTile/styles/index.css +69 -0
- package/RadioTile/styles/index.less +3 -1
- package/Rate/styles/index.less +1 -1
- package/SelectPicker/styles/index.css +0 -1
- package/Slider/styles/index.less +1 -1
- package/TagInput/styles/index.css +0 -4
- package/TagPicker/styles/index.css +0 -4
- package/TagPicker/styles/index.less +0 -2
- package/TimePicker/styles/index.css +28 -34
- package/TimeRangePicker/styles/index.css +28 -37
- package/Tree/styles/index.css +0 -3
- package/Tree/styles/index.less +0 -6
- package/TreePicker/styles/index.css +0 -3
- package/cjs/Calendar/CalendarHeader.js +4 -4
- package/cjs/Calendar/{MonthDropdown.d.ts → MonthDropdown/MonthDropdown.d.ts} +1 -2
- package/cjs/Calendar/{MonthDropdown.js → MonthDropdown/MonthDropdown.js} +14 -20
- package/{esm/Calendar → cjs/Calendar/MonthDropdown}/MonthDropdownItem.d.ts +1 -1
- package/cjs/Calendar/{MonthDropdownItem.js → MonthDropdown/MonthDropdownItem.js} +6 -6
- package/cjs/Calendar/MonthDropdown/index.d.ts +2 -0
- package/cjs/Calendar/MonthDropdown/index.js +8 -0
- package/cjs/Calendar/hooks/useCalendarState.d.ts +1 -1
- package/cjs/Calendar/hooks/useCalendarState.js +15 -8
- package/cjs/Calendar/utils/index.d.ts +1 -0
- package/cjs/Calendar/utils/index.js +4 -2
- package/cjs/Calendar/utils/isEveryDateInMonth.d.ts +1 -0
- package/cjs/Calendar/utils/isEveryDateInMonth.js +15 -0
- package/cjs/CascadeTree/TreeView.js +3 -3
- package/cjs/CustomProvider/CustomProvider.d.ts +31 -13
- package/cjs/CustomProvider/CustomProvider.js +20 -6
- package/cjs/DatePicker/DatePicker.js +12 -12
- package/cjs/DateRangePicker/DateRangePicker.js +1 -1
- package/cjs/Drawer/Drawer.js +6 -15
- package/cjs/Dropdown/Dropdown.d.ts +1 -1
- package/cjs/Dropdown/DropdownItem.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.js +3 -3
- package/cjs/Dropdown/DropdownToggle.d.ts +1 -1
- package/cjs/FormControl/hooks/useField.js +3 -0
- package/cjs/FormHelpText/FormHelpText.js +2 -2
- package/cjs/IconButton/IconButton.d.ts +1 -1
- package/cjs/Modal/Modal.d.ts +4 -0
- package/cjs/Modal/Modal.js +12 -13
- package/cjs/Modal/ModalBody.js +6 -5
- package/cjs/Modal/ModalContext.d.ts +4 -0
- package/cjs/Modal/ModalHeader.js +4 -4
- package/cjs/MultiCascadeTree/TreeView.js +3 -3
- package/cjs/Nav/NavDropdownItem.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.js +3 -3
- package/cjs/Nav/NavItem.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownItem.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownMenu.js +3 -3
- package/cjs/Navbar/NavbarItem.d.ts +1 -1
- package/cjs/Pagination/Pagination.js +5 -5
- package/cjs/Panel/AccordionButton.js +2 -2
- package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.d.ts +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdownItem.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdownMenu.d.ts +1 -1
- package/cjs/Sidenav/SidenavItem.d.ts +1 -1
- package/cjs/Sidenav/SidenavToggle.js +3 -3
- package/cjs/Steps/StepItem.d.ts +1 -1
- package/cjs/internals/Picker/ListItemGroup.js +1 -1
- package/cjs/internals/Picker/PickerIndicator.js +2 -2
- package/cjs/internals/Picker/PickerToggle.d.ts +1 -1
- package/cjs/internals/SearchBox/SearchBox.js +1 -1
- package/cjs/internals/constants/statusIcons.js +7 -7
- package/cjs/internals/hooks/useFocusVirtualListItem.d.ts +5 -2
- package/cjs/internals/hooks/useFocusVirtualListItem.js +23 -7
- package/cjs/internals/hooks/useToggleCaret.d.ts +1 -1
- package/cjs/locales/hu_HU.d.ts +2 -0
- package/cjs/locales/hu_HU.js +3 -1
- package/dist/rsuite-no-reset-rtl.css +28 -46
- 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 +28 -46
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +28 -46
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +28 -46
- package/dist/rsuite.js +450 -5234
- 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/Calendar/CalendarContainer.js +1 -1
- package/esm/Calendar/CalendarHeader.js +4 -4
- package/esm/Calendar/{MonthDropdown.d.ts → MonthDropdown/MonthDropdown.d.ts} +1 -2
- package/esm/Calendar/{MonthDropdown.js → MonthDropdown/MonthDropdown.js} +13 -18
- package/{cjs/Calendar → esm/Calendar/MonthDropdown}/MonthDropdownItem.d.ts +1 -1
- package/esm/Calendar/{MonthDropdownItem.js → MonthDropdown/MonthDropdownItem.js} +6 -6
- package/esm/Calendar/MonthDropdown/index.d.ts +2 -0
- package/esm/Calendar/MonthDropdown/index.js +3 -0
- package/esm/Calendar/hooks/useCalendarState.d.ts +1 -1
- package/esm/Calendar/hooks/useCalendarState.js +16 -9
- package/esm/Calendar/utils/index.d.ts +1 -0
- package/esm/Calendar/utils/index.js +2 -1
- package/esm/Calendar/utils/isEveryDateInMonth.d.ts +1 -0
- package/esm/Calendar/utils/isEveryDateInMonth.js +11 -0
- package/esm/CascadeTree/TreeView.js +3 -3
- package/esm/CustomProvider/CustomProvider.d.ts +31 -13
- package/esm/CustomProvider/CustomProvider.js +20 -6
- package/esm/DatePicker/DatePicker.js +3 -3
- package/esm/DateRangePicker/DateRangePicker.js +2 -2
- package/esm/Drawer/Drawer.js +6 -13
- package/esm/Dropdown/Dropdown.d.ts +1 -1
- package/esm/Dropdown/DropdownItem.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.js +3 -3
- package/esm/Dropdown/DropdownToggle.d.ts +1 -1
- package/esm/FormControl/hooks/useField.js +4 -1
- package/esm/FormHelpText/FormHelpText.js +2 -2
- package/esm/IconButton/IconButton.d.ts +1 -1
- package/esm/Modal/Modal.d.ts +4 -0
- package/esm/Modal/Modal.js +13 -14
- package/esm/Modal/ModalBody.js +6 -5
- package/esm/Modal/ModalContext.d.ts +4 -0
- package/esm/Modal/ModalHeader.js +4 -4
- package/esm/MultiCascadeTree/TreeView.js +3 -3
- package/esm/Nav/NavDropdownItem.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.js +3 -3
- package/esm/Nav/NavItem.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownItem.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownMenu.js +3 -3
- package/esm/Navbar/NavbarItem.d.ts +1 -1
- package/esm/Pagination/Pagination.js +10 -10
- package/esm/Panel/AccordionButton.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdownItem.d.ts +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdownItem.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdownMenu.d.ts +1 -1
- package/esm/Sidenav/SidenavItem.d.ts +1 -1
- package/esm/Sidenav/SidenavToggle.js +3 -3
- package/esm/Steps/StepItem.d.ts +1 -1
- package/esm/internals/Picker/ListItemGroup.js +2 -2
- package/esm/internals/Picker/PickerIndicator.js +1 -1
- package/esm/internals/Picker/PickerToggle.d.ts +1 -1
- package/esm/internals/SearchBox/SearchBox.js +2 -2
- package/esm/internals/constants/statusIcons.js +7 -7
- package/esm/internals/hooks/useFocusVirtualListItem.d.ts +5 -2
- package/esm/internals/hooks/useFocusVirtualListItem.js +23 -7
- package/esm/internals/hooks/useToggleCaret.d.ts +1 -1
- package/esm/locales/hu_HU.d.ts +2 -0
- package/esm/locales/hu_HU.js +3 -1
- package/internals/Picker/styles/mixin.less +0 -1
- package/package.json +2 -2
- package/styles/variables.less +1 -1
- package/cjs/Drawer/DrawerContext.d.ts +0 -9
- package/cjs/Drawer/DrawerContext.js +0 -9
- package/esm/Drawer/DrawerContext.d.ts +0 -9
- package/esm/Drawer/DrawerContext.js +0 -4
package/esm/Modal/Modal.js
CHANGED
|
@@ -3,9 +3,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTemplateLiteralLoose";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3;
|
|
6
|
-
var _excluded = ["animation", "animationProps", "animationTimeout", "aria-labelledby", "aria-describedby", "backdropClassName", "backdrop", "className", "children", "classPrefix", "dialogClassName", "dialogStyle", "dialogAs", "enforceFocus", "full", "overflow", "open", "onClose", "onEntered", "onEntering", "onExited", "role", "size", "id"],
|
|
6
|
+
var _excluded = ["animation", "animationProps", "animationTimeout", "aria-labelledby", "aria-describedby", "backdropClassName", "backdrop", "className", "children", "classPrefix", "dialogClassName", "dialogStyle", "dialogAs", "enforceFocus", "full", "overflow", "open", "onClose", "onEntered", "onEntering", "onExited", "role", "size", "id", "isDrawer", "closeButton"],
|
|
7
7
|
_excluded2 = ["className"];
|
|
8
|
-
import React, { useRef, useMemo, useState, useCallback
|
|
8
|
+
import React, { useRef, useMemo, useState, useCallback } from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import pick from 'lodash/pick';
|
|
11
11
|
import on from 'dom-lib/on';
|
|
@@ -22,7 +22,6 @@ import ModalTitle from "./ModalTitle.js";
|
|
|
22
22
|
import ModalFooter from "./ModalFooter.js";
|
|
23
23
|
import { useBodyStyles } from "./utils.js";
|
|
24
24
|
import { deprecatePropType, oneOf } from "../internals/propTypes/index.js";
|
|
25
|
-
import DrawerContext from "../Drawer/DrawerContext.js";
|
|
26
25
|
var modalSizes = ['xs', 'sm', 'md', 'lg', 'full'];
|
|
27
26
|
/**
|
|
28
27
|
* The `Modal` component is used to show content in a layer above the app.
|
|
@@ -62,6 +61,9 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
62
61
|
_props$size = props.size,
|
|
63
62
|
size = _props$size === void 0 ? 'sm' : _props$size,
|
|
64
63
|
idProp = props.id,
|
|
64
|
+
_props$isDrawer = props.isDrawer,
|
|
65
|
+
isDrawer = _props$isDrawer === void 0 ? false : _props$isDrawer,
|
|
66
|
+
closeButton = props.closeButton,
|
|
65
67
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
66
68
|
var inClass = {
|
|
67
69
|
in: open && !animation
|
|
@@ -78,11 +80,6 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
78
80
|
var dialogRef = useRef(null);
|
|
79
81
|
var transitionEndListener = useRef();
|
|
80
82
|
|
|
81
|
-
// Render Modal as Drawer
|
|
82
|
-
var _ref = useContext(DrawerContext) || {},
|
|
83
|
-
_ref$isDrawer = _ref.isDrawer,
|
|
84
|
-
isDrawer = _ref$isDrawer === void 0 ? false : _ref$isDrawer;
|
|
85
|
-
|
|
86
83
|
// The style of the Modal body will be updated with the size of the window or container.
|
|
87
84
|
var _useBodyStyles = useBodyStyles(dialogRef, {
|
|
88
85
|
overflow: overflow,
|
|
@@ -99,9 +96,11 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
99
96
|
onModalClose: onClose,
|
|
100
97
|
getBodyStyles: function getBodyStyles() {
|
|
101
98
|
return bodyStyles;
|
|
102
|
-
}
|
|
99
|
+
},
|
|
100
|
+
closeButton: closeButton,
|
|
101
|
+
isDrawer: isDrawer
|
|
103
102
|
};
|
|
104
|
-
}, [dialogId, onClose, bodyStyles]);
|
|
103
|
+
}, [dialogId, onClose, closeButton, isDrawer, bodyStyles]);
|
|
105
104
|
var handleExited = useCallback(function (node) {
|
|
106
105
|
var _transitionEndListene;
|
|
107
106
|
onExited === null || onExited === void 0 ? void 0 : onExited(node);
|
|
@@ -157,8 +156,8 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
157
156
|
});
|
|
158
157
|
var sizeKey = 'width';
|
|
159
158
|
if (isDrawer) {
|
|
160
|
-
var
|
|
161
|
-
placement =
|
|
159
|
+
var _ref = animationProps || {},
|
|
160
|
+
placement = _ref.placement;
|
|
162
161
|
// The width or height of the drawer depends on the placement.
|
|
163
162
|
sizeKey = placement === 'top' || placement === 'bottom' ? 'height' : 'width';
|
|
164
163
|
}
|
|
@@ -199,7 +198,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
199
198
|
onClick: backdrop ? handleBackdropClick : undefined,
|
|
200
199
|
onMouseDown: handleMouseDown
|
|
201
200
|
}), function (transitionProps, transitionRef) {
|
|
202
|
-
var
|
|
201
|
+
var _ref2;
|
|
203
202
|
var transitionClassName = transitionProps.className,
|
|
204
203
|
transitionRest = _objectWithoutPropertiesLoose(transitionProps, _excluded2);
|
|
205
204
|
return /*#__PURE__*/React.createElement(Dialog, _extends({
|
|
@@ -207,7 +206,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
207
206
|
id: dialogId,
|
|
208
207
|
"aria-labelledby": ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : dialogId + "-title",
|
|
209
208
|
"aria-describedby": ariaDescribedby,
|
|
210
|
-
style: (
|
|
209
|
+
style: (_ref2 = {}, _ref2[sizeKey] = modalSizes.includes(size) ? undefined : size, _ref2)
|
|
211
210
|
}, transitionRest, pick(rest, Object.keys(modalDialogPropTypes)), {
|
|
212
211
|
ref: mergeRefs(dialogRef, transitionRef),
|
|
213
212
|
classPrefix: classPrefix,
|
package/esm/Modal/ModalBody.js
CHANGED
|
@@ -8,9 +8,7 @@ import { useClassNames } from "../internals/hooks/index.js";
|
|
|
8
8
|
import { ModalContext } from "./ModalContext.js";
|
|
9
9
|
import IconButton from "../IconButton/index.js";
|
|
10
10
|
import Close from '@rsuite/icons/Close';
|
|
11
|
-
import DrawerContext from "../Drawer/DrawerContext.js";
|
|
12
11
|
var ModalBody = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
|
-
var _context$getBodyStyle, _useContext;
|
|
14
12
|
var _props$as = props.as,
|
|
15
13
|
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
16
14
|
_props$classPrefix = props.classPrefix,
|
|
@@ -25,8 +23,11 @@ var ModalBody = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
23
|
prefix = _useClassNames.prefix;
|
|
26
24
|
var classes = merge(className, withClassPrefix());
|
|
27
25
|
var context = useContext(ModalContext);
|
|
28
|
-
var
|
|
29
|
-
|
|
26
|
+
var _ref = context || {},
|
|
27
|
+
getBodyStyles = _ref.getBodyStyles,
|
|
28
|
+
closeButton = _ref.closeButton,
|
|
29
|
+
onModalClose = _ref.onModalClose;
|
|
30
|
+
var bodyStyles = getBodyStyles === null || getBodyStyles === void 0 ? void 0 : getBodyStyles();
|
|
30
31
|
var buttonElement = null;
|
|
31
32
|
if (closeButton) {
|
|
32
33
|
buttonElement = typeof closeButton === 'boolean' ? /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -34,7 +35,7 @@ var ModalBody = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
34
35
|
appearance: "subtle",
|
|
35
36
|
size: "sm",
|
|
36
37
|
className: prefix('close'),
|
|
37
|
-
onClick:
|
|
38
|
+
onClick: onModalClose
|
|
38
39
|
}) : closeButton;
|
|
39
40
|
}
|
|
40
41
|
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
@@ -6,5 +6,9 @@ export interface ModalContextProps {
|
|
|
6
6
|
onModalClose?: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
7
7
|
/** Pass the latest style to body. */
|
|
8
8
|
getBodyStyles?: () => React.CSSProperties | null;
|
|
9
|
+
/** Indicates if the component should be displayed as a drawer */
|
|
10
|
+
isDrawer?: boolean;
|
|
11
|
+
/** Custom close button used when rendered as a Drawer */
|
|
12
|
+
closeButton?: React.ReactNode | boolean;
|
|
9
13
|
}
|
|
10
14
|
export declare const ModalContext: React.Context<ModalContextProps | null>;
|
package/esm/Modal/ModalHeader.js
CHANGED
|
@@ -10,9 +10,7 @@ import { ModalContext } from "./ModalContext.js";
|
|
|
10
10
|
import CloseButton from "../internals/CloseButton/index.js";
|
|
11
11
|
import Close from '@rsuite/icons/Close';
|
|
12
12
|
import IconButton from "../IconButton/index.js";
|
|
13
|
-
import DrawerContext from "../Drawer/DrawerContext.js";
|
|
14
13
|
var ModalHeader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
|
-
var _useContext, _useContext2;
|
|
16
14
|
var _props$as = props.as,
|
|
17
15
|
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
18
16
|
_props$classPrefix = props.classPrefix,
|
|
@@ -28,8 +26,10 @@ var ModalHeader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
28
26
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
29
27
|
prefix = _useClassNames.prefix;
|
|
30
28
|
var classes = merge(className, withClassPrefix());
|
|
31
|
-
var
|
|
32
|
-
var
|
|
29
|
+
var context = useContext(ModalContext);
|
|
30
|
+
var _ref = context || {},
|
|
31
|
+
isDrawer = _ref.isDrawer,
|
|
32
|
+
onModalClose = _ref.onModalClose;
|
|
33
33
|
var buttonElement = isDrawer ? /*#__PURE__*/React.createElement(IconButton, {
|
|
34
34
|
icon: /*#__PURE__*/React.createElement(Close, null),
|
|
35
35
|
appearance: "subtle",
|
|
@@ -4,8 +4,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
var _excluded = ["as", "classPrefix", "className", "cascade", "cascadeData", "cascadePaths", "childrenKey", "disabledItemValues", "columnWidth", "columnHeight", "uncheckableItemValues", "value", "valueKey", "labelKey", "style", "renderTreeNode", "renderColumn", "onCheck", "onSelect"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import SpinnerIcon from '@rsuite/icons/legacy/Spinner';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import PagePreviousIcon from '@rsuite/icons/PagePrevious';
|
|
8
|
+
import PageNextIcon from '@rsuite/icons/PageNext';
|
|
9
9
|
import { useClassNames, useCustom, useEventCallback } from "../internals/hooks/index.js";
|
|
10
10
|
import { shallowEqual } from "../internals/utils/index.js";
|
|
11
11
|
import { ListCheckItem, useCombobox } from "../internals/Picker/index.js";
|
|
@@ -84,7 +84,7 @@ var TreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
84
84
|
|
|
85
85
|
// Use `value` in keys when If `value` is string or number
|
|
86
86
|
var onlyKey = typeof value === 'number' || typeof value === 'string' ? value : index;
|
|
87
|
-
var Icon = node.loading ? SpinnerIcon : rtl ?
|
|
87
|
+
var Icon = node.loading ? SpinnerIcon : rtl ? PagePreviousIcon : PageNextIcon;
|
|
88
88
|
var active = value.some(function (v) {
|
|
89
89
|
return v === nodeValue;
|
|
90
90
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface NavDropdownItemProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Active the current option */
|
|
6
6
|
active?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StandardProps } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface NavDropdownMenuProps<T = any> extends StandardProps {
|
|
5
5
|
/** Define the title as a submenu */
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -16,8 +16,8 @@ import MenuItem from "../internals/Menu/MenuItem.js";
|
|
|
16
16
|
import { useClassNames, useCustom } from "../internals/hooks/index.js";
|
|
17
17
|
import { mergeRefs } from "../internals/utils/index.js";
|
|
18
18
|
import PropTypes from 'prop-types';
|
|
19
|
-
import
|
|
20
|
-
import
|
|
19
|
+
import PagePreviousIcon from '@rsuite/icons/PagePrevious';
|
|
20
|
+
import PageNextIcon from '@rsuite/icons/PageNext';
|
|
21
21
|
import NavContext from "./NavContext.js";
|
|
22
22
|
import { deprecatePropType, oneOf } from "../internals/propTypes/index.js";
|
|
23
23
|
/**
|
|
@@ -60,7 +60,7 @@ var NavDropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
60
60
|
className = _omit.className,
|
|
61
61
|
disabled = _omit.disabled,
|
|
62
62
|
menuProps = _objectWithoutPropertiesLoose(_omit, _excluded2);
|
|
63
|
-
var Icon = rtl ?
|
|
63
|
+
var Icon = rtl ? PagePreviousIcon : PageNextIcon;
|
|
64
64
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
65
65
|
openMenuOn: ['mouseover', 'click'],
|
|
66
66
|
renderMenuButton: function renderMenuButton(_ref, buttonRef) {
|
package/esm/Nav/NavItem.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface NavItemProps<T = string | number> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Activation status */
|
|
6
6
|
active?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
import Button from '../Button';
|
|
5
5
|
import NavDropdownItem from '../Nav/NavDropdownItem';
|
|
6
6
|
import NavDropdownMenu from '../Nav/NavDropdownMenu';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface NavbarDropdownItemProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Active the current option */
|
|
6
6
|
active?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StandardProps } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface NavbarDropdownMenuProps<T = any> extends StandardProps {
|
|
5
5
|
/** Define the title as a submenu */
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -11,8 +11,8 @@ import React, { useContext } from 'react';
|
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import omit from 'lodash/omit';
|
|
13
13
|
import isNil from 'lodash/isNil';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import PagePreviousIcon from '@rsuite/icons/PagePrevious';
|
|
15
|
+
import PageNextIcon from '@rsuite/icons/PageNext';
|
|
16
16
|
import { mergeRefs } from "../internals/utils/index.js";
|
|
17
17
|
import { useClassNames, useCustom } from "../internals/hooks/index.js";
|
|
18
18
|
import { NavbarContext } from '.';
|
|
@@ -66,7 +66,7 @@ var NavbarDropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
66
66
|
className = _omit.className,
|
|
67
67
|
disabled = _omit.disabled,
|
|
68
68
|
menuProps = _objectWithoutPropertiesLoose(_omit, _excluded2);
|
|
69
|
-
var Icon = rtl ?
|
|
69
|
+
var Icon = rtl ? PagePreviousIcon : PageNextIcon;
|
|
70
70
|
return /*#__PURE__*/React.createElement(Disclosure, {
|
|
71
71
|
hideOnClickOutside: true,
|
|
72
72
|
trigger: ['click', 'hover'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IconProps } from '@rsuite/icons/
|
|
2
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
3
3
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
4
4
|
export interface NavbarItemProps<T = string | number> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Activation status */
|
|
@@ -7,19 +7,19 @@ var _excluded = ["as", "className", "classPrefix", "disabled", "locale", "active
|
|
|
7
7
|
_excluded2 = ["eventKey", "disabled"];
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
10
|
+
import MoreIcon from '@rsuite/icons/More';
|
|
11
|
+
import PagePreviousIcon from '@rsuite/icons/PagePrevious';
|
|
12
|
+
import PageTopIcon from '@rsuite/icons/PageTop';
|
|
13
|
+
import PageNextIcon from '@rsuite/icons/PageNext';
|
|
14
|
+
import PageEndIcon from '@rsuite/icons/PageEnd';
|
|
15
15
|
import PaginationButton from "./PaginationButton.js";
|
|
16
16
|
import { useClassNames, useCustom } from "../internals/hooks/index.js";
|
|
17
17
|
var PAGINATION_ICONS = {
|
|
18
|
-
more: /*#__PURE__*/React.createElement(
|
|
19
|
-
prev: /*#__PURE__*/React.createElement(
|
|
20
|
-
next: /*#__PURE__*/React.createElement(
|
|
21
|
-
first: /*#__PURE__*/React.createElement(
|
|
22
|
-
last: /*#__PURE__*/React.createElement(
|
|
18
|
+
more: /*#__PURE__*/React.createElement(MoreIcon, null),
|
|
19
|
+
prev: /*#__PURE__*/React.createElement(PagePreviousIcon, null),
|
|
20
|
+
next: /*#__PURE__*/React.createElement(PageNextIcon, null),
|
|
21
|
+
first: /*#__PURE__*/React.createElement(PageTopIcon, null),
|
|
22
|
+
last: /*#__PURE__*/React.createElement(PageEndIcon, null)
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Pagination component for displaying page numbers.
|
|
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
var _templateObject;
|
|
6
6
|
var _excluded = ["classPrefix", "expanded", "id", "className", "controlId", "children", "disabled", "caretAs"];
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
8
|
+
import Icon from '@rsuite/icons/Icon';
|
|
9
9
|
import AngleDownIcon from '@rsuite/icons/legacy/AngleDown';
|
|
10
10
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
11
11
|
var AccordionButton = function AccordionButton(props) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
5
5
|
/** Define the title as a submenu */
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavDropdownItemProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Active the current option */
|
|
6
6
|
active?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavDropdownMenuProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLLIElement>, 'title' | 'onSelect'> {
|
|
5
5
|
/** Primary content */
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
import Button from '../Button';
|
|
5
5
|
import NavDropdownItem from '../Nav/NavDropdownItem';
|
|
6
6
|
import NavDropdownMenu from '../Nav/NavDropdownMenu';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavDropdownItemProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Active the current option */
|
|
6
6
|
active?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StandardProps } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavDropdownMenuProps<T = any> extends StandardProps {
|
|
5
5
|
/** Define the title as a submenu */
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
|
-
import { IconProps } from '@rsuite/icons/
|
|
3
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavItemProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
|
|
5
5
|
/** Activation status */
|
|
6
6
|
active?: boolean;
|
|
@@ -4,10 +4,10 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
var _excluded = ["as", "expanded", "className", "classPrefix", "onToggle"];
|
|
5
5
|
import React, { useContext } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
+
import PagePreviousIcon from '@rsuite/icons/PagePrevious';
|
|
8
|
+
import PageNextIcon from '@rsuite/icons/PageNext';
|
|
7
9
|
import IconButton from "../IconButton/index.js";
|
|
8
10
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
9
|
-
import AngleLeft from '@rsuite/icons/legacy/AngleLeft';
|
|
10
|
-
import AngleRight from '@rsuite/icons/legacy/AngleRight';
|
|
11
11
|
import { deprecatePropType } from "../internals/propTypes/index.js";
|
|
12
12
|
import { SidenavContext } from "./Sidenav.js";
|
|
13
13
|
var SidenavToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -33,7 +33,7 @@ var SidenavToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
33
33
|
var classes = merge(className, withClassPrefix({
|
|
34
34
|
collapsed: !expanded
|
|
35
35
|
}));
|
|
36
|
-
var Icon = expanded ?
|
|
36
|
+
var Icon = expanded ? PagePreviousIcon : PageNextIcon;
|
|
37
37
|
var handleToggle = function handleToggle(event) {
|
|
38
38
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!expanded, event);
|
|
39
39
|
};
|
package/esm/Steps/StepItem.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IconProps } from '@rsuite/icons/
|
|
2
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
3
3
|
import { WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
4
4
|
export interface StepItemProps extends WithAsProps {
|
|
5
5
|
/** The width of each item. */
|
|
@@ -6,7 +6,7 @@ var _templateObject, _templateObject2;
|
|
|
6
6
|
var _excluded = ["as", "classPrefix", "children", "className"];
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { useClassNames } from "../hooks/index.js";
|
|
9
|
-
import
|
|
9
|
+
import ArrowDownIcon from '@rsuite/icons/ArrowDown';
|
|
10
10
|
var ListItemGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11
11
|
var _props$as = props.as,
|
|
12
12
|
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
@@ -28,7 +28,7 @@ var ListItemGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
28
28
|
}), /*#__PURE__*/React.createElement("div", {
|
|
29
29
|
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["title"]))),
|
|
30
30
|
tabIndex: -1
|
|
31
|
-
}, /*#__PURE__*/React.createElement("span", null, children), /*#__PURE__*/React.createElement(
|
|
31
|
+
}, /*#__PURE__*/React.createElement("span", null, children), /*#__PURE__*/React.createElement(ArrowDownIcon, {
|
|
32
32
|
"aria-hidden": true,
|
|
33
33
|
className: prefix(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["caret"])))
|
|
34
34
|
})));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import Icon from '@rsuite/icons/Icon';
|
|
4
4
|
import { useCustom, useClassNames } from "../hooks/index.js";
|
|
5
5
|
import InputGroup from "../../InputGroup/index.js";
|
|
6
6
|
import CloseButton from "../CloseButton/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ToggleButton, { ToggleButtonProps } from './ToggleButton';
|
|
3
3
|
import { RsRefForwardingComponent, TypeAttributes, DataItemValue } from '../types';
|
|
4
|
-
import { IconProps } from '@rsuite/icons/
|
|
4
|
+
import { IconProps } from '@rsuite/icons/Icon';
|
|
5
5
|
export interface PickerToggleProps<T = DataItemValue> extends ToggleButtonProps {
|
|
6
6
|
active?: boolean;
|
|
7
7
|
hasValue?: boolean;
|
|
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
6
|
var _excluded = ["as", "classPrefix", "value", "className", "placeholder", "inputRef", "onChange"];
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
8
|
+
import SearchIcon from '@rsuite/icons/Search';
|
|
9
9
|
import { useClassNames } from "../hooks/index.js";
|
|
10
10
|
import Input from "../../Input/index.js";
|
|
11
11
|
import InputGroup from "../../InputGroup/index.js";
|
|
@@ -37,7 +37,7 @@ var SearchBox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
37
37
|
onChange: onChange,
|
|
38
38
|
placeholder: placeholder,
|
|
39
39
|
ref: inputRef
|
|
40
|
-
}), /*#__PURE__*/React.createElement(InputGroup.Addon, null, /*#__PURE__*/React.createElement(
|
|
40
|
+
}), /*#__PURE__*/React.createElement(InputGroup.Addon, null, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
41
41
|
className: prefix(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["icon"])))
|
|
42
42
|
}))));
|
|
43
43
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import InfoRoundIcon from '@rsuite/icons/InfoRound';
|
|
4
|
+
import CheckRoundIcon from '@rsuite/icons/CheckRound';
|
|
5
|
+
import WarningRoundIcon from '@rsuite/icons/WarningRound';
|
|
6
|
+
import RemindRoundIcon from '@rsuite/icons/RemindRound';
|
|
6
7
|
import Check from '@rsuite/icons/Check';
|
|
7
8
|
import Close from '@rsuite/icons/Close';
|
|
8
|
-
import RemindRoundIcon from '@rsuite/icons/RemindRound';
|
|
9
9
|
export var MESSAGE_STATUS_ICONS = {
|
|
10
|
-
info: /*#__PURE__*/React.createElement(
|
|
11
|
-
success: /*#__PURE__*/React.createElement(
|
|
12
|
-
error: /*#__PURE__*/React.createElement(
|
|
10
|
+
info: /*#__PURE__*/React.createElement(InfoRoundIcon, null),
|
|
11
|
+
success: /*#__PURE__*/React.createElement(CheckRoundIcon, null),
|
|
12
|
+
error: /*#__PURE__*/React.createElement(WarningRoundIcon, null),
|
|
13
13
|
warning: /*#__PURE__*/React.createElement(RemindRoundIcon, null)
|
|
14
14
|
};
|
|
15
15
|
export var PROGRESS_STATUS_ICON = {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Ensures that a virtualized list item retains focus after scrolling or clicking on options,
|
|
4
|
+
* preventing unnecessary re-renders and loss of focus. If the current focus is on an interactive
|
|
5
|
+
* element (such as input, textarea, select, button, or contenteditable), the focus is not shifted.
|
|
6
|
+
* @param focused - Boolean indicating if the item should be focused.
|
|
7
|
+
* @returns A ref to be attached to the list item element.
|
|
5
8
|
*/
|
|
6
9
|
export declare function useFocusVirtualListItem<T extends HTMLElement>(focused?: boolean): import("react").RefObject<T>;
|
|
7
10
|
export default useFocusVirtualListItem;
|
|
@@ -2,19 +2,35 @@
|
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Ensures that a virtualized list item retains focus after scrolling or clicking on options,
|
|
6
|
+
* preventing unnecessary re-renders and loss of focus. If the current focus is on an interactive
|
|
7
|
+
* element (such as input, textarea, select, button, or contenteditable), the focus is not shifted.
|
|
8
|
+
* @param focused - Boolean indicating if the item should be focused.
|
|
9
|
+
* @returns A ref to be attached to the list item element.
|
|
7
10
|
*/
|
|
8
11
|
export function useFocusVirtualListItem(focused) {
|
|
9
12
|
var itemRef = useRef(null);
|
|
10
13
|
useEffect(function () {
|
|
11
|
-
if (!focused) {
|
|
14
|
+
if (!focused || !itemRef.current) {
|
|
12
15
|
return;
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
var activeElement = document.activeElement;
|
|
18
|
+
|
|
19
|
+
// Helper function to determine if the element should retain focus
|
|
20
|
+
var isInteractiveElement = function isInteractiveElement(element) {
|
|
21
|
+
var tagName = element.tagName;
|
|
22
|
+
return tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT' || tagName === 'BUTTON' || element.isContentEditable || element.tabIndex >= 0 // Elements with tabindex are considered focusable
|
|
23
|
+
;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// If the active element is an interactive one, don't shift focus.
|
|
27
|
+
if (activeElement && isInteractiveElement(activeElement)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// If the currently focused element is not the target item, focus it.
|
|
32
|
+
if (activeElement !== itemRef.current) {
|
|
33
|
+
itemRef.current.focus();
|
|
18
34
|
}
|
|
19
35
|
}, [focused]);
|
|
20
36
|
return itemRef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TypeAttributes } from '../types';
|
|
3
|
-
export declare function useToggleCaret(placement: TypeAttributes.Placement8 | TypeAttributes.Placement): import("react").
|
|
3
|
+
export declare function useToggleCaret(placement: TypeAttributes.Placement8 | TypeAttributes.Placement): import("react").ForwardRefExoticComponent<import("@rsuite/icons/esm/Icon").IconProps & import("react").RefAttributes<SVGElement>>;
|
|
4
4
|
export default useToggleCaret;
|
package/esm/locales/hu_HU.d.ts
CHANGED
package/esm/locales/hu_HU.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsuite",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.73.1",
|
|
4
4
|
"description": "A suite of react components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.20.1",
|
|
28
28
|
"@juggle/resize-observer": "^3.4.0",
|
|
29
|
-
"@rsuite/icons": "^1.0
|
|
29
|
+
"@rsuite/icons": "^1.2.0",
|
|
30
30
|
"@types/lodash": "^4.14.184",
|
|
31
31
|
"@types/prop-types": "^15.7.5",
|
|
32
32
|
"@types/react-window": "^1.8.5",
|