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
|
@@ -8,7 +8,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
8
8
|
* The `Accordion` component is used to display content that can be collapsed.
|
|
9
9
|
* @see https://rsuitejs.com/components/accordion
|
|
10
10
|
*/
|
|
11
|
-
const Accordion = /*#__PURE__*/React.forwardRef((props, ref)
|
|
11
|
+
const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
propsWithDefaults
|
|
14
14
|
} = useCustom('Accordion', props);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PickerComponent } from '../internals/Picker';
|
|
3
|
-
import { WithAsProps, FormControlPickerProps, TypeAttributes, ItemDataType } from '../internals/types';
|
|
3
|
+
import { WithAsProps, FormControlPickerProps, TypeAttributes, Placement, ItemDataType } from '../internals/types';
|
|
4
4
|
export interface AutoCompleteProps<T = string> extends WithAsProps, FormControlPickerProps<T, any, ItemDataType | string> {
|
|
5
5
|
/** Additional classes for menu */
|
|
6
6
|
menuClassName?: string;
|
|
7
7
|
/** The placement of component */
|
|
8
|
-
placement?:
|
|
8
|
+
placement?: Placement;
|
|
9
9
|
/** When set to false, the Enter key selection function is invalid */
|
|
10
10
|
selectOnEnter?: boolean;
|
|
11
11
|
/** A component can have different sizes */
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useCombobox } from "../internals/Picker/index.js";
|
|
5
5
|
import Input from "../Input/index.js";
|
|
6
|
-
const Combobox = /*#__PURE__*/React.forwardRef((props, ref)
|
|
6
|
+
const Combobox = /*#__PURE__*/React.forwardRef(function Combobox(props, ref) {
|
|
7
7
|
const {
|
|
8
8
|
id,
|
|
9
9
|
popupType
|
package/esm/Badge/Badge.d.ts
CHANGED
|
@@ -1,12 +1,47 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WithAsProps,
|
|
2
|
+
import { Color, WithAsProps, PlacementCorners, RsRefForwardingComponent } from '../internals/types';
|
|
3
3
|
export interface BadgeProps extends WithAsProps {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The content of the badge
|
|
6
|
+
*/
|
|
5
7
|
content?: React.ReactNode;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The maximum value of the badge
|
|
10
|
+
*/
|
|
7
11
|
maxCount?: number;
|
|
8
|
-
/**
|
|
9
|
-
|
|
12
|
+
/**
|
|
13
|
+
* A badge can have different colors
|
|
14
|
+
*/
|
|
15
|
+
color?: Color | React.CSSProperties['color'];
|
|
16
|
+
/**
|
|
17
|
+
* The badge will have an outline
|
|
18
|
+
* @version 6.0.0
|
|
19
|
+
*/
|
|
20
|
+
outline?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The placement of the badge
|
|
23
|
+
* @version 6.0.0
|
|
24
|
+
*/
|
|
25
|
+
placement?: PlacementCorners;
|
|
26
|
+
/**
|
|
27
|
+
* If true, the Badge will have no padding, making it appear more compact and rounded.
|
|
28
|
+
*/
|
|
29
|
+
compact?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The shape of the wrapped element
|
|
32
|
+
* @version 6.0.0
|
|
33
|
+
*/
|
|
34
|
+
shape?: 'rectangle' | 'circle';
|
|
35
|
+
/**
|
|
36
|
+
* Define the horizontal and vertical offset of the badge relative to its wrapped element
|
|
37
|
+
* @version 6.0.0
|
|
38
|
+
*/
|
|
39
|
+
offset?: [number | string, number | string];
|
|
40
|
+
/**
|
|
41
|
+
* The badge will be hidden
|
|
42
|
+
* @version 6.0.0
|
|
43
|
+
*/
|
|
44
|
+
invisible?: boolean;
|
|
10
45
|
}
|
|
11
46
|
/**
|
|
12
47
|
* The Badge component is usually used to mark or highlight the status or quantity of an object.
|
package/esm/Badge/Badge.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
import kebabCase from 'lodash/kebabCase';
|
|
4
5
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
6
|
+
import { mergeStyles, createOffsetStyles, isPresetColor, createColorVariables } from "../internals/utils/index.js";
|
|
5
7
|
import { useCustom } from "../CustomProvider/index.js";
|
|
6
8
|
/**
|
|
7
9
|
* The Badge component is usually used to mark or highlight the status or quantity of an object.
|
|
@@ -13,12 +15,19 @@ const Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
13
15
|
} = useCustom('Badge', props);
|
|
14
16
|
const {
|
|
15
17
|
as: Component = 'div',
|
|
16
|
-
content
|
|
18
|
+
content,
|
|
17
19
|
color,
|
|
18
20
|
className,
|
|
19
21
|
classPrefix = 'badge',
|
|
20
22
|
children,
|
|
23
|
+
compact,
|
|
21
24
|
maxCount = 99,
|
|
25
|
+
offset,
|
|
26
|
+
outline = true,
|
|
27
|
+
placement = 'topEnd',
|
|
28
|
+
shape,
|
|
29
|
+
style,
|
|
30
|
+
invisible,
|
|
22
31
|
...rest
|
|
23
32
|
} = propsWithDefaults;
|
|
24
33
|
const {
|
|
@@ -26,30 +35,30 @@ const Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
26
35
|
prefix,
|
|
27
36
|
merge
|
|
28
37
|
} = useClassNames(classPrefix);
|
|
29
|
-
const
|
|
30
|
-
const classes = merge(className, withClassPrefix(color, {
|
|
31
|
-
|
|
38
|
+
const text = typeof content === 'number' && content > maxCount ? `${maxCount}+` : content;
|
|
39
|
+
const classes = merge(className, withClassPrefix(isPresetColor(color) && color, shape, {
|
|
40
|
+
compact,
|
|
41
|
+
outline,
|
|
42
|
+
hidden: invisible,
|
|
32
43
|
wrapper: children,
|
|
33
|
-
|
|
44
|
+
independent: !children,
|
|
45
|
+
[kebabCase(placement)]: children
|
|
34
46
|
}));
|
|
35
|
-
|
|
36
|
-
return /*#__PURE__*/React.cloneElement(children, {
|
|
37
|
-
ref
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
const content = typeof contentText === 'number' && contentText > maxCount ? `${maxCount}+` : contentText;
|
|
47
|
+
const styles = useMemo(() => mergeStyles(style, createOffsetStyles(offset, '--rs-badge-offset'), createColorVariables(color, '--rs-badge-bg')), [style, offset, color]);
|
|
41
48
|
if (!children) {
|
|
42
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
49
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
43
50
|
ref: ref,
|
|
44
|
-
className: classes
|
|
45
|
-
|
|
51
|
+
className: classes,
|
|
52
|
+
style: styles
|
|
53
|
+
}, rest), text);
|
|
46
54
|
}
|
|
47
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
55
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
48
56
|
ref: ref,
|
|
49
|
-
className: classes
|
|
50
|
-
|
|
57
|
+
className: classes,
|
|
58
|
+
style: styles
|
|
59
|
+
}, rest), children, /*#__PURE__*/React.createElement("div", {
|
|
51
60
|
className: prefix('content')
|
|
52
|
-
},
|
|
61
|
+
}, text));
|
|
53
62
|
});
|
|
54
63
|
Badge.displayName = 'Badge';
|
|
55
64
|
export default Badge;
|
|
@@ -15,7 +15,7 @@ const Separator = createComponent({
|
|
|
15
15
|
* The Breadcrumb component is used to indicate the current page location and navigate.
|
|
16
16
|
* @see https://rsuitejs.com/components/breadcrumb
|
|
17
17
|
*/
|
|
18
|
-
const Breadcrumb = /*#__PURE__*/React.forwardRef((props, ref)
|
|
18
|
+
const Breadcrumb = /*#__PURE__*/React.forwardRef(function Breadcrumb(props, ref) {
|
|
19
19
|
const {
|
|
20
20
|
propsWithDefaults
|
|
21
21
|
} = useCustom('Breadcrumb', props);
|
package/esm/Button/Button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
|
-
export interface ButtonProps extends WithAsProps, React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
export interface ButtonProps extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle'> {
|
|
4
4
|
/** A button can have different appearances. */
|
|
5
5
|
appearance?: TypeAttributes.Appearance;
|
|
6
6
|
/** A button can show it is currently the active user selection */
|
|
@@ -27,6 +27,10 @@ export interface ButtonProps extends WithAsProps, React.HTMLAttributes<HTMLEleme
|
|
|
27
27
|
endIcon?: React.ReactNode;
|
|
28
28
|
/** Defines HTML button type attribute */
|
|
29
29
|
type?: 'button' | 'reset' | 'submit';
|
|
30
|
+
/** A button can toggle its state between active and inactive. */
|
|
31
|
+
toggleable?: boolean;
|
|
32
|
+
/** Called when the button is clicked */
|
|
33
|
+
onToggle?: (active: boolean, event: React.MouseEvent) => void;
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* The Button component is used to trigger a custom action.
|
package/esm/Button/Button.js
CHANGED
|
@@ -5,7 +5,7 @@ import Ripple from "../internals/Ripple/index.js";
|
|
|
5
5
|
import SafeAnchor from "../SafeAnchor/index.js";
|
|
6
6
|
import { ButtonGroupContext } from "../ButtonGroup/index.js";
|
|
7
7
|
import { isOneOf } from "../internals/utils/index.js";
|
|
8
|
-
import { useClassNames } from "../internals/hooks/index.js";
|
|
8
|
+
import { useClassNames, useControlled, useEventCallback } from "../internals/hooks/index.js";
|
|
9
9
|
import { useCustom } from "../CustomProvider/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* The Button component is used to trigger a custom action.
|
|
@@ -17,7 +17,7 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
17
17
|
} = useCustom('Button', props);
|
|
18
18
|
const {
|
|
19
19
|
as,
|
|
20
|
-
active,
|
|
20
|
+
active: activeProp,
|
|
21
21
|
appearance = 'default',
|
|
22
22
|
block,
|
|
23
23
|
className,
|
|
@@ -31,8 +31,12 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
31
31
|
startIcon,
|
|
32
32
|
endIcon,
|
|
33
33
|
type: typeProp,
|
|
34
|
+
toggleable,
|
|
35
|
+
onToggle,
|
|
36
|
+
onClick,
|
|
34
37
|
...rest
|
|
35
38
|
} = propsWithDefaults;
|
|
39
|
+
const [active, setActive] = useControlled(activeProp, false);
|
|
36
40
|
const buttonGroup = useContext(ButtonGroupContext);
|
|
37
41
|
const size = sizeProp !== null && sizeProp !== void 0 ? sizeProp : buttonGroup === null || buttonGroup === void 0 ? void 0 : buttonGroup.size;
|
|
38
42
|
const {
|
|
@@ -57,13 +61,22 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
57
61
|
className: prefix`end-icon`
|
|
58
62
|
}, endIcon) : null, rippleElement);
|
|
59
63
|
}, [appearance, children, endIcon, loading, prefix, ripple, startIcon]);
|
|
64
|
+
const handleClick = useEventCallback(event => {
|
|
65
|
+
if (toggleable) {
|
|
66
|
+
const nextActive = !active;
|
|
67
|
+
setActive(nextActive);
|
|
68
|
+
onToggle === null || onToggle === void 0 || onToggle(nextActive, event);
|
|
69
|
+
}
|
|
70
|
+
onClick === null || onClick === void 0 || onClick(event);
|
|
71
|
+
});
|
|
60
72
|
if (rest.href) {
|
|
61
73
|
return /*#__PURE__*/React.createElement(SafeAnchor, _extends({}, rest, {
|
|
62
74
|
as: as,
|
|
63
75
|
ref: ref,
|
|
64
76
|
"aria-disabled": disabled,
|
|
65
77
|
disabled: disabled,
|
|
66
|
-
className: classes
|
|
78
|
+
className: classes,
|
|
79
|
+
onClick: handleClick
|
|
67
80
|
}), buttonContent);
|
|
68
81
|
}
|
|
69
82
|
const Component = as || 'button';
|
|
@@ -75,7 +88,8 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
75
88
|
ref: ref,
|
|
76
89
|
disabled: disabled,
|
|
77
90
|
"aria-disabled": disabled,
|
|
78
|
-
className: classes
|
|
91
|
+
className: classes,
|
|
92
|
+
onClick: handleClick
|
|
79
93
|
}), buttonContent);
|
|
80
94
|
});
|
|
81
95
|
Button.displayName = 'Button';
|
package/esm/Card/Card.js
CHANGED
|
@@ -6,7 +6,7 @@ import CardBody from "./CardBody.js";
|
|
|
6
6
|
import CardFooter from "./CardFooter.js";
|
|
7
7
|
import { useCustom } from "../CustomProvider/index.js";
|
|
8
8
|
import { useClassNames } from "../internals/hooks/index.js";
|
|
9
|
-
const Card = /*#__PURE__*/React.forwardRef((props, ref)
|
|
9
|
+
const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
|
|
10
10
|
const {
|
|
11
11
|
propsWithDefaults
|
|
12
12
|
} = useCustom('Card', props);
|
package/esm/CascadeTree/utils.js
CHANGED
|
@@ -28,7 +28,7 @@ export function getColumnsAndPaths(items, pathTarget, options) {
|
|
|
28
28
|
if (children && children.length > 0) {
|
|
29
29
|
columns.unshift(children);
|
|
30
30
|
}
|
|
31
|
-
for (let parent = getParent(pathTarget);
|
|
31
|
+
for (let parent = getParent(pathTarget); parent; parent = getParent(parent)) {
|
|
32
32
|
var _getChildren;
|
|
33
33
|
columns.unshift((_getChildren = getChildren(parent)) !== null && _getChildren !== void 0 ? _getChildren : []);
|
|
34
34
|
path.unshift(parent);
|
|
@@ -143,7 +143,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
143
143
|
formattedDayPattern: string;
|
|
144
144
|
shortDateFormat: string;
|
|
145
145
|
shortTimeFormat: string;
|
|
146
|
-
dateLocale: any;
|
|
146
|
+
dateLocale: any; /**
|
|
147
|
+
* The prefix of the component CSS class
|
|
148
|
+
*/
|
|
147
149
|
} | undefined;
|
|
148
150
|
Calendar?: {
|
|
149
151
|
sunday: string;
|
|
@@ -164,7 +166,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
164
166
|
formattedDayPattern: string;
|
|
165
167
|
shortDateFormat: string;
|
|
166
168
|
shortTimeFormat: string;
|
|
167
|
-
dateLocale: any;
|
|
169
|
+
dateLocale: any; /**
|
|
170
|
+
* The prefix of the component CSS class
|
|
171
|
+
*/
|
|
168
172
|
} | undefined;
|
|
169
173
|
DatePicker?: {
|
|
170
174
|
sunday: string;
|
|
@@ -185,7 +189,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
185
189
|
formattedDayPattern: string;
|
|
186
190
|
shortDateFormat: string;
|
|
187
191
|
shortTimeFormat: string;
|
|
188
|
-
dateLocale: any;
|
|
192
|
+
dateLocale: any; /**
|
|
193
|
+
* The prefix of the component CSS class
|
|
194
|
+
*/
|
|
189
195
|
} | undefined;
|
|
190
196
|
DateRangePicker?: {
|
|
191
197
|
last7Days: string;
|
|
@@ -207,7 +213,9 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
207
213
|
formattedDayPattern: string;
|
|
208
214
|
shortDateFormat: string;
|
|
209
215
|
shortTimeFormat: string;
|
|
210
|
-
dateLocale: any;
|
|
216
|
+
dateLocale: any; /**
|
|
217
|
+
* The prefix of the component CSS class
|
|
218
|
+
*/
|
|
211
219
|
} | undefined;
|
|
212
220
|
Combobox?: {
|
|
213
221
|
noResultsText: string;
|
|
@@ -4,7 +4,7 @@ import IconProvider from '@rsuite/icons/IconProvider';
|
|
|
4
4
|
import { usePortal, useIsomorphicLayoutEffect } from "../internals/hooks/index.js";
|
|
5
5
|
import { getClassNamePrefix, prefix } from "../internals/utils/prefix.js";
|
|
6
6
|
import { addClass, removeClass, canUseDOM } from "../DOMHelper/index.js";
|
|
7
|
-
import ToastContainer, { toastPlacements } from "../toaster/ToastContainer.js";
|
|
7
|
+
import ToastContainer, { toastPlacements, defaultToasterContainer } from "../toaster/ToastContainer.js";
|
|
8
8
|
export const CustomContext = /*#__PURE__*/React.createContext({});
|
|
9
9
|
const themes = ['light', 'dark', 'high-contrast'];
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ export default function CustomProvider(props) {
|
|
|
20
20
|
components,
|
|
21
21
|
iconClassPrefix = classPrefix,
|
|
22
22
|
theme,
|
|
23
|
-
toastContainer
|
|
23
|
+
toastContainer = defaultToasterContainer,
|
|
24
24
|
disableRipple,
|
|
25
25
|
csp,
|
|
26
26
|
disableInlineStyles,
|
|
@@ -30,7 +30,7 @@ export default function CustomProvider(props) {
|
|
|
30
30
|
const {
|
|
31
31
|
Portal
|
|
32
32
|
} = usePortal({
|
|
33
|
-
container,
|
|
33
|
+
container: toastContainer,
|
|
34
34
|
waitMount: true
|
|
35
35
|
});
|
|
36
36
|
const value = useMemo(() => ({
|
|
@@ -39,8 +39,9 @@ export default function CustomProvider(props) {
|
|
|
39
39
|
toasters,
|
|
40
40
|
disableRipple,
|
|
41
41
|
components,
|
|
42
|
+
toastContainer,
|
|
42
43
|
...rest
|
|
43
|
-
}), [classPrefix, theme, disableRipple, components, rest]);
|
|
44
|
+
}), [classPrefix, theme, disableRipple, components, toastContainer, rest]);
|
|
44
45
|
const iconContext = useMemo(() => ({
|
|
45
46
|
classPrefix: iconClassPrefix,
|
|
46
47
|
csp,
|
|
@@ -41,15 +41,17 @@ export function useDateInputState(_ref) {
|
|
|
41
41
|
value = addMonths(new Date(year, month), offset).getMonth() + 1;
|
|
42
42
|
break;
|
|
43
43
|
case 'd':
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
{
|
|
45
|
+
actionName = 'setDay';
|
|
46
|
+
const prevDate = new Date(year, month, day);
|
|
47
|
+
value = addDays(prevDate, offset).getDate();
|
|
48
|
+
if (offset > 0) {
|
|
49
|
+
value = isLastDayOfMonth(prevDate) ? 1 : value;
|
|
50
|
+
} else {
|
|
51
|
+
value = prevDate.getDate() === 1 ? lastDayOfMonth(prevDate).getDate() : value;
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
51
54
|
}
|
|
52
|
-
break;
|
|
53
55
|
case 'H':
|
|
54
56
|
case 'h':
|
|
55
57
|
actionName = 'setHour';
|
|
@@ -29,6 +29,7 @@ export function useKeyboardInputEvent(_ref) {
|
|
|
29
29
|
// Allow numeric keys to be entered
|
|
30
30
|
onSegmentValueChangeWithNumericKeys === null || onSegmentValueChangeWithNumericKeys === void 0 || onSegmentValueChangeWithNumericKeys(event);
|
|
31
31
|
event.preventDefault();
|
|
32
|
+
break;
|
|
32
33
|
case (_key$match2 = key.match(/[a-z]/)) === null || _key$match2 === void 0 ? void 0 : _key$match2[0]:
|
|
33
34
|
// Determine whether the Ctrl or Command key is pressed, does not affect user copy and paste
|
|
34
35
|
if (event.ctrlKey || event.metaKey) {
|
|
@@ -5,7 +5,7 @@ import Button from "../Button/index.js";
|
|
|
5
5
|
import Stack from "../Stack/index.js";
|
|
6
6
|
import { useUpdateEffect } from "../internals/hooks/index.js";
|
|
7
7
|
import { getDefaultRanges, getRanges } from "./utils.js";
|
|
8
|
-
const PredefinedRanges = /*#__PURE__*/React.forwardRef((props, ref)
|
|
8
|
+
const PredefinedRanges = /*#__PURE__*/React.forwardRef(function PredefinedRanges(props, ref) {
|
|
9
9
|
const {
|
|
10
10
|
className,
|
|
11
11
|
disableShortcut,
|
|
@@ -28,7 +28,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
28
28
|
*
|
|
29
29
|
* @see https://rsuitejs.com/components/date-range-picker
|
|
30
30
|
*/
|
|
31
|
-
const DateRangePicker = /*#__PURE__*/React.forwardRef((props, ref)
|
|
31
|
+
const DateRangePicker = /*#__PURE__*/React.forwardRef(function DateRangePicker(props, ref) {
|
|
32
32
|
var _ref, _ref2;
|
|
33
33
|
const {
|
|
34
34
|
formatDate,
|
package/esm/Drawer/Drawer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ModalProps } from '../Modal';
|
|
3
|
-
import {
|
|
3
|
+
import { PlacementCardinal } from '../internals/types';
|
|
4
4
|
import DrawerBody from './DrawerBody';
|
|
5
5
|
import DrawerHeader from './DrawerHeader';
|
|
6
6
|
import DrawerActions from './DrawerActions';
|
|
@@ -8,7 +8,7 @@ import DrawerFooter from './DrawerFooter';
|
|
|
8
8
|
import DrawerTitle from './DrawerTitle';
|
|
9
9
|
export interface DrawerProps extends Omit<ModalProps, 'overflow'> {
|
|
10
10
|
/** The placement of Drawer */
|
|
11
|
-
placement?:
|
|
11
|
+
placement?: PlacementCardinal;
|
|
12
12
|
/** Custom close button */
|
|
13
13
|
closeButton?: React.ReactNode | boolean;
|
|
14
14
|
}
|
package/esm/Drawer/Drawer.js
CHANGED
|
@@ -15,7 +15,7 @@ import DrawerTitle from "./DrawerTitle.js";
|
|
|
15
15
|
* The Drawer component is used to display extra content from a main content.
|
|
16
16
|
* @see https://rsuitejs.com/components/drawer
|
|
17
17
|
*/
|
|
18
|
-
const Drawer = /*#__PURE__*/React.forwardRef((props, ref)
|
|
18
|
+
const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(props, ref) {
|
|
19
19
|
const {
|
|
20
20
|
propsWithDefaults
|
|
21
21
|
} = useCustom('Drawer', props);
|
package/esm/Drawer/DrawerBody.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import ModalBody from "../Modal/ModalBody.js";
|
|
5
|
-
const DrawerBody = /*#__PURE__*/React.forwardRef((props, ref)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const DrawerBody = /*#__PURE__*/React.forwardRef(function DrawerBody(props, ref) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(ModalBody, _extends({
|
|
7
|
+
classPrefix: "drawer-body"
|
|
8
|
+
}, props, {
|
|
9
|
+
ref: ref
|
|
10
|
+
}));
|
|
11
|
+
});
|
|
10
12
|
export default DrawerBody;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import ModalFooter from "../Modal/ModalFooter.js";
|
|
5
|
-
const DrawerFooter = /*#__PURE__*/React.forwardRef((props, ref)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const DrawerFooter = /*#__PURE__*/React.forwardRef(function DrawerFooter(props, ref) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(ModalFooter, _extends({
|
|
7
|
+
classPrefix: "drawer-footer"
|
|
8
|
+
}, props, {
|
|
9
|
+
ref: ref
|
|
10
|
+
}));
|
|
11
|
+
});
|
|
10
12
|
export default DrawerFooter;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import ModalHeader from "../Modal/ModalHeader.js";
|
|
5
|
-
const DrawerHeader = /*#__PURE__*/React.forwardRef((props, ref)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const DrawerHeader = /*#__PURE__*/React.forwardRef(function DrawerHeader(props, ref) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(ModalHeader, _extends({
|
|
7
|
+
classPrefix: "drawer-header"
|
|
8
|
+
}, props, {
|
|
9
|
+
ref: ref
|
|
10
|
+
}));
|
|
11
|
+
});
|
|
10
12
|
export default DrawerHeader;
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import ModalTitle from "../Modal/ModalTitle.js";
|
|
5
|
-
const DrawerTitle = /*#__PURE__*/React.forwardRef((props, ref)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const DrawerTitle = /*#__PURE__*/React.forwardRef(function DrawerTitle(props, ref) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(ModalTitle, _extends({
|
|
7
|
+
classPrefix: "drawer-title"
|
|
8
|
+
}, props, {
|
|
9
|
+
ref: ref
|
|
10
|
+
}));
|
|
11
|
+
});
|
|
10
12
|
export default DrawerTitle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import DropdownMenu from './DropdownMenu';
|
|
3
|
-
import {
|
|
3
|
+
import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
4
4
|
import { IconProps } from '@rsuite/icons/Icon';
|
|
5
5
|
import DropdownItem from './DropdownItem';
|
|
6
6
|
import Button from '../Button';
|
|
@@ -16,7 +16,7 @@ export interface DropdownProps<T = any> extends WithAsProps, Omit<React.HTMLAttr
|
|
|
16
16
|
/** Triggering events */
|
|
17
17
|
trigger?: DropdownTrigger | DropdownTrigger[];
|
|
18
18
|
/** The placement of Menu */
|
|
19
|
-
placement?:
|
|
19
|
+
placement?: PlacementCorners;
|
|
20
20
|
/** Whether or not component is disabled */
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
/** The style of the menu */
|
package/esm/Dropdown/Dropdown.js
CHANGED
|
@@ -24,7 +24,7 @@ import DropdownSeparator from "./DropdownSeparator.js";
|
|
|
24
24
|
* - When used inside `<Sidenav>`, renders a `<TreeviewRootItem>`;
|
|
25
25
|
* - Otherwise renders a `<MenuRoot>`
|
|
26
26
|
*/
|
|
27
|
-
const Dropdown = /*#__PURE__*/React.forwardRef((props, ref)
|
|
27
|
+
const Dropdown = /*#__PURE__*/React.forwardRef(function Dropdown(props, ref) {
|
|
28
28
|
const {
|
|
29
29
|
propsWithDefaults
|
|
30
30
|
} = useCustom('Dropdown', props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Dispatch } from 'react';
|
|
2
2
|
import { DropdownAction } from './DropdownState';
|
|
3
3
|
export interface DropdownContextProps {
|
|
4
|
-
activeKey?: string;
|
|
4
|
+
activeKey?: string | number;
|
|
5
5
|
onSelect?: (eventKey: string | undefined, event: React.SyntheticEvent) => void;
|
|
6
6
|
hasSelectedItem?: boolean;
|
|
7
7
|
dispatch?: Dispatch<DropdownAction>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { StandardProps } from '../internals/types';
|
|
3
3
|
import type { IconProps } from '@rsuite/icons/Icon';
|
|
4
|
-
export interface DropdownMenuProps<T = string> extends StandardProps {
|
|
4
|
+
export interface DropdownMenuProps<T = string | number> extends StandardProps {
|
|
5
5
|
/** Define the title as a submenu */
|
|
6
6
|
title?: React.ReactNode;
|
|
7
7
|
/** The submenu expands from the left and defaults to the right */
|
|
@@ -40,5 +40,5 @@ export interface DropdownMenuProps<T = string> extends StandardProps {
|
|
|
40
40
|
* </Dropdown.Menu>
|
|
41
41
|
* </Dropdown>
|
|
42
42
|
*/
|
|
43
|
-
declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps<string> & Omit<React.HTMLAttributes<HTMLUListElement>, "title" | "onSelect"> & React.RefAttributes<HTMLElement>>;
|
|
43
|
+
declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuProps<string | number> & Omit<React.HTMLAttributes<HTMLUListElement>, "title" | "onSelect"> & React.RefAttributes<HTMLElement>>;
|
|
44
44
|
export default DropdownMenu;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Button from '../Button';
|
|
3
3
|
import { IconProps } from '@rsuite/icons/Icon';
|
|
4
|
-
import { WithAsProps, RsRefForwardingComponent,
|
|
4
|
+
import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
|
|
5
5
|
export interface DropdownToggleProps extends WithAsProps {
|
|
6
6
|
icon?: React.ReactElement<IconProps>;
|
|
7
7
|
noCaret?: boolean;
|
|
8
8
|
renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
|
|
9
|
-
placement?:
|
|
9
|
+
placement?: PlacementCorners;
|
|
10
10
|
}
|
|
11
11
|
declare const DropdownToggle: RsRefForwardingComponent<typeof Button, DropdownToggleProps>;
|
|
12
12
|
export default DropdownToggle;
|
|
@@ -8,7 +8,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
8
8
|
* The FlexboxGrid component is a box that can be used to layout other components.
|
|
9
9
|
* @see https://rsuitejs.com/components/flexbox-grid
|
|
10
10
|
*/
|
|
11
|
-
const FlexboxGrid = /*#__PURE__*/React.forwardRef((props, ref)
|
|
11
|
+
const FlexboxGrid = /*#__PURE__*/React.forwardRef(function FlexboxGrid(props, ref) {
|
|
12
12
|
const {
|
|
13
13
|
propsWithDefaults
|
|
14
14
|
} = useCustom('FlexboxGrid', props);
|
package/esm/Form/Form.js
CHANGED
|
@@ -21,7 +21,7 @@ const defaultSchema = SchemaModel({});
|
|
|
21
21
|
* The `Form` component is a form interface for collecting and validating user input.
|
|
22
22
|
* @see https://rsuitejs.com/components/form
|
|
23
23
|
*/
|
|
24
|
-
const Form = /*#__PURE__*/React.forwardRef((props, ref)
|
|
24
|
+
const Form = /*#__PURE__*/React.forwardRef(function Form(props, ref) {
|
|
25
25
|
const {
|
|
26
26
|
propsWithDefaults
|
|
27
27
|
} = useCustom('Form', props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CheckType } from 'schema-typed';
|
|
3
3
|
import Input from '../Input';
|
|
4
|
-
import { TypeAttributes, FormControlBaseProps, WithAsProps } from '../internals/types';
|
|
4
|
+
import { TypeAttributes, PlacementCorners, FormControlBaseProps, WithAsProps } from '../internals/types';
|
|
5
5
|
/**
|
|
6
6
|
* Props that FormControl passes to its accepter
|
|
7
7
|
*/
|
|
@@ -30,7 +30,7 @@ export interface FormControlProps<P = any, ValueType = any> extends WithAsProps,
|
|
|
30
30
|
/** Show error messages */
|
|
31
31
|
errorMessage?: React.ReactNode;
|
|
32
32
|
/** The placement of error messages */
|
|
33
|
-
errorPlacement?:
|
|
33
|
+
errorPlacement?: PlacementCorners;
|
|
34
34
|
/** Make the control readonly */
|
|
35
35
|
readOnly?: boolean;
|
|
36
36
|
/** Render the control as plain text */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
2
2
|
export interface FormErrorMessageProps extends WithAsProps {
|
|
3
3
|
/** Show error messages */
|
|
4
4
|
show?: boolean;
|
|
5
5
|
/** The placement of error messages */
|
|
6
|
-
placement?:
|
|
6
|
+
placement?: PlacementCorners;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* The `<Form.ErrorMessage>` component is used to display error messages in the form.
|