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
package/esm/Tag/Tag.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import CloseButton from "../internals/CloseButton/index.js";
|
|
5
5
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
6
6
|
import { useCustom } from "../CustomProvider/index.js";
|
|
7
|
+
import { mergeStyles, isPresetColor, createColorVariables } from "../internals/utils/index.js";
|
|
7
8
|
/**
|
|
8
9
|
* The `Tag` component is used to label and categorize.
|
|
9
10
|
* It can be used to mark the status of an object or classify it into different categories.
|
|
@@ -19,11 +20,12 @@ const Tag = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
19
20
|
as: Component = 'div',
|
|
20
21
|
classPrefix = 'tag',
|
|
21
22
|
size = 'md',
|
|
22
|
-
color
|
|
23
|
+
color,
|
|
23
24
|
children,
|
|
24
25
|
closable,
|
|
25
26
|
className,
|
|
26
27
|
locale: overrideLocale,
|
|
28
|
+
style,
|
|
27
29
|
onClose,
|
|
28
30
|
...rest
|
|
29
31
|
} = propsWithDefaults;
|
|
@@ -35,13 +37,15 @@ const Tag = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
35
37
|
prefix,
|
|
36
38
|
merge
|
|
37
39
|
} = useClassNames(classPrefix);
|
|
38
|
-
const classes = merge(className, withClassPrefix(size, color, {
|
|
40
|
+
const classes = merge(className, withClassPrefix(size, isPresetColor(color) && color, {
|
|
39
41
|
closable
|
|
40
42
|
}));
|
|
41
|
-
|
|
43
|
+
const styles = useMemo(() => mergeStyles(style, createColorVariables(color, '--rs-tag-bg', '--rs-tag-text')), [style, color]);
|
|
44
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
42
45
|
ref: ref,
|
|
43
|
-
className: classes
|
|
44
|
-
|
|
46
|
+
className: classes,
|
|
47
|
+
style: styles
|
|
48
|
+
}, rest), /*#__PURE__*/React.createElement("span", {
|
|
45
49
|
className: prefix`text`
|
|
46
50
|
}, children), closable && /*#__PURE__*/React.createElement(CloseButton, {
|
|
47
51
|
className: prefix`icon-close`,
|
package/esm/Timeline/Timeline.js
CHANGED
|
@@ -6,12 +6,15 @@ import TimelineItem from "./TimelineItem.js";
|
|
|
6
6
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
7
7
|
import { useCustom } from "../CustomProvider/index.js";
|
|
8
8
|
import { ReactChildren } from "../internals/utils/index.js";
|
|
9
|
+
const ACTIVE_FIRST = index => index === 0;
|
|
10
|
+
const ACTIVE_LAST = (index, totalItemsCount) => index === totalItemsCount - 1;
|
|
11
|
+
|
|
9
12
|
/**
|
|
10
13
|
* The `Timeline` component is used to display a list of items in chronological order.
|
|
11
14
|
*
|
|
12
15
|
* @see https://rsuitejs.com/components/timeline
|
|
13
16
|
*/
|
|
14
|
-
const Timeline = /*#__PURE__*/React.forwardRef((props, ref)
|
|
17
|
+
const Timeline = /*#__PURE__*/React.forwardRef(function Timeline(props, ref) {
|
|
15
18
|
const {
|
|
16
19
|
propsWithDefaults
|
|
17
20
|
} = useCustom('Timeline', props);
|
|
@@ -22,7 +25,7 @@ const Timeline = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
22
25
|
className,
|
|
23
26
|
align = 'left',
|
|
24
27
|
endless,
|
|
25
|
-
isItemActive =
|
|
28
|
+
isItemActive = ACTIVE_LAST,
|
|
26
29
|
...rest
|
|
27
30
|
} = propsWithDefaults;
|
|
28
31
|
const {
|
|
@@ -47,8 +50,8 @@ const Timeline = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
47
50
|
align
|
|
48
51
|
})));
|
|
49
52
|
});
|
|
50
|
-
Timeline.ACTIVE_FIRST = index => index === 0;
|
|
51
|
-
Timeline.ACTIVE_LAST = (index, totalItemsCount) => index === totalItemsCount - 1;
|
|
52
|
-
Timeline.Item = TimelineItem;
|
|
53
53
|
Timeline.displayName = 'Timeline';
|
|
54
|
+
Timeline.ACTIVE_FIRST = ACTIVE_FIRST;
|
|
55
|
+
Timeline.ACTIVE_LAST = ACTIVE_LAST;
|
|
56
|
+
Timeline.Item = TimelineItem;
|
|
54
57
|
export default Timeline;
|
package/esm/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Placement, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
export interface TooltipProps extends WithAsProps {
|
|
4
4
|
/** Dispaly placement */
|
|
5
|
-
placement?:
|
|
5
|
+
placement?: Placement;
|
|
6
6
|
/** Whether visible */
|
|
7
7
|
visible?: boolean;
|
|
8
8
|
/** Primary content */
|
|
@@ -77,8 +77,7 @@ function useFlattenTree(data, options) {
|
|
|
77
77
|
// when data is changed, should clear the flattenedNodes, avoid duplicate keys
|
|
78
78
|
flattenedNodes.current = {};
|
|
79
79
|
flattenTreeData(data);
|
|
80
|
-
}, [data]);
|
|
81
|
-
|
|
80
|
+
}, [data]);
|
|
82
81
|
useEffect(() => {
|
|
83
82
|
if (multiple) {
|
|
84
83
|
updateTreeNodeCheckState(value);
|
|
@@ -90,7 +89,6 @@ function useFlattenTree(data, options) {
|
|
|
90
89
|
* data may change and the node status needs to be updated.
|
|
91
90
|
* @see https://github.com/rsuite/rsuite/issues/3973
|
|
92
91
|
*/
|
|
93
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
92
|
}, [value, data]);
|
|
95
93
|
return flattenedNodes.current;
|
|
96
94
|
}
|
|
@@ -132,7 +132,6 @@ function useFocusTree(props) {
|
|
|
132
132
|
return () => {
|
|
133
133
|
unregister === null || unregister === void 0 || unregister();
|
|
134
134
|
};
|
|
135
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
135
|
}, []);
|
|
137
136
|
useEffect(() => {
|
|
138
137
|
flattenedNodesRef.current = flattenedNodes;
|
|
@@ -46,7 +46,6 @@ export default function useTreeSearch(props) {
|
|
|
46
46
|
};
|
|
47
47
|
useEffect(() => {
|
|
48
48
|
handleSearch(searchKeyword !== null && searchKeyword !== void 0 ? searchKeyword : '');
|
|
49
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
49
|
}, [searchKeyword]);
|
|
51
50
|
useEffect(() => {
|
|
52
51
|
setSearchKeyword(searchKeyword !== null && searchKeyword !== void 0 ? searchKeyword : '');
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useRef, useState, useImperativeHandle } from 'react';
|
|
3
3
|
import Button from "../Button/index.js";
|
|
4
|
-
import { useClassNames } from "../internals/hooks/index.js";
|
|
5
|
-
import { isIE11 } from "../internals/utils/index.js";
|
|
4
|
+
import { useClassNames, useEventCallback } from "../internals/hooks/index.js";
|
|
6
5
|
const UploadTrigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
6
|
const {
|
|
8
7
|
as: Component = Button,
|
|
@@ -36,55 +35,41 @@ const UploadTrigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
36
35
|
customize: children,
|
|
37
36
|
'drag-over': dragOver
|
|
38
37
|
}));
|
|
39
|
-
const handleClick =
|
|
38
|
+
const handleClick = useEventCallback(() => {
|
|
40
39
|
var _inputRef$current;
|
|
41
40
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.click();
|
|
42
|
-
}
|
|
43
|
-
const handleClearInput =
|
|
41
|
+
});
|
|
42
|
+
const handleClearInput = useEventCallback(() => {
|
|
44
43
|
if (inputRef.current) {
|
|
45
44
|
inputRef.current.value = '';
|
|
46
45
|
}
|
|
47
|
-
}
|
|
48
|
-
const handleDragEnter =
|
|
46
|
+
});
|
|
47
|
+
const handleDragEnter = useEventCallback(event => {
|
|
49
48
|
if (draggable) {
|
|
50
49
|
event.preventDefault();
|
|
51
50
|
setDragOver(true);
|
|
52
51
|
}
|
|
53
52
|
onDragEnter === null || onDragEnter === void 0 || onDragEnter(event);
|
|
54
|
-
}
|
|
55
|
-
const handleDragLeave =
|
|
53
|
+
});
|
|
54
|
+
const handleDragLeave = useEventCallback(event => {
|
|
56
55
|
if (draggable) {
|
|
57
56
|
event.preventDefault();
|
|
58
57
|
setDragOver(false);
|
|
59
58
|
}
|
|
60
59
|
onDragLeave === null || onDragLeave === void 0 || onDragLeave(event);
|
|
61
|
-
}
|
|
62
|
-
const handleDragOver =
|
|
60
|
+
});
|
|
61
|
+
const handleDragOver = useEventCallback(event => {
|
|
63
62
|
draggable && event.preventDefault();
|
|
64
63
|
onDragOver === null || onDragOver === void 0 || onDragOver(event);
|
|
65
|
-
}
|
|
66
|
-
const handleDrop =
|
|
64
|
+
});
|
|
65
|
+
const handleDrop = useEventCallback(event => {
|
|
67
66
|
if (draggable) {
|
|
68
67
|
event.preventDefault();
|
|
69
68
|
setDragOver(false);
|
|
70
69
|
onChange === null || onChange === void 0 || onChange(event);
|
|
71
70
|
}
|
|
72
71
|
onDrop === null || onDrop === void 0 || onDrop(event);
|
|
73
|
-
}
|
|
74
|
-
const handleChange = useCallback(event => {
|
|
75
|
-
if (isIE11()) {
|
|
76
|
-
var _event$target;
|
|
77
|
-
/**
|
|
78
|
-
* IE11 triggers onChange event of file input when element.value is assigned
|
|
79
|
-
* https://github.com/facebook/react/issues/8793
|
|
80
|
-
*/
|
|
81
|
-
if (((_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.files) === null || _event$target === void 0 ? void 0 : _event$target.length) > 0) {
|
|
82
|
-
onChange === null || onChange === void 0 || onChange(event);
|
|
83
|
-
}
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
onChange === null || onChange === void 0 || onChange(event);
|
|
87
|
-
}, [onChange]);
|
|
72
|
+
});
|
|
88
73
|
useImperativeHandle(ref, () => ({
|
|
89
74
|
root: rootRef.current,
|
|
90
75
|
clearInput: handleClearInput
|
|
@@ -113,7 +98,7 @@ const UploadTrigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
113
98
|
readOnly: readOnly,
|
|
114
99
|
accept: accept,
|
|
115
100
|
ref: inputRef,
|
|
116
|
-
onChange:
|
|
101
|
+
onChange: onChange
|
|
117
102
|
}), trigger);
|
|
118
103
|
});
|
|
119
104
|
UploadTrigger.displayName = 'UploadTrigger';
|
|
@@ -97,6 +97,7 @@ const Disclosure = /*#__PURE__*/React.memo(props => {
|
|
|
97
97
|
value: contextValue
|
|
98
98
|
}, children(renderProps, containerElementRef));
|
|
99
99
|
});
|
|
100
|
+
Disclosure.displayName = 'Disclosure';
|
|
100
101
|
Disclosure.Button = DisclosureButton;
|
|
101
102
|
Disclosure.Content = DisclosureContent;
|
|
102
103
|
export default Disclosure;
|
|
@@ -38,61 +38,63 @@ export function menuReducer(state, action) {
|
|
|
38
38
|
open: false
|
|
39
39
|
};
|
|
40
40
|
case MenuActionTypes.MoveFocus:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
{
|
|
42
|
+
let nextActiveItemIndex = activeItemIndex;
|
|
43
|
+
switch (action.to) {
|
|
44
|
+
case MoveFocusTo.Next:
|
|
45
|
+
for (let i = activeItemIndex === null ? 0 : activeItemIndex + 1; i < items.length; i++) {
|
|
46
|
+
var _items$i$props;
|
|
47
|
+
if (!((_items$i$props = items[i].props) !== null && _items$i$props !== void 0 && _items$i$props.disabled)) {
|
|
48
|
+
nextActiveItemIndex = i;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
break;
|
|
53
|
+
case MoveFocusTo.Prev:
|
|
54
|
+
for (let i = activeItemIndex === null ? items.length - 1 : activeItemIndex - 1; i >= 0; i--) {
|
|
55
|
+
var _items$i$props2;
|
|
56
|
+
if (!((_items$i$props2 = items[i].props) !== null && _items$i$props2 !== void 0 && _items$i$props2.disabled)) {
|
|
57
|
+
nextActiveItemIndex = i;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
break;
|
|
62
|
+
case MoveFocusTo.First:
|
|
63
|
+
for (let i = 0; i < items.length; i++) {
|
|
64
|
+
var _items$i$props3;
|
|
65
|
+
if (!((_items$i$props3 = items[i].props) !== null && _items$i$props3 !== void 0 && _items$i$props3.disabled)) {
|
|
66
|
+
nextActiveItemIndex = i;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
break;
|
|
71
|
+
case MoveFocusTo.Last:
|
|
72
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
73
|
+
var _items$i$props4;
|
|
74
|
+
if (!((_items$i$props4 = items[i].props) !== null && _items$i$props4 !== void 0 && _items$i$props4.disabled)) {
|
|
75
|
+
nextActiveItemIndex = i;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
76
78
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
break;
|
|
80
|
+
case MoveFocusTo.Specific:
|
|
81
|
+
for (let i = 0; i < items.length; i++) {
|
|
82
|
+
var _items$i$props5;
|
|
83
|
+
if (items[i].element.id === action.id && !((_items$i$props5 = items[i].props) !== null && _items$i$props5 !== void 0 && _items$i$props5.disabled)) {
|
|
84
|
+
nextActiveItemIndex = i;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
break;
|
|
89
|
+
case MoveFocusTo.None:
|
|
90
|
+
nextActiveItemIndex = null;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
...state,
|
|
95
|
+
activeItemIndex: nextActiveItemIndex
|
|
96
|
+
};
|
|
91
97
|
}
|
|
92
|
-
return {
|
|
93
|
-
...state,
|
|
94
|
-
activeItemIndex: nextActiveItemIndex
|
|
95
|
-
};
|
|
96
98
|
default:
|
|
97
99
|
return state;
|
|
98
100
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PositionChildProps } from './Position';
|
|
3
|
-
import {
|
|
3
|
+
import { Placement, AnimationEventProps, CursorPosition } from '../types';
|
|
4
4
|
export interface OverlayProps extends AnimationEventProps {
|
|
5
5
|
container?: HTMLElement | (() => HTMLElement | null) | null;
|
|
6
6
|
children: React.ReactElement | ((props: PositionChildProps & React.HTMLAttributes<HTMLElement>, ref: React.RefCallback<HTMLElement>) => React.ReactElement);
|
|
7
7
|
childrenProps?: React.HTMLAttributes<HTMLElement>;
|
|
8
8
|
className?: string;
|
|
9
9
|
containerPadding?: number;
|
|
10
|
-
placement?:
|
|
10
|
+
placement?: Placement;
|
|
11
11
|
preventOverflow?: boolean;
|
|
12
12
|
open?: boolean;
|
|
13
13
|
rootClose?: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { AnimationEventProps, StandardProps,
|
|
3
|
+
import type { AnimationEventProps, StandardProps, Placement } from '../types';
|
|
4
4
|
import type { PositionChildProps } from './Position';
|
|
5
5
|
export type OverlayTriggerType = 'click' | 'hover' | 'focus' | 'active' | 'contextMenu' | 'none';
|
|
6
6
|
export interface OverlayTriggerProps extends Omit<StandardProps, 'children'>, AnimationEventProps {
|
|
7
7
|
/** Triggering events */
|
|
8
8
|
trigger?: OverlayTriggerType | OverlayTriggerType[];
|
|
9
9
|
/** Display placement */
|
|
10
|
-
placement?:
|
|
10
|
+
placement?: Placement;
|
|
11
11
|
/** Delay time */
|
|
12
12
|
delay?: number;
|
|
13
13
|
/** Open delay time */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CursorPosition,
|
|
2
|
+
import { CursorPosition, Placement } from '../types';
|
|
3
3
|
export interface PositionChildProps {
|
|
4
4
|
className: string;
|
|
5
5
|
left?: number;
|
|
@@ -12,7 +12,7 @@ export interface PositionProps {
|
|
|
12
12
|
className?: string;
|
|
13
13
|
container?: HTMLElement | (() => HTMLElement | null) | null;
|
|
14
14
|
containerPadding?: number;
|
|
15
|
-
placement?:
|
|
15
|
+
placement?: Placement;
|
|
16
16
|
preventOverflow?: boolean;
|
|
17
17
|
triggerTarget?: React.RefObject<any>;
|
|
18
18
|
followCursor?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CursorPosition,
|
|
1
|
+
import { CursorPosition, Placement } from '../types';
|
|
2
2
|
type Offset = {
|
|
3
3
|
top: number;
|
|
4
4
|
left: number;
|
|
@@ -13,7 +13,7 @@ export interface PositionType {
|
|
|
13
13
|
positionClassName?: string;
|
|
14
14
|
}
|
|
15
15
|
export interface UtilProps {
|
|
16
|
-
placement:
|
|
16
|
+
placement: Placement;
|
|
17
17
|
preventOverflow: boolean;
|
|
18
18
|
padding: number;
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ToggleButton, { ToggleButtonProps } from './ToggleButton';
|
|
3
|
-
import { RsRefForwardingComponent,
|
|
3
|
+
import { RsRefForwardingComponent, Placement, DataItemValue } from '../types';
|
|
4
4
|
import { IconProps } from '@rsuite/icons/Icon';
|
|
5
5
|
export interface PickerToggleProps<T = DataItemValue> extends ToggleButtonProps {
|
|
6
6
|
active?: boolean;
|
|
@@ -17,7 +17,7 @@ export interface PickerToggleProps<T = DataItemValue> extends ToggleButtonProps
|
|
|
17
17
|
*/
|
|
18
18
|
caretAs?: React.ElementType;
|
|
19
19
|
disabled?: boolean;
|
|
20
|
-
placement?:
|
|
20
|
+
placement?: Placement;
|
|
21
21
|
readOnly?: boolean;
|
|
22
22
|
plaintext?: boolean;
|
|
23
23
|
tabIndex?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OverlayTriggerHandle, OverlayTriggerProps, OverlayTriggerType } from '../Overlay/OverlayTrigger';
|
|
3
3
|
import { PositionChildProps } from '../Overlay/Position';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Placement, AnimationEventProps } from '../types';
|
|
5
5
|
export type { OverlayTriggerHandle, PositionChildProps };
|
|
6
6
|
export interface PickerToggleTriggerProps extends Omit<AnimationEventProps, 'onEntering' | 'onExiting'>, Pick<OverlayTriggerProps, 'speaker' | 'onOpen' | 'onClose'> {
|
|
7
7
|
id?: string;
|
|
@@ -12,7 +12,7 @@ export interface PickerToggleTriggerProps extends Omit<AnimationEventProps, 'onE
|
|
|
12
12
|
*/
|
|
13
13
|
popupType?: 'listbox' | 'tree' | 'grid' | 'dialog' | 'menu';
|
|
14
14
|
multiple?: boolean;
|
|
15
|
-
placement?:
|
|
15
|
+
placement?: Placement;
|
|
16
16
|
pickerProps: any;
|
|
17
17
|
open?: boolean;
|
|
18
18
|
trigger?: OverlayTriggerType | OverlayTriggerType[];
|
|
@@ -78,7 +78,7 @@ const useFocusItemValue = (defaultFocusItemValue, props) => {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// 1. It is necessary to traverse the `keys` instead of `data` here to preserve the order of the array.
|
|
81
|
-
// 2. The values
|
|
81
|
+
// 2. The values in `keys` are all string, so the corresponding value of `data` should also be converted to string
|
|
82
82
|
return currentKeys.map(key => find(data, i => `${i[valueKey]}` === key));
|
|
83
83
|
};
|
|
84
84
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Placement } from '../../types';
|
|
2
2
|
export interface PickerClassNameProps {
|
|
3
3
|
name?: string;
|
|
4
4
|
classPrefix: string;
|
|
5
5
|
className?: string;
|
|
6
|
-
placement?:
|
|
6
|
+
placement?: Placement;
|
|
7
7
|
appearance?: 'default' | 'subtle';
|
|
8
8
|
cleanable?: boolean;
|
|
9
9
|
block?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare function useScrollState(scrollShadow?: boolean): {
|
|
3
|
-
scrollState: "
|
|
3
|
+
scrollState: "bottom" | "top" | "middle" | null;
|
|
4
4
|
handleScroll: ((...args: any[]) => any) | undefined;
|
|
5
5
|
bodyRef: import("react").RefObject<HTMLDivElement>;
|
|
6
6
|
};
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import useCombobox from "../Picker/hooks/useCombobox.js";
|
|
5
5
|
import ScrollView from "../ScrollView/index.js";
|
|
6
6
|
import { useTreeContextProps } from "./TreeProvider.js";
|
|
7
|
-
const ScrollShadowView = /*#__PURE__*/React.forwardRef((props, ref)
|
|
7
|
+
const ScrollShadowView = /*#__PURE__*/React.forwardRef(function ScrollShadowView(props, ref) {
|
|
8
8
|
return /*#__PURE__*/React.createElement(ScrollView, _extends({
|
|
9
9
|
scrollShadow: true,
|
|
10
10
|
ref: ref
|
|
@@ -49,4 +49,5 @@ const TreeView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
49
49
|
className: treeRootClassName
|
|
50
50
|
}, children));
|
|
51
51
|
});
|
|
52
|
+
TreeView.displayName = 'TreeView';
|
|
52
53
|
export default TreeView;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export function getPathTowardsItem(target, getParent) {
|
|
6
6
|
if (!target) return [];
|
|
7
7
|
const path = [target];
|
|
8
|
-
for (let parent = getParent(target);
|
|
8
|
+
for (let parent = getParent(target); parent; parent = getParent(parent)) {
|
|
9
9
|
path.unshift(parent);
|
|
10
10
|
}
|
|
11
11
|
return path;
|
|
@@ -5,7 +5,7 @@ import ScrollView from "../ScrollView/index.js";
|
|
|
5
5
|
import { VariableSizeList } from 'react-window';
|
|
6
6
|
import { useCustom } from "../../CustomProvider/index.js";
|
|
7
7
|
export const defaultItemSize = () => 36;
|
|
8
|
-
const OuterElementType = /*#__PURE__*/React.forwardRef((props, ref)
|
|
8
|
+
const OuterElementType = /*#__PURE__*/React.forwardRef(function OuterElementType(props, ref) {
|
|
9
9
|
return /*#__PURE__*/React.createElement(ScrollView, _extends({
|
|
10
10
|
scrollShadow: true,
|
|
11
11
|
ref: ref
|
|
@@ -70,4 +70,5 @@ const List = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
70
70
|
outerElementType: scrollShadow ? OuterElementType : undefined
|
|
71
71
|
}));
|
|
72
72
|
});
|
|
73
|
+
List.displayName = 'List';
|
|
73
74
|
export default List;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type ClassValue = string | number | ClassDictionary | ClassArray | undefined | null | boolean;
|
|
2
|
-
export
|
|
3
|
-
}
|
|
2
|
+
export type ClassArray = Array<ClassValue>;
|
|
4
3
|
export interface ClassDictionary {
|
|
5
4
|
[id: string]: any;
|
|
6
5
|
}
|
|
@@ -7,8 +7,6 @@ import { CustomContext } from "../../CustomProvider/CustomProvider.js";
|
|
|
7
7
|
// This is the only way I found to break circular references between ClassArray and ClassValue
|
|
8
8
|
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
9
9
|
|
|
10
|
-
//eslint-disable-line @typescript-eslint/no-empty-interface
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* Add a prefix to all classNames.
|
|
14
12
|
*
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import canUseDOM from 'dom-lib/canUseDOM';
|
|
6
|
-
const MountedPortal = /*#__PURE__*/React.memo(_ref
|
|
6
|
+
const MountedPortal = /*#__PURE__*/React.memo(function MountedPortal(_ref) {
|
|
7
7
|
let {
|
|
8
8
|
children,
|
|
9
9
|
container
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare function useToggleCaret(placement:
|
|
2
|
+
import { PlacementCorners, Placement } from '../types';
|
|
3
|
+
export declare function useToggleCaret(placement: PlacementCorners | Placement): import("react").ForwardRefExoticComponent<import("@rsuite/icons/esm/Icon").IconProps & import("react").RefAttributes<SVGElement>>;
|
|
4
4
|
export default useToggleCaret;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
+
import { useCustom } from "../../CustomProvider/index.js";
|
|
3
4
|
import ArrowUpLineIcon from '@rsuite/icons/ArrowUpLine';
|
|
4
5
|
import ArrowDownLineIcon from '@rsuite/icons/ArrowDownLine';
|
|
5
6
|
import ArrowLeftLineIcon from '@rsuite/icons/ArrowLeftLine';
|
|
6
7
|
import ArrowRightLineIcon from '@rsuite/icons/ArrowRightLine';
|
|
7
|
-
import { useCustom } from "../../CustomProvider/index.js";
|
|
8
8
|
export function useToggleCaret(placement) {
|
|
9
9
|
const {
|
|
10
10
|
rtl
|
|
@@ -10,8 +10,6 @@ import { useEffect } from 'react';
|
|
|
10
10
|
*/
|
|
11
11
|
export function useWillUnmount(fn) {
|
|
12
12
|
const onUnmount = useUpdatedRef(fn);
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15
13
|
useEffect(() => () => onUnmount.current(), []);
|
|
16
14
|
}
|
|
17
15
|
export default useWillUnmount;
|
package/esm/internals/symbols.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
export const RSUITE_PICKER_TYPE = Symbol.for('rsuite.picker');
|
|
3
|
-
export const RSUITE_PICKER_GROUP_KEY = Symbol.for('rsuite.picker_group_key');
|
|
3
|
+
export const RSUITE_PICKER_GROUP_KEY = Symbol.for('rsuite.picker_group_key');
|
|
4
|
+
export const RSUITE_TOASTER_ID = Symbol.for('rsuite.toaster_id');
|