rsuite 6.0.0-canary-20241227 → 6.0.0-canary-20250103
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/AutoComplete/styles/index.css +8 -16
- package/Badge/styles/index.css +83 -17
- package/Badge/styles/index.less +68 -9
- package/Button/styles/index.css +5 -10
- package/Button/styles/mixin.less +1 -2
- package/CHANGELOG.md +18 -0
- package/Calendar/styles/index.css +6 -12
- package/Cascader/styles/index.css +8 -16
- package/CheckPicker/styles/index.css +8 -16
- package/CheckTree/styles/index.css +8 -16
- package/CheckTreePicker/styles/index.css +8 -16
- package/DatePicker/styles/index.css +9 -18
- package/DateRangePicker/styles/index.css +9 -18
- package/Dropdown/styles/index.css +5 -10
- package/IconButton/styles/index.css +7 -14
- package/InputGroup/styles/index.css +6 -12
- package/InputNumber/styles/index.css +6 -12
- package/InputPicker/styles/index.css +8 -16
- package/MultiCascadeTree/styles/index.css +8 -16
- package/MultiCascader/styles/index.css +8 -16
- package/Nav/styles/index.css +5 -10
- package/Navbar/styles/index.css +5 -10
- package/Pagination/styles/index.css +11 -22
- package/Rate/styles/index.css +16 -8
- package/Rate/styles/index.less +6 -2
- package/SelectPicker/styles/index.css +8 -16
- package/Stat/styles/index.css +7 -14
- package/Table/styles/index.css +2 -2
- package/Tabs/styles/index.css +5 -10
- package/Tag/styles/index.css +29 -21
- package/Tag/styles/index.less +6 -3
- package/TagInput/styles/index.css +8 -16
- package/TagPicker/styles/index.css +8 -16
- package/TimePicker/styles/index.css +9 -18
- package/TimeRangePicker/styles/index.css +9 -18
- package/Tree/styles/index.css +8 -16
- package/TreePicker/styles/index.css +8 -16
- package/Uploader/styles/index.css +7 -14
- package/cjs/Accordion/Accordion.js +1 -1
- package/cjs/AutoComplete/AutoComplete.d.ts +2 -2
- package/cjs/AutoComplete/Combobox.js +1 -1
- package/cjs/Badge/Badge.d.ts +40 -5
- package/cjs/Badge/Badge.js +30 -19
- package/cjs/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/Button/Button.d.ts +5 -1
- package/cjs/Button/Button.js +17 -3
- package/cjs/Card/Card.js +1 -1
- package/cjs/CascadeTree/utils.js +1 -1
- package/cjs/CustomProvider/CustomProvider.d.ts +12 -4
- package/cjs/CustomProvider/CustomProvider.js +4 -3
- package/cjs/DateInput/hooks/useDateInputState.js +10 -8
- package/cjs/DateInput/hooks/useKeyboardInputEvent.js +1 -0
- package/cjs/DatePicker/PredefinedRanges.js +1 -1
- package/cjs/DateRangePicker/DateRangePicker.js +1 -1
- package/cjs/Drawer/Drawer.d.ts +2 -2
- package/cjs/Drawer/Drawer.js +1 -1
- package/cjs/Drawer/DrawerBody.js +7 -5
- package/cjs/Drawer/DrawerFooter.js +7 -5
- package/cjs/Drawer/DrawerHeader.js +7 -5
- package/cjs/Drawer/DrawerTitle.js +7 -5
- package/cjs/Dropdown/Dropdown.d.ts +2 -2
- package/cjs/Dropdown/Dropdown.js +1 -1
- package/cjs/Dropdown/DropdownContext.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.d.ts +2 -2
- package/cjs/Dropdown/DropdownToggle.d.ts +2 -2
- package/cjs/FlexboxGrid/FlexboxGrid.js +1 -1
- package/cjs/Form/Form.js +1 -1
- package/cjs/FormControl/FormControl.d.ts +2 -2
- package/cjs/FormErrorMessage/FormErrorMessage.d.ts +2 -2
- package/cjs/InlineEdit/EditableControls.js +1 -1
- package/cjs/InputGroup/InputGroup.js +1 -1
- package/cjs/InputNumber/InputNumber.js +1 -1
- package/cjs/InputPicker/InputPicker.js +0 -1
- package/cjs/InputPicker/TagList.js +1 -0
- package/cjs/InputPicker/TextBox.js +1 -0
- package/cjs/InputPicker/hooks/useMaxWidth.js +0 -1
- package/cjs/List/List.js +1 -1
- package/cjs/MaskedInput/MaskedInput.js +1 -0
- package/cjs/MaskedInput/conformToMask.js +0 -1
- package/cjs/Modal/Modal.js +1 -1
- package/cjs/Modal/utils.js +0 -1
- package/cjs/Nav/Nav.js +1 -1
- package/cjs/Nav/NavDropdown.d.ts +2 -2
- package/cjs/Nav/NavDropdown.js +1 -1
- package/cjs/Nav/NavDropdownToggle.d.ts +2 -2
- package/cjs/Navbar/Navbar.js +1 -1
- package/cjs/Navbar/NavbarDropdown.d.ts +2 -2
- package/cjs/Navbar/NavbarDropdown.js +1 -1
- package/cjs/Navbar/NavbarDropdownToggle.d.ts +2 -2
- package/cjs/Navbar/index.js +0 -0
- package/cjs/RangeSlider/RangeSlider.js +4 -4
- package/cjs/Rate/Character.js +6 -6
- package/cjs/Rate/Rate.d.ts +4 -4
- package/cjs/Rate/Rate.js +16 -15
- package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +2 -2
- package/cjs/Sidenav/Sidenav.js +1 -1
- package/cjs/Sidenav/SidenavDropdown.d.ts +2 -2
- package/cjs/Sidenav/SidenavDropdown.js +1 -1
- package/cjs/Sidenav/SidenavDropdownToggle.d.ts +2 -2
- package/cjs/Stack/HStack.js +1 -1
- package/cjs/Stack/Stack.js +1 -1
- package/cjs/Stack/VStack.js +1 -1
- package/cjs/Stat/Stat.js +1 -1
- package/cjs/Steps/Steps.js +1 -1
- package/cjs/Table/Table.js +2 -2
- package/cjs/Tabs/Tabs.js +8 -9
- package/cjs/Tag/Tag.d.ts +2 -2
- package/cjs/Tag/Tag.js +12 -6
- package/cjs/Timeline/Timeline.js +8 -5
- package/cjs/Tooltip/Tooltip.d.ts +2 -2
- package/cjs/Tree/hooks/useFlattenTree.js +1 -3
- package/cjs/Tree/hooks/useFocusTree.js +0 -1
- package/cjs/Tree/hooks/useTreeSearch.js +0 -1
- package/cjs/Uploader/UploadTrigger.js +13 -28
- package/cjs/Uploader/utils/ajaxUpload.js +1 -1
- package/cjs/internals/Disclosure/Disclosure.js +1 -0
- package/cjs/internals/Menu/useMenu.js +51 -49
- package/cjs/internals/Overlay/Overlay.d.ts +2 -2
- package/cjs/internals/Overlay/OverlayTrigger.d.ts +2 -2
- package/cjs/internals/Overlay/Position.d.ts +2 -2
- package/cjs/internals/Overlay/positionUtils.d.ts +2 -2
- package/cjs/internals/Picker/PickerToggle.d.ts +2 -2
- package/cjs/internals/Picker/PickerToggleTrigger.d.ts +2 -2
- package/cjs/internals/Picker/hooks/useFocusItemValue.js +1 -1
- package/cjs/internals/Picker/hooks/usePickerClassName.d.ts +2 -2
- package/cjs/internals/ScrollView/hooks/useScrollState.d.ts +1 -1
- package/cjs/internals/Tree/TreeView.js +2 -1
- package/cjs/internals/Tree/utils/getPathTowardsItem.js +1 -1
- package/cjs/internals/Windowing/AutoSizer.js +1 -0
- package/cjs/internals/Windowing/List.js +2 -1
- package/cjs/internals/hooks/useClassNames.d.ts +1 -2
- package/cjs/internals/hooks/useClassNames.js +0 -2
- package/cjs/internals/hooks/usePortal.js +1 -1
- package/cjs/internals/hooks/useToggleCaret.d.ts +2 -2
- package/cjs/internals/hooks/useToggleCaret.js +1 -1
- package/cjs/internals/hooks/useUpdateEffect.js +0 -1
- package/cjs/internals/hooks/useWillUnmount.js +0 -2
- package/cjs/internals/symbols.d.ts +1 -0
- package/cjs/internals/symbols.js +3 -2
- package/cjs/internals/types/colours.d.ts +10 -0
- package/cjs/internals/types/colours.js +15 -0
- package/cjs/internals/types/index.d.ts +6 -7
- package/cjs/internals/types/index.js +13 -1
- package/cjs/internals/types/placement.d.ts +5 -0
- package/cjs/internals/types/placement.js +4 -0
- package/cjs/internals/utils/BrowserDetection.d.ts +0 -2
- package/cjs/internals/utils/BrowserDetection.js +2 -12
- package/cjs/internals/utils/ReactChildren.js +0 -2
- package/cjs/internals/utils/colours.d.ts +21 -0
- package/cjs/internals/utils/colours.js +86 -0
- package/cjs/internals/utils/css.d.ts +13 -1
- package/cjs/internals/utils/css.js +42 -3
- package/cjs/internals/utils/getDOMNode.js +2 -2
- package/cjs/internals/utils/getSafeRegExpString.js +2 -1
- package/cjs/internals/utils/index.d.ts +2 -2
- package/cjs/internals/utils/index.js +17 -9
- package/cjs/toaster/ToastContainer.d.ts +8 -8
- package/cjs/toaster/ToastContainer.js +39 -36
- package/cjs/toaster/render.d.ts +2 -0
- package/cjs/toaster/render.js +25 -0
- package/cjs/toaster/toaster.js +29 -19
- package/cjs/useMediaQuery/useMediaQuery.js +1 -3
- package/cjs/useToaster/useToaster.js +10 -5
- package/dist/rsuite-no-reset-rtl.css +143 -74
- 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 +143 -74
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +143 -74
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +143 -74
- package/dist/rsuite.js +113 -91
- 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/Accordion/Accordion.js +1 -1
- package/esm/AutoComplete/AutoComplete.d.ts +2 -2
- package/esm/AutoComplete/Combobox.js +1 -1
- package/esm/Badge/Badge.d.ts +40 -5
- package/esm/Badge/Badge.js +28 -19
- package/esm/Breadcrumb/Breadcrumb.js +1 -1
- package/esm/Button/Button.d.ts +5 -1
- package/esm/Button/Button.js +18 -4
- package/esm/Card/Card.js +1 -1
- package/esm/CascadeTree/utils.js +1 -1
- package/esm/CustomProvider/CustomProvider.d.ts +12 -4
- package/esm/CustomProvider/CustomProvider.js +5 -4
- package/esm/DateInput/hooks/useDateInputState.js +10 -8
- package/esm/DateInput/hooks/useKeyboardInputEvent.js +1 -0
- package/esm/DatePicker/PredefinedRanges.js +1 -1
- package/esm/DateRangePicker/DateRangePicker.js +1 -1
- package/esm/Drawer/Drawer.d.ts +2 -2
- package/esm/Drawer/Drawer.js +1 -1
- package/esm/Drawer/DrawerBody.js +7 -5
- package/esm/Drawer/DrawerFooter.js +7 -5
- package/esm/Drawer/DrawerHeader.js +7 -5
- package/esm/Drawer/DrawerTitle.js +7 -5
- package/esm/Dropdown/Dropdown.d.ts +2 -2
- package/esm/Dropdown/Dropdown.js +1 -1
- package/esm/Dropdown/DropdownContext.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.d.ts +2 -2
- package/esm/Dropdown/DropdownToggle.d.ts +2 -2
- package/esm/FlexboxGrid/FlexboxGrid.js +1 -1
- package/esm/Form/Form.js +1 -1
- package/esm/FormControl/FormControl.d.ts +2 -2
- package/esm/FormErrorMessage/FormErrorMessage.d.ts +2 -2
- package/esm/InlineEdit/EditableControls.js +1 -1
- package/esm/InputGroup/InputGroup.js +1 -1
- package/esm/InputNumber/InputNumber.js +1 -1
- package/esm/InputPicker/InputPicker.js +0 -1
- package/esm/InputPicker/TagList.js +1 -0
- package/esm/InputPicker/TextBox.js +1 -0
- package/esm/InputPicker/hooks/useMaxWidth.js +0 -1
- package/esm/List/List.js +1 -1
- package/esm/MaskedInput/MaskedInput.js +1 -0
- package/esm/MaskedInput/conformToMask.js +0 -1
- package/esm/Modal/Modal.js +1 -1
- package/esm/Modal/utils.js +0 -1
- package/esm/Nav/Nav.js +1 -1
- package/esm/Nav/NavDropdown.d.ts +2 -2
- package/esm/Nav/NavDropdown.js +1 -1
- package/esm/Nav/NavDropdownToggle.d.ts +2 -2
- package/esm/Navbar/Navbar.js +1 -1
- package/esm/Navbar/NavbarDropdown.d.ts +2 -2
- package/esm/Navbar/NavbarDropdown.js +1 -1
- package/esm/Navbar/NavbarDropdownToggle.d.ts +2 -2
- package/esm/Navbar/index.js +0 -0
- package/esm/RangeSlider/RangeSlider.js +4 -4
- package/esm/Rate/Character.js +8 -8
- package/esm/Rate/Rate.d.ts +4 -4
- package/esm/Rate/Rate.js +19 -18
- package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +2 -2
- package/esm/Sidenav/Sidenav.js +1 -1
- package/esm/Sidenav/SidenavDropdown.d.ts +2 -2
- package/esm/Sidenav/SidenavDropdown.js +1 -1
- package/esm/Sidenav/SidenavDropdownToggle.d.ts +2 -2
- package/esm/Stack/HStack.js +1 -1
- package/esm/Stack/Stack.js +1 -1
- package/esm/Stack/VStack.js +1 -1
- package/esm/Stat/Stat.js +1 -1
- package/esm/Steps/Steps.js +1 -1
- package/esm/Table/Table.js +2 -2
- package/esm/Tabs/Tabs.js +8 -9
- package/esm/Tag/Tag.d.ts +2 -2
- package/esm/Tag/Tag.js +10 -6
- package/esm/Timeline/Timeline.js +8 -5
- package/esm/Tooltip/Tooltip.d.ts +2 -2
- package/esm/Tree/hooks/useFlattenTree.js +1 -3
- package/esm/Tree/hooks/useFocusTree.js +0 -1
- package/esm/Tree/hooks/useTreeSearch.js +0 -1
- package/esm/Uploader/UploadTrigger.js +15 -30
- package/esm/Uploader/utils/ajaxUpload.js +1 -1
- package/esm/internals/Disclosure/Disclosure.js +1 -0
- package/esm/internals/Menu/useMenu.js +51 -49
- package/esm/internals/Overlay/Overlay.d.ts +2 -2
- package/esm/internals/Overlay/OverlayTrigger.d.ts +2 -2
- package/esm/internals/Overlay/Position.d.ts +2 -2
- package/esm/internals/Overlay/positionUtils.d.ts +2 -2
- package/esm/internals/Picker/PickerToggle.d.ts +2 -2
- package/esm/internals/Picker/PickerToggleTrigger.d.ts +2 -2
- package/esm/internals/Picker/hooks/useFocusItemValue.js +1 -1
- package/esm/internals/Picker/hooks/usePickerClassName.d.ts +2 -2
- package/esm/internals/ScrollView/hooks/useScrollState.d.ts +1 -1
- package/esm/internals/Tree/TreeView.js +2 -1
- package/esm/internals/Tree/utils/getPathTowardsItem.js +1 -1
- package/esm/internals/Windowing/AutoSizer.js +1 -0
- package/esm/internals/Windowing/List.js +2 -1
- package/esm/internals/hooks/useClassNames.d.ts +1 -2
- package/esm/internals/hooks/useClassNames.js +0 -2
- package/esm/internals/hooks/usePortal.js +1 -1
- package/esm/internals/hooks/useToggleCaret.d.ts +2 -2
- package/esm/internals/hooks/useToggleCaret.js +1 -1
- package/esm/internals/hooks/useUpdateEffect.js +0 -1
- package/esm/internals/hooks/useWillUnmount.js +0 -2
- package/esm/internals/symbols.d.ts +1 -0
- package/esm/internals/symbols.js +2 -1
- package/esm/internals/types/colours.d.ts +10 -0
- package/esm/internals/types/colours.js +11 -0
- package/esm/internals/types/index.d.ts +6 -7
- package/esm/internals/types/index.js +6 -0
- package/esm/internals/types/placement.d.ts +5 -0
- package/esm/internals/types/placement.js +2 -0
- package/esm/internals/utils/BrowserDetection.d.ts +0 -2
- package/esm/internals/utils/BrowserDetection.js +1 -9
- package/esm/internals/utils/ReactChildren.js +0 -2
- package/esm/internals/utils/colours.d.ts +21 -0
- package/esm/internals/utils/colours.js +77 -0
- package/esm/internals/utils/css.d.ts +13 -1
- package/esm/internals/utils/css.js +40 -3
- package/esm/internals/utils/getDOMNode.js +1 -2
- package/esm/internals/utils/getSafeRegExpString.js +2 -1
- package/esm/internals/utils/index.d.ts +2 -2
- package/esm/internals/utils/index.js +3 -3
- package/esm/toaster/ToastContainer.d.ts +8 -8
- package/esm/toaster/ToastContainer.js +39 -37
- package/esm/toaster/render.d.ts +2 -0
- package/esm/toaster/render.js +21 -0
- package/esm/toaster/toaster.js +27 -18
- package/esm/useMediaQuery/useMediaQuery.js +1 -3
- package/esm/useToaster/useToaster.js +10 -5
- package/package.json +1 -1
- package/styles/color-modes/dark.less +1 -0
- package/styles/color-modes/high-contrast.less +1 -0
- package/styles/color-modes/light.less +1 -0
- package/styles/variables.less +1 -1
- package/cjs/internals/utils/render.d.ts +0 -7
- package/cjs/internals/utils/render.js +0 -26
- package/esm/internals/utils/render.d.ts +0 -7
- package/esm/internals/utils/render.js +0 -22
|
@@ -5,7 +5,7 @@ import CheckIcon from '@rsuite/icons/Check';
|
|
|
5
5
|
import CloseIcon from '@rsuite/icons/Close';
|
|
6
6
|
import IconButton from "../IconButton/index.js";
|
|
7
7
|
import Stack from "../Stack/index.js";
|
|
8
|
-
const EditableControls = /*#__PURE__*/React.forwardRef((props, ref)
|
|
8
|
+
const EditableControls = /*#__PURE__*/React.forwardRef(function EditableControls(props, ref) {
|
|
9
9
|
const {
|
|
10
10
|
onSave,
|
|
11
11
|
onCancel,
|
|
@@ -10,7 +10,7 @@ export const InputGroupContext = /*#__PURE__*/React.createContext(null);
|
|
|
10
10
|
* The `InputGroup` component is used to specify an input field with an add-on.
|
|
11
11
|
* @see https://rsuitejs.com/components/input/#input-group
|
|
12
12
|
*/
|
|
13
|
-
const InputGroup = /*#__PURE__*/React.forwardRef((props, ref)
|
|
13
|
+
const InputGroup = /*#__PURE__*/React.forwardRef(function InputGroup(props, ref) {
|
|
14
14
|
const {
|
|
15
15
|
propsWithDefaults
|
|
16
16
|
} = useCustom('InputGroup', props);
|
|
@@ -193,7 +193,7 @@ const InputNumber = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
193
193
|
});
|
|
194
194
|
const handleChange = useEventCallback((value, event) => {
|
|
195
195
|
const separator = decimalSeparator || '.';
|
|
196
|
-
const escapedSeparator = separator.replace(/[
|
|
196
|
+
const escapedSeparator = separator.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
197
197
|
const regex = new RegExp(`^-?(?:\\d+)?(${escapedSeparator})?\\d*$`);
|
|
198
198
|
if (!regex.test(value) && value !== '') {
|
|
199
199
|
return;
|
|
@@ -186,7 +186,6 @@ const InputPicker = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
186
186
|
useEffect(() => {
|
|
187
187
|
var _triggerRef$current2, _triggerRef$current2$;
|
|
188
188
|
(_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 || (_triggerRef$current2$ = _triggerRef$current2.updatePosition) === null || _triggerRef$current2$ === void 0 || _triggerRef$current2$.call(_triggerRef$current2);
|
|
189
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
190
189
|
}, [searchKeyword, value]);
|
|
191
190
|
const getDataItem = value => {
|
|
192
191
|
// Find active `MenuItem` by `value`
|
|
@@ -10,7 +10,6 @@ function useMaxWidth(triggerRef) {
|
|
|
10
10
|
var _triggerRef$current2;
|
|
11
11
|
setMaxWidth(getWidth((_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.root));
|
|
12
12
|
}
|
|
13
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
13
|
}, []);
|
|
15
14
|
return maxWidth;
|
|
16
15
|
}
|
package/esm/List/List.js
CHANGED
|
@@ -11,7 +11,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
11
11
|
* The `List` component is used to specify the layout of the list.
|
|
12
12
|
* @see https://rsuitejs.com/components/list
|
|
13
13
|
*/
|
|
14
|
-
const List = /*#__PURE__*/React.forwardRef((props, ref)
|
|
14
|
+
const List = /*#__PURE__*/React.forwardRef(function List(props, ref) {
|
|
15
15
|
const {
|
|
16
16
|
propsWithDefaults
|
|
17
17
|
} = useCustom('List', props);
|
|
@@ -127,7 +127,6 @@ export default function conformToMask(rawValue, mask, config) {
|
|
|
127
127
|
// or we find at least one character that we can map.
|
|
128
128
|
while (rawValueArr.length > 0) {
|
|
129
129
|
// Let's retrieve the first user character in the queue of characters we have left
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
130
|
const {
|
|
132
131
|
char: rawValueChar,
|
|
133
132
|
isNew
|
package/esm/Modal/Modal.js
CHANGED
|
@@ -21,7 +21,7 @@ const modalSizes = ['xs', 'sm', 'md', 'lg', 'full'];
|
|
|
21
21
|
* The `Modal` component is used to show content in a layer above the app.
|
|
22
22
|
* @see https://rsuitejs.com/components/modal
|
|
23
23
|
*/
|
|
24
|
-
const Modal = /*#__PURE__*/React.forwardRef((props, ref)
|
|
24
|
+
const Modal = /*#__PURE__*/React.forwardRef(function Modal(props, ref) {
|
|
25
25
|
const {
|
|
26
26
|
propsWithDefaults
|
|
27
27
|
} = useCustom('Modal', props);
|
package/esm/Modal/utils.js
CHANGED
|
@@ -64,7 +64,6 @@ export const useBodyStyles = (ref, options) => {
|
|
|
64
64
|
}, [overflow, prefix, ref, size, updateBodyStyles]);
|
|
65
65
|
useEffect(() => {
|
|
66
66
|
return onDestroyEvents;
|
|
67
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
67
|
}, []);
|
|
69
68
|
return [overflow ? bodyStyles : null, onChangeBodyStyles, onDestroyEvents];
|
|
70
69
|
};
|
package/esm/Nav/Nav.js
CHANGED
|
@@ -17,7 +17,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
17
17
|
* The `Nav` component is used to create navigation links.
|
|
18
18
|
* @see https://rsuitejs.com/components/nav
|
|
19
19
|
*/
|
|
20
|
-
const Nav = /*#__PURE__*/React.forwardRef((props, ref)
|
|
20
|
+
const Nav = /*#__PURE__*/React.forwardRef(function Nav(props, ref) {
|
|
21
21
|
const {
|
|
22
22
|
propsWithDefaults
|
|
23
23
|
} = useCustom('Nav', props);
|
package/esm/Nav/NavDropdown.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
import Button from '../Button';
|
|
4
4
|
import NavDropdownItem from './NavDropdownItem';
|
|
5
5
|
import NavDropdownMenu from './NavDropdownMenu';
|
|
@@ -13,7 +13,7 @@ export interface NavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLA
|
|
|
13
13
|
/** Triggering events */
|
|
14
14
|
trigger?: NavDropdownTrigger | readonly NavDropdownTrigger[];
|
|
15
15
|
/** The placement of Menu */
|
|
16
|
-
placement?:
|
|
16
|
+
placement?: PlacementCorners;
|
|
17
17
|
/** Whether or not component is disabled */
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
/** The style of the menu */
|
package/esm/Nav/NavDropdown.js
CHANGED
|
@@ -22,7 +22,7 @@ import NavDropdownToggle from "./NavDropdownToggle.js";
|
|
|
22
22
|
* </Nav.Menu>
|
|
23
23
|
* </Nav>
|
|
24
24
|
*/
|
|
25
|
-
const NavDropdown = /*#__PURE__*/React.forwardRef((props, ref)
|
|
25
|
+
const NavDropdown = /*#__PURE__*/React.forwardRef(function NavDropdown(props, ref) {
|
|
26
26
|
const nav = useContext(NavContext);
|
|
27
27
|
if (!nav) {
|
|
28
28
|
throw new Error('<Nav.Dropdown> must be rendered within a <Nav> component.');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '../Button';
|
|
3
|
-
import { WithAsProps, RsRefForwardingComponent,
|
|
3
|
+
import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
|
|
4
4
|
import { NavItemProps } from './NavItem';
|
|
5
5
|
export interface NavDropdownToggleProps extends WithAsProps {
|
|
6
6
|
icon?: NavItemProps['icon'];
|
|
7
7
|
noCaret?: boolean;
|
|
8
8
|
renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
|
|
9
|
-
placement?:
|
|
9
|
+
placement?: PlacementCorners;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* @private this component is not supposed to be used directly
|
package/esm/Navbar/Navbar.js
CHANGED
|
@@ -11,7 +11,7 @@ export const NavbarContext = /*#__PURE__*/React.createContext(false);
|
|
|
11
11
|
* The `Navbar` component is used to create a navigation header.
|
|
12
12
|
* @see https://rsuitejs.com/components/navbar
|
|
13
13
|
*/
|
|
14
|
-
const Navbar = /*#__PURE__*/React.forwardRef((props, ref)
|
|
14
|
+
const Navbar = /*#__PURE__*/React.forwardRef(function Navbar(props, ref) {
|
|
15
15
|
const {
|
|
16
16
|
propsWithDefaults
|
|
17
17
|
} = useCustom('Navbar', props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
import Button from '../Button';
|
|
5
5
|
import NavDropdownItem from '../Nav/NavDropdownItem';
|
|
@@ -13,7 +13,7 @@ export interface NavbarDropdownProps<T = any> extends WithAsProps, Omit<React.HT
|
|
|
13
13
|
/** Triggering events */
|
|
14
14
|
trigger?: NavbarDropdownTrigger | readonly NavbarDropdownTrigger[];
|
|
15
15
|
/** The placement of Menu */
|
|
16
|
-
placement?:
|
|
16
|
+
placement?: PlacementCorners;
|
|
17
17
|
/** Whether or not component is disabled */
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
/** The style of the menu */
|
|
@@ -14,7 +14,7 @@ import NavbarDropdownToggle from "./NavbarDropdownToggle.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
|
-
const NavbarDropdown = /*#__PURE__*/React.forwardRef((props, ref)
|
|
17
|
+
const NavbarDropdown = /*#__PURE__*/React.forwardRef(function NavbarDropdown(props, ref) {
|
|
18
18
|
const navbar = useContext(NavbarContext);
|
|
19
19
|
if (!navbar) {
|
|
20
20
|
throw new Error('<Navbar.Dropdown> should be used within a <Navbar> component.');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '../Button';
|
|
3
|
-
import { WithAsProps, RsRefForwardingComponent,
|
|
3
|
+
import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
|
|
4
4
|
export interface NavbarDropdownToggleProps extends WithAsProps {
|
|
5
5
|
noCaret?: boolean;
|
|
6
6
|
renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
|
|
7
|
-
placement?:
|
|
7
|
+
placement?: PlacementCorners;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* @private this component is not supposed to be used directly
|
package/esm/Navbar/index.js
CHANGED
|
File without changes
|
|
@@ -81,7 +81,7 @@ const RangeSlider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
81
81
|
}, [max, min]);
|
|
82
82
|
const [value, setValue] = useControlled(getValidValue(valueProp), getValidValue(defaultValue));
|
|
83
83
|
|
|
84
|
-
// The count of values
|
|
84
|
+
// The count of values that can be entered.
|
|
85
85
|
const count = useMemo(() => precisionMath((max - min) / step), [max, min, step]);
|
|
86
86
|
|
|
87
87
|
// Get the height of the progress bar
|
|
@@ -184,10 +184,10 @@ const RangeSlider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
const handleKeyDown = useEventCallback(event => {
|
|
187
|
-
|
|
187
|
+
const target = event.target;
|
|
188
188
|
const {
|
|
189
189
|
key
|
|
190
|
-
} = (
|
|
190
|
+
} = (target === null || target === void 0 ? void 0 : target.dataset) || {};
|
|
191
191
|
const nextValue = [...value];
|
|
192
192
|
const increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
193
193
|
const decreaseKey = rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
@@ -231,7 +231,7 @@ const RangeSlider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
231
231
|
let [start, end] = value;
|
|
232
232
|
const v = getValueByPosition(event);
|
|
233
233
|
|
|
234
|
-
//
|
|
234
|
+
// Judging that the current click value is closer to the values of `start` and `end`.
|
|
235
235
|
if (Math.abs(start - v) < Math.abs(end - v)) {
|
|
236
236
|
start = v;
|
|
237
237
|
} else {
|
package/esm/Rate/Character.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import
|
|
4
|
-
import React, { useCallback, useRef } from 'react';
|
|
3
|
+
import React, { useRef } from 'react';
|
|
5
4
|
import contains from 'dom-lib/contains';
|
|
6
|
-
import
|
|
5
|
+
import isNil from 'lodash/isNil';
|
|
6
|
+
import { useClassNames, useEventCallback } from "../internals/hooks/index.js";
|
|
7
7
|
const characterStatus = {
|
|
8
8
|
[0]: 'empty',
|
|
9
9
|
[0.5]: 'half',
|
|
@@ -30,13 +30,13 @@ const Character = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
30
30
|
withClassPrefix
|
|
31
31
|
} = useClassNames(classPrefix);
|
|
32
32
|
const beforeRef = useRef(null);
|
|
33
|
-
const classes = merge(className, withClassPrefix(!
|
|
34
|
-
const handleMouseMove =
|
|
33
|
+
const classes = merge(className, withClassPrefix(!isNil(status) && characterStatus[status]));
|
|
34
|
+
const handleMouseMove = useEventCallback(event => {
|
|
35
35
|
onMouseMove === null || onMouseMove === void 0 || onMouseMove(getKey(beforeRef.current, event.target), event);
|
|
36
|
-
}
|
|
37
|
-
const handleClick =
|
|
36
|
+
});
|
|
37
|
+
const handleClick = useEventCallback(event => {
|
|
38
38
|
onClick === null || onClick === void 0 || onClick(getKey(beforeRef.current, event.target), event);
|
|
39
|
-
}
|
|
39
|
+
});
|
|
40
40
|
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
41
41
|
ref: ref,
|
|
42
42
|
className: classes,
|
package/esm/Rate/Rate.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WithAsProps, TypeAttributes, RsRefForwardingComponent, FormControlBaseProps } from '../internals/types';
|
|
2
|
+
import type { WithAsProps, Color, TypeAttributes, RsRefForwardingComponent, FormControlBaseProps } from '../internals/types';
|
|
3
3
|
export interface RateProps<T = number> extends WithAsProps, FormControlBaseProps<T> {
|
|
4
4
|
allowHalf?: boolean;
|
|
5
5
|
character?: React.ReactNode;
|
|
6
6
|
classPrefix?: string;
|
|
7
7
|
cleanable?: boolean;
|
|
8
|
-
/** A
|
|
8
|
+
/** A rate can have different sizes */
|
|
9
9
|
size?: TypeAttributes.Size;
|
|
10
|
-
/** A
|
|
11
|
-
color?:
|
|
10
|
+
/** A rate can have different colors */
|
|
11
|
+
color?: Color | React.CSSProperties['color'];
|
|
12
12
|
max?: number;
|
|
13
13
|
vertical?: boolean;
|
|
14
14
|
renderCharacter?: (value: number, index: number) => React.ReactNode;
|
package/esm/Rate/Rate.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
|
4
4
|
import isNil from 'lodash/isNil';
|
|
5
5
|
import Star from '@rsuite/icons/Star';
|
|
6
6
|
import Character from "./Character.js";
|
|
7
7
|
import Plaintext from "../internals/Plaintext/index.js";
|
|
8
8
|
import { KEY_VALUES } from "../internals/constants/index.js";
|
|
9
|
-
import { useControlled, useClassNames } from "../internals/hooks/index.js";
|
|
10
|
-
import { shallowEqualArray } from "../internals/utils/index.js";
|
|
9
|
+
import { useControlled, useClassNames, useEventCallback } from "../internals/hooks/index.js";
|
|
10
|
+
import { shallowEqualArray, isPresetColor, createColorVariables, mergeStyles } from "../internals/utils/index.js";
|
|
11
11
|
import { transformValueToCharacterMap, transformCharacterMapToValue } from "./utils.js";
|
|
12
12
|
import { useCustom } from "../CustomProvider/index.js";
|
|
13
13
|
/**
|
|
@@ -34,6 +34,7 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
34
34
|
defaultValue = 0,
|
|
35
35
|
cleanable = true,
|
|
36
36
|
plaintext,
|
|
37
|
+
style,
|
|
37
38
|
onChange,
|
|
38
39
|
renderCharacter,
|
|
39
40
|
onChangeActive,
|
|
@@ -49,23 +50,23 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
49
50
|
merge,
|
|
50
51
|
withClassPrefix
|
|
51
52
|
} = useClassNames(classPrefix);
|
|
52
|
-
const classes = merge(className, withClassPrefix(size, color, {
|
|
53
|
+
const classes = merge(className, withClassPrefix(size, isPresetColor(color) && color, {
|
|
53
54
|
disabled,
|
|
54
55
|
readonly: readOnly
|
|
55
56
|
}));
|
|
57
|
+
const styles = useMemo(() => mergeStyles(style, createColorVariables(color, '--rs-rate-symbol-checked')), [style, color]);
|
|
56
58
|
const resetCharacterMap = useCallback(() => {
|
|
57
59
|
setCharacterMap(getCharacterMap());
|
|
58
60
|
}, [getCharacterMap]);
|
|
59
61
|
useEffect(() => {
|
|
60
62
|
// Update characterMap when value is updated.
|
|
61
63
|
setCharacterMap(getCharacterMap(valueProp));
|
|
62
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
64
|
}, [valueProp]);
|
|
64
|
-
const handleMouseLeave =
|
|
65
|
+
const handleMouseLeave = useEventCallback(event => {
|
|
65
66
|
resetCharacterMap();
|
|
66
67
|
onChangeActive === null || onChangeActive === void 0 || onChangeActive(value, event);
|
|
67
|
-
}
|
|
68
|
-
const handleChangeValue =
|
|
68
|
+
});
|
|
69
|
+
const handleChangeValue = useEventCallback((index, event) => {
|
|
69
70
|
let nextValue = transformCharacterMapToValue(characterMap);
|
|
70
71
|
if (cleanable && value === nextValue && getCharacterMap(value)[index] === characterMap[index]) {
|
|
71
72
|
nextValue = 0;
|
|
@@ -75,8 +76,8 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
75
76
|
setCharacterMap(getCharacterMap(nextValue));
|
|
76
77
|
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
77
78
|
}
|
|
78
|
-
}
|
|
79
|
-
const handleKeyDown =
|
|
79
|
+
});
|
|
80
|
+
const handleKeyDown = useEventCallback((index, event) => {
|
|
80
81
|
const {
|
|
81
82
|
key
|
|
82
83
|
} = event;
|
|
@@ -90,8 +91,8 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
90
91
|
if (key === KEY_VALUES.ENTER) {
|
|
91
92
|
handleChangeValue(index, event);
|
|
92
93
|
}
|
|
93
|
-
}
|
|
94
|
-
const handleChangeCharacterMap =
|
|
94
|
+
});
|
|
95
|
+
const handleChangeCharacterMap = useEventCallback((index, key, event) => {
|
|
95
96
|
const nextCharacterMap = characterMap.map((_item, i) => {
|
|
96
97
|
if (i === index && key === 'before' && allowHalf) {
|
|
97
98
|
return 0.5;
|
|
@@ -102,11 +103,11 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
102
103
|
setCharacterMap(nextCharacterMap);
|
|
103
104
|
onChangeActive === null || onChangeActive === void 0 || onChangeActive(transformCharacterMapToValue(nextCharacterMap), event);
|
|
104
105
|
}
|
|
105
|
-
}
|
|
106
|
-
const handleClick =
|
|
106
|
+
});
|
|
107
|
+
const handleClick = useEventCallback((index, key, event) => {
|
|
107
108
|
handleChangeCharacterMap(index, key, event);
|
|
108
109
|
handleChangeValue(index, event);
|
|
109
|
-
}
|
|
110
|
+
});
|
|
110
111
|
if (plaintext) {
|
|
111
112
|
return /*#__PURE__*/React.createElement(Plaintext, {
|
|
112
113
|
localeKey: "notSelected",
|
|
@@ -115,12 +116,12 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
115
116
|
}
|
|
116
117
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
117
118
|
role: "radiogroup",
|
|
118
|
-
tabIndex: 0
|
|
119
|
-
}, rest, {
|
|
119
|
+
tabIndex: 0,
|
|
120
120
|
ref: ref,
|
|
121
121
|
className: classes,
|
|
122
|
+
style: styles,
|
|
122
123
|
onMouseLeave: handleMouseLeave
|
|
123
|
-
}), characterMap.map((item, index) => /*#__PURE__*/React.createElement(Character, {
|
|
124
|
+
}, rest), characterMap.map((item, index) => /*#__PURE__*/React.createElement(Character, {
|
|
124
125
|
role: "radio",
|
|
125
126
|
"aria-posinset": index + 1,
|
|
126
127
|
"aria-setsize": max,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
export interface SidenavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle' | 'title'> {
|
|
5
5
|
/** Define the title as a submenu */
|
|
@@ -7,7 +7,7 @@ export interface SidenavDropdownProps<T = any> extends WithAsProps, Omit<React.H
|
|
|
7
7
|
/** Set the icon */
|
|
8
8
|
icon?: React.ReactElement<IconProps>;
|
|
9
9
|
/** The placement of Menu */
|
|
10
|
-
placement?:
|
|
10
|
+
placement?: PlacementCorners;
|
|
11
11
|
/** Whether or not component is disabled */
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
/** The style of the menu */
|
package/esm/Sidenav/Sidenav.js
CHANGED
|
@@ -16,7 +16,7 @@ const emptyArray = [];
|
|
|
16
16
|
* The `Sidenav` component is an encapsulation of the page sidebar `Nav`.
|
|
17
17
|
* @see https://rsuitejs.com/components/sidenav/
|
|
18
18
|
*/
|
|
19
|
-
const Sidenav = /*#__PURE__*/React.forwardRef((props, ref)
|
|
19
|
+
const Sidenav = /*#__PURE__*/React.forwardRef(function Sidenav(props, ref) {
|
|
20
20
|
const {
|
|
21
21
|
propsWithDefaults
|
|
22
22
|
} = useCustom('Sidenav', props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
4
|
import Button from '../Button';
|
|
5
5
|
import NavDropdownItem from '../Nav/NavDropdownItem';
|
|
@@ -13,7 +13,7 @@ export interface NavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLA
|
|
|
13
13
|
/** Triggering events */
|
|
14
14
|
trigger?: SidenavDropdownTrigger | readonly SidenavDropdownTrigger[];
|
|
15
15
|
/** The placement of Menu */
|
|
16
|
-
placement?:
|
|
16
|
+
placement?: PlacementCorners;
|
|
17
17
|
/** Whether or not component is disabled */
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
/** The style of the menu */
|
|
@@ -26,7 +26,7 @@ import { NavMenuContext } from "../Nav/NavMenu.js";
|
|
|
26
26
|
* </Nav>
|
|
27
27
|
* </Sidenav>
|
|
28
28
|
*/
|
|
29
|
-
const SidenavDropdown = /*#__PURE__*/React.forwardRef((props, ref)
|
|
29
|
+
const SidenavDropdown = /*#__PURE__*/React.forwardRef(function SidenavDropdown(props, ref) {
|
|
30
30
|
const sidenav = useContext(SidenavContext);
|
|
31
31
|
const nav = useContext(NavContext);
|
|
32
32
|
const navMenu = useContext(NavMenuContext);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '../Button';
|
|
3
|
-
import { WithAsProps, RsRefForwardingComponent,
|
|
3
|
+
import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
|
|
4
4
|
export interface SidenavDropdownToggleProps extends WithAsProps {
|
|
5
5
|
noCaret?: boolean;
|
|
6
6
|
renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
|
|
7
|
-
placement?:
|
|
7
|
+
placement?: PlacementCorners;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* @private this component is not supposed to be used directly
|
package/esm/Stack/HStack.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Stack from "./Stack.js";
|
|
5
|
-
const HStack = /*#__PURE__*/React.forwardRef((props, ref)
|
|
5
|
+
const HStack = /*#__PURE__*/React.forwardRef(function HStack(props, ref) {
|
|
6
6
|
const {
|
|
7
7
|
reverse,
|
|
8
8
|
spacing = 6,
|
package/esm/Stack/Stack.js
CHANGED
|
@@ -16,7 +16,7 @@ function isStackItem(child) {
|
|
|
16
16
|
*
|
|
17
17
|
* @see https://rsuitejs.com/components/stack
|
|
18
18
|
*/
|
|
19
|
-
const Stack = /*#__PURE__*/React.forwardRef((props, ref)
|
|
19
|
+
const Stack = /*#__PURE__*/React.forwardRef(function Stack(props, ref) {
|
|
20
20
|
const {
|
|
21
21
|
propsWithDefaults
|
|
22
22
|
} = useCustom('Stack', props);
|
package/esm/Stack/VStack.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Stack from "./Stack.js";
|
|
5
|
-
const VStack = /*#__PURE__*/React.forwardRef((props, ref)
|
|
5
|
+
const VStack = /*#__PURE__*/React.forwardRef(function VStack(props, ref) {
|
|
6
6
|
const {
|
|
7
7
|
reverse,
|
|
8
8
|
spacing = 6,
|
package/esm/Stat/Stat.js
CHANGED
|
@@ -8,7 +8,7 @@ import StatHelpText from "./StatHelpText.js";
|
|
|
8
8
|
import StatTrend from "./StatTrend.js";
|
|
9
9
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
10
10
|
import { useCustom } from "../CustomProvider/index.js";
|
|
11
|
-
const Stat = /*#__PURE__*/React.forwardRef((props, ref)
|
|
11
|
+
const Stat = /*#__PURE__*/React.forwardRef(function Stat(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
propsWithDefaults
|
|
14
14
|
} = useCustom('Stat', props);
|
package/esm/Steps/Steps.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
10
10
|
*
|
|
11
11
|
* @see https://rsuitejs.com/components/steps
|
|
12
12
|
*/
|
|
13
|
-
const Steps = /*#__PURE__*/React.forwardRef((props, ref)
|
|
13
|
+
const Steps = /*#__PURE__*/React.forwardRef(function Steps(props, ref) {
|
|
14
14
|
const {
|
|
15
15
|
propsWithDefaults
|
|
16
16
|
} = useCustom('Steps', props);
|
package/esm/Table/Table.js
CHANGED
|
@@ -7,7 +7,7 @@ import TableColumn from "./TableColumn.js";
|
|
|
7
7
|
import TableColumnGroup from "./TableColumnGroup.js";
|
|
8
8
|
import { useCustom } from "../CustomProvider/index.js";
|
|
9
9
|
import { Table as RsTable } from 'rsuite-table';
|
|
10
|
-
const CustomTable = /*#__PURE__*/React.forwardRef((props, ref)
|
|
10
|
+
const CustomTable = /*#__PURE__*/React.forwardRef(function Table(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
propsWithDefaults,
|
|
13
13
|
rtl,
|
|
@@ -18,7 +18,7 @@ const CustomTable = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
18
18
|
loadAnimation = true,
|
|
19
19
|
...rest
|
|
20
20
|
} = propsWithDefaults;
|
|
21
|
-
const locale = getLocale('
|
|
21
|
+
const locale = getLocale('common', overrideLocale);
|
|
22
22
|
return /*#__PURE__*/React.createElement(RsTable, _extends({}, rest, {
|
|
23
23
|
rtl: rtl,
|
|
24
24
|
ref: ref,
|
package/esm/Tabs/Tabs.js
CHANGED
|
@@ -105,7 +105,7 @@ const renderTabs = (children, tabPanelProps) => {
|
|
|
105
105
|
* @version 5.53.0
|
|
106
106
|
* @see https://rsuitejs.com/components/tabs
|
|
107
107
|
*/
|
|
108
|
-
const Tabs = /*#__PURE__*/React.forwardRef((props, ref)
|
|
108
|
+
const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
|
|
109
109
|
const {
|
|
110
110
|
propsWithDefaults,
|
|
111
111
|
rtl
|
|
@@ -163,16 +163,15 @@ const Tabs = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
163
163
|
event.preventDefault();
|
|
164
164
|
break;
|
|
165
165
|
case 'End':
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
{
|
|
167
|
+
const tabs = getFocusableTabs(tablistRef.current);
|
|
168
|
+
item = tabs[tabs.length - 1];
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
170
172
|
}
|
|
171
173
|
if (item) {
|
|
172
|
-
|
|
173
|
-
const {
|
|
174
|
-
eventKey
|
|
175
|
-
} = (_item = item) === null || _item === void 0 ? void 0 : _item.dataset;
|
|
174
|
+
const eventKey = item ? item.dataset.eventKey : undefined;
|
|
176
175
|
handleSelect(eventKey, event);
|
|
177
176
|
item.focus();
|
|
178
177
|
}
|
package/esm/Tag/Tag.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WithAsProps,
|
|
2
|
+
import type { WithAsProps, Color, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
import type { CommonLocale } from '../locales';
|
|
4
4
|
export interface TagProps extends WithAsProps {
|
|
5
5
|
/** Different sizes */
|
|
6
6
|
size?: 'lg' | 'md' | 'sm';
|
|
7
7
|
/** A tag can have different colors */
|
|
8
|
-
color?:
|
|
8
|
+
color?: Color | React.CSSProperties['color'];
|
|
9
9
|
/** Whether to close */
|
|
10
10
|
closable?: boolean;
|
|
11
11
|
/** The content of the component */
|