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
|
@@ -10,7 +10,7 @@ var _Check = _interopRequireDefault(require("@rsuite/icons/Check"));
|
|
|
10
10
|
var _Close = _interopRequireDefault(require("@rsuite/icons/Close"));
|
|
11
11
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
12
12
|
var _Stack = _interopRequireDefault(require("../Stack"));
|
|
13
|
-
const EditableControls = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
13
|
+
const EditableControls = /*#__PURE__*/_react.default.forwardRef(function EditableControls(props, ref) {
|
|
14
14
|
const {
|
|
15
15
|
onSave,
|
|
16
16
|
onCancel,
|
|
@@ -17,7 +17,7 @@ const InputGroupContext = exports.InputGroupContext = /*#__PURE__*/_react.defaul
|
|
|
17
17
|
* The `InputGroup` component is used to specify an input field with an add-on.
|
|
18
18
|
* @see https://rsuitejs.com/components/input/#input-group
|
|
19
19
|
*/
|
|
20
|
-
const InputGroup = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
20
|
+
const InputGroup = /*#__PURE__*/_react.default.forwardRef(function InputGroup(props, ref) {
|
|
21
21
|
const {
|
|
22
22
|
propsWithDefaults
|
|
23
23
|
} = (0, _CustomProvider.useCustom)('InputGroup', props);
|
|
@@ -200,7 +200,7 @@ const InputNumber = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
200
200
|
});
|
|
201
201
|
const handleChange = (0, _hooks.useEventCallback)((value, event) => {
|
|
202
202
|
const separator = decimalSeparator || '.';
|
|
203
|
-
const escapedSeparator = separator.replace(/[
|
|
203
|
+
const escapedSeparator = separator.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
204
204
|
const regex = new RegExp(`^-?(?:\\d+)?(${escapedSeparator})?\\d*$`);
|
|
205
205
|
if (!regex.test(value) && value !== '') {
|
|
206
206
|
return;
|
|
@@ -192,7 +192,6 @@ const InputPicker = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
192
192
|
(0, _react.useEffect)(() => {
|
|
193
193
|
var _triggerRef$current2, _triggerRef$current2$;
|
|
194
194
|
(_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 || (_triggerRef$current2$ = _triggerRef$current2.updatePosition) === null || _triggerRef$current2$ === void 0 || _triggerRef$current2$.call(_triggerRef$current2);
|
|
195
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
196
195
|
}, [searchKeyword, value]);
|
|
197
196
|
const getDataItem = value => {
|
|
198
197
|
// Find active `MenuItem` by `value`
|
|
@@ -15,7 +15,6 @@ function useMaxWidth(triggerRef) {
|
|
|
15
15
|
var _triggerRef$current2;
|
|
16
16
|
setMaxWidth((0, _getWidth.default)((_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.root));
|
|
17
17
|
}
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
18
|
}, []);
|
|
20
19
|
return maxWidth;
|
|
21
20
|
}
|
package/cjs/List/List.js
CHANGED
|
@@ -18,7 +18,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
18
18
|
* The `List` component is used to specify the layout of the list.
|
|
19
19
|
* @see https://rsuitejs.com/components/list
|
|
20
20
|
*/
|
|
21
|
-
const List = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
21
|
+
const List = /*#__PURE__*/_react.default.forwardRef(function List(props, ref) {
|
|
22
22
|
const {
|
|
23
23
|
propsWithDefaults
|
|
24
24
|
} = (0, _CustomProvider.useCustom)('List', props);
|
|
@@ -132,7 +132,6 @@ function conformToMask(rawValue, mask, config) {
|
|
|
132
132
|
// or we find at least one character that we can map.
|
|
133
133
|
while (rawValueArr.length > 0) {
|
|
134
134
|
// Let's retrieve the first user character in the queue of characters we have left
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
136
135
|
const {
|
|
137
136
|
char: rawValueChar,
|
|
138
137
|
isNew
|
package/cjs/Modal/Modal.js
CHANGED
|
@@ -28,7 +28,7 @@ const modalSizes = ['xs', 'sm', 'md', 'lg', 'full'];
|
|
|
28
28
|
* The `Modal` component is used to show content in a layer above the app.
|
|
29
29
|
* @see https://rsuitejs.com/components/modal
|
|
30
30
|
*/
|
|
31
|
-
const Modal = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
31
|
+
const Modal = /*#__PURE__*/_react.default.forwardRef(function Modal(props, ref) {
|
|
32
32
|
const {
|
|
33
33
|
propsWithDefaults
|
|
34
34
|
} = (0, _CustomProvider.useCustom)('Modal', props);
|
package/cjs/Modal/utils.js
CHANGED
|
@@ -69,7 +69,6 @@ const useBodyStyles = (ref, options) => {
|
|
|
69
69
|
}, [overflow, prefix, ref, size, updateBodyStyles]);
|
|
70
70
|
(0, _react.useEffect)(() => {
|
|
71
71
|
return onDestroyEvents;
|
|
72
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
72
|
}, []);
|
|
74
73
|
return [overflow ? bodyStyles : null, onChangeBodyStyles, onDestroyEvents];
|
|
75
74
|
};
|
package/cjs/Nav/Nav.js
CHANGED
|
@@ -24,7 +24,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
24
24
|
* The `Nav` component is used to create navigation links.
|
|
25
25
|
* @see https://rsuitejs.com/components/nav
|
|
26
26
|
*/
|
|
27
|
-
const Nav = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
27
|
+
const Nav = /*#__PURE__*/_react.default.forwardRef(function Nav(props, ref) {
|
|
28
28
|
const {
|
|
29
29
|
propsWithDefaults
|
|
30
30
|
} = (0, _CustomProvider.useCustom)('Nav', props);
|
package/cjs/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/cjs/Nav/NavDropdown.js
CHANGED
|
@@ -29,7 +29,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
29
29
|
* </Nav.Menu>
|
|
30
30
|
* </Nav>
|
|
31
31
|
*/
|
|
32
|
-
const NavDropdown = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
32
|
+
const NavDropdown = /*#__PURE__*/_react.default.forwardRef(function NavDropdown(props, ref) {
|
|
33
33
|
const nav = (0, _react.useContext)(_NavContext.default);
|
|
34
34
|
if (!nav) {
|
|
35
35
|
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/cjs/Navbar/Navbar.js
CHANGED
|
@@ -16,7 +16,7 @@ const NavbarContext = exports.NavbarContext = /*#__PURE__*/_react.default.create
|
|
|
16
16
|
* The `Navbar` component is used to create a navigation header.
|
|
17
17
|
* @see https://rsuitejs.com/components/navbar
|
|
18
18
|
*/
|
|
19
|
-
const Navbar = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
19
|
+
const Navbar = /*#__PURE__*/_react.default.forwardRef(function Navbar(props, ref) {
|
|
20
20
|
const {
|
|
21
21
|
propsWithDefaults
|
|
22
22
|
} = (0, _CustomProvider.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 */
|
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
21
21
|
/**
|
|
22
22
|
* @private
|
|
23
23
|
*/
|
|
24
|
-
const NavbarDropdown = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
24
|
+
const NavbarDropdown = /*#__PURE__*/_react.default.forwardRef(function NavbarDropdown(props, ref) {
|
|
25
25
|
const navbar = (0, _react.useContext)(_.NavbarContext);
|
|
26
26
|
if (!navbar) {
|
|
27
27
|
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/cjs/Navbar/index.js
CHANGED
|
File without changes
|
|
@@ -88,7 +88,7 @@ const RangeSlider = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
88
88
|
}, [max, min]);
|
|
89
89
|
const [value, setValue] = (0, _hooks.useControlled)(getValidValue(valueProp), getValidValue(defaultValue));
|
|
90
90
|
|
|
91
|
-
// The count of values
|
|
91
|
+
// The count of values that can be entered.
|
|
92
92
|
const count = (0, _react.useMemo)(() => (0, _utils.precisionMath)((max - min) / step), [max, min, step]);
|
|
93
93
|
|
|
94
94
|
// Get the height of the progress bar
|
|
@@ -191,10 +191,10 @@ const RangeSlider = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
193
|
const handleKeyDown = (0, _hooks.useEventCallback)(event => {
|
|
194
|
-
|
|
194
|
+
const target = event.target;
|
|
195
195
|
const {
|
|
196
196
|
key
|
|
197
|
-
} = (
|
|
197
|
+
} = (target === null || target === void 0 ? void 0 : target.dataset) || {};
|
|
198
198
|
const nextValue = [...value];
|
|
199
199
|
const increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
200
200
|
const decreaseKey = rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
@@ -238,7 +238,7 @@ const RangeSlider = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
238
238
|
let [start, end] = value;
|
|
239
239
|
const v = getValueByPosition(event);
|
|
240
240
|
|
|
241
|
-
//
|
|
241
|
+
// Judging that the current click value is closer to the values of `start` and `end`.
|
|
242
242
|
if (Math.abs(start - v) < Math.abs(end - v)) {
|
|
243
243
|
start = v;
|
|
244
244
|
} else {
|
package/cjs/Rate/Character.js
CHANGED
|
@@ -5,9 +5,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _contains = _interopRequireDefault(require("dom-lib/contains"));
|
|
10
|
+
var _isNil = _interopRequireDefault(require("lodash/isNil"));
|
|
11
11
|
var _hooks = require("../internals/hooks");
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -37,13 +37,13 @@ const Character = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
37
37
|
withClassPrefix
|
|
38
38
|
} = (0, _hooks.useClassNames)(classPrefix);
|
|
39
39
|
const beforeRef = (0, _react.useRef)(null);
|
|
40
|
-
const classes = merge(className, withClassPrefix(!(0,
|
|
41
|
-
const handleMouseMove = (0,
|
|
40
|
+
const classes = merge(className, withClassPrefix(!(0, _isNil.default)(status) && characterStatus[status]));
|
|
41
|
+
const handleMouseMove = (0, _hooks.useEventCallback)(event => {
|
|
42
42
|
onMouseMove === null || onMouseMove === void 0 || onMouseMove(getKey(beforeRef.current, event.target), event);
|
|
43
|
-
}
|
|
44
|
-
const handleClick = (0,
|
|
43
|
+
});
|
|
44
|
+
const handleClick = (0, _hooks.useEventCallback)(event => {
|
|
45
45
|
onClick === null || onClick === void 0 || onClick(getKey(beforeRef.current, event.target), event);
|
|
46
|
-
}
|
|
46
|
+
});
|
|
47
47
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
|
|
48
48
|
ref: ref,
|
|
49
49
|
className: classes,
|
package/cjs/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/cjs/Rate/Rate.js
CHANGED
|
@@ -41,6 +41,7 @@ const Rate = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
41
41
|
defaultValue = 0,
|
|
42
42
|
cleanable = true,
|
|
43
43
|
plaintext,
|
|
44
|
+
style,
|
|
44
45
|
onChange,
|
|
45
46
|
renderCharacter,
|
|
46
47
|
onChangeActive,
|
|
@@ -56,23 +57,23 @@ const Rate = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
56
57
|
merge,
|
|
57
58
|
withClassPrefix
|
|
58
59
|
} = (0, _hooks.useClassNames)(classPrefix);
|
|
59
|
-
const classes = merge(className, withClassPrefix(size, color, {
|
|
60
|
+
const classes = merge(className, withClassPrefix(size, (0, _utils.isPresetColor)(color) && color, {
|
|
60
61
|
disabled,
|
|
61
62
|
readonly: readOnly
|
|
62
63
|
}));
|
|
64
|
+
const styles = (0, _react.useMemo)(() => (0, _utils.mergeStyles)(style, (0, _utils.createColorVariables)(color, '--rs-rate-symbol-checked')), [style, color]);
|
|
63
65
|
const resetCharacterMap = (0, _react.useCallback)(() => {
|
|
64
66
|
setCharacterMap(getCharacterMap());
|
|
65
67
|
}, [getCharacterMap]);
|
|
66
68
|
(0, _react.useEffect)(() => {
|
|
67
69
|
// Update characterMap when value is updated.
|
|
68
70
|
setCharacterMap(getCharacterMap(valueProp));
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
71
|
}, [valueProp]);
|
|
71
|
-
const handleMouseLeave = (0,
|
|
72
|
+
const handleMouseLeave = (0, _hooks.useEventCallback)(event => {
|
|
72
73
|
resetCharacterMap();
|
|
73
74
|
onChangeActive === null || onChangeActive === void 0 || onChangeActive(value, event);
|
|
74
|
-
}
|
|
75
|
-
const handleChangeValue = (0,
|
|
75
|
+
});
|
|
76
|
+
const handleChangeValue = (0, _hooks.useEventCallback)((index, event) => {
|
|
76
77
|
let nextValue = (0, _utils2.transformCharacterMapToValue)(characterMap);
|
|
77
78
|
if (cleanable && value === nextValue && getCharacterMap(value)[index] === characterMap[index]) {
|
|
78
79
|
nextValue = 0;
|
|
@@ -82,8 +83,8 @@ const Rate = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
82
83
|
setCharacterMap(getCharacterMap(nextValue));
|
|
83
84
|
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
84
85
|
}
|
|
85
|
-
}
|
|
86
|
-
const handleKeyDown = (0,
|
|
86
|
+
});
|
|
87
|
+
const handleKeyDown = (0, _hooks.useEventCallback)((index, event) => {
|
|
87
88
|
const {
|
|
88
89
|
key
|
|
89
90
|
} = event;
|
|
@@ -97,8 +98,8 @@ const Rate = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
97
98
|
if (key === _constants.KEY_VALUES.ENTER) {
|
|
98
99
|
handleChangeValue(index, event);
|
|
99
100
|
}
|
|
100
|
-
}
|
|
101
|
-
const handleChangeCharacterMap = (0,
|
|
101
|
+
});
|
|
102
|
+
const handleChangeCharacterMap = (0, _hooks.useEventCallback)((index, key, event) => {
|
|
102
103
|
const nextCharacterMap = characterMap.map((_item, i) => {
|
|
103
104
|
if (i === index && key === 'before' && allowHalf) {
|
|
104
105
|
return 0.5;
|
|
@@ -109,11 +110,11 @@ const Rate = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
109
110
|
setCharacterMap(nextCharacterMap);
|
|
110
111
|
onChangeActive === null || onChangeActive === void 0 || onChangeActive((0, _utils2.transformCharacterMapToValue)(nextCharacterMap), event);
|
|
111
112
|
}
|
|
112
|
-
}
|
|
113
|
-
const handleClick = (0,
|
|
113
|
+
});
|
|
114
|
+
const handleClick = (0, _hooks.useEventCallback)((index, key, event) => {
|
|
114
115
|
handleChangeCharacterMap(index, key, event);
|
|
115
116
|
handleChangeValue(index, event);
|
|
116
|
-
}
|
|
117
|
+
});
|
|
117
118
|
if (plaintext) {
|
|
118
119
|
return /*#__PURE__*/_react.default.createElement(_Plaintext.default, {
|
|
119
120
|
localeKey: "notSelected",
|
|
@@ -122,12 +123,12 @@ const Rate = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
122
123
|
}
|
|
123
124
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
124
125
|
role: "radiogroup",
|
|
125
|
-
tabIndex: 0
|
|
126
|
-
}, rest, {
|
|
126
|
+
tabIndex: 0,
|
|
127
127
|
ref: ref,
|
|
128
128
|
className: classes,
|
|
129
|
+
style: styles,
|
|
129
130
|
onMouseLeave: handleMouseLeave
|
|
130
|
-
}), characterMap.map((item, index) => /*#__PURE__*/_react.default.createElement(_Character.default, {
|
|
131
|
+
}, rest), characterMap.map((item, index) => /*#__PURE__*/_react.default.createElement(_Character.default, {
|
|
131
132
|
role: "radio",
|
|
132
133
|
"aria-posinset": index + 1,
|
|
133
134
|
"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/cjs/Sidenav/Sidenav.js
CHANGED
|
@@ -23,7 +23,7 @@ const emptyArray = [];
|
|
|
23
23
|
* The `Sidenav` component is an encapsulation of the page sidebar `Nav`.
|
|
24
24
|
* @see https://rsuitejs.com/components/sidenav/
|
|
25
25
|
*/
|
|
26
|
-
const Sidenav = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
26
|
+
const Sidenav = /*#__PURE__*/_react.default.forwardRef(function Sidenav(props, ref) {
|
|
27
27
|
const {
|
|
28
28
|
propsWithDefaults
|
|
29
29
|
} = (0, _CustomProvider.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 */
|
|
@@ -33,7 +33,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
33
33
|
* </Nav>
|
|
34
34
|
* </Sidenav>
|
|
35
35
|
*/
|
|
36
|
-
const SidenavDropdown = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
36
|
+
const SidenavDropdown = /*#__PURE__*/_react.default.forwardRef(function SidenavDropdown(props, ref) {
|
|
37
37
|
const sidenav = (0, _react.useContext)(_Sidenav.SidenavContext);
|
|
38
38
|
const nav = (0, _react.useContext)(_NavContext.default);
|
|
39
39
|
const navMenu = (0, _react.useContext)(_NavMenu.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/cjs/Stack/HStack.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Stack = _interopRequireDefault(require("./Stack"));
|
|
10
|
-
const HStack = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
10
|
+
const HStack = /*#__PURE__*/_react.default.forwardRef(function HStack(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
reverse,
|
|
13
13
|
spacing = 6,
|
package/cjs/Stack/Stack.js
CHANGED
|
@@ -21,7 +21,7 @@ function isStackItem(child) {
|
|
|
21
21
|
*
|
|
22
22
|
* @see https://rsuitejs.com/components/stack
|
|
23
23
|
*/
|
|
24
|
-
const Stack = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
24
|
+
const Stack = /*#__PURE__*/_react.default.forwardRef(function Stack(props, ref) {
|
|
25
25
|
const {
|
|
26
26
|
propsWithDefaults
|
|
27
27
|
} = (0, _CustomProvider.useCustom)('Stack', props);
|
package/cjs/Stack/VStack.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Stack = _interopRequireDefault(require("./Stack"));
|
|
10
|
-
const VStack = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
10
|
+
const VStack = /*#__PURE__*/_react.default.forwardRef(function VStack(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
reverse,
|
|
13
13
|
spacing = 6,
|
package/cjs/Stat/Stat.js
CHANGED
|
@@ -13,7 +13,7 @@ var _StatHelpText = _interopRequireDefault(require("./StatHelpText"));
|
|
|
13
13
|
var _StatTrend = _interopRequireDefault(require("./StatTrend"));
|
|
14
14
|
var _hooks = require("../internals/hooks");
|
|
15
15
|
var _CustomProvider = require("../CustomProvider");
|
|
16
|
-
const Stat = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
16
|
+
const Stat = /*#__PURE__*/_react.default.forwardRef(function Stat(props, ref) {
|
|
17
17
|
const {
|
|
18
18
|
propsWithDefaults
|
|
19
19
|
} = (0, _CustomProvider.useCustom)('Stat', props);
|
package/cjs/Steps/Steps.js
CHANGED
|
@@ -15,7 +15,7 @@ var _CustomProvider = require("../CustomProvider");
|
|
|
15
15
|
*
|
|
16
16
|
* @see https://rsuitejs.com/components/steps
|
|
17
17
|
*/
|
|
18
|
-
const Steps = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
18
|
+
const Steps = /*#__PURE__*/_react.default.forwardRef(function Steps(props, ref) {
|
|
19
19
|
const {
|
|
20
20
|
propsWithDefaults
|
|
21
21
|
} = (0, _CustomProvider.useCustom)('Steps', props);
|
package/cjs/Table/Table.js
CHANGED
|
@@ -12,7 +12,7 @@ var _TableColumn = _interopRequireDefault(require("./TableColumn"));
|
|
|
12
12
|
var _TableColumnGroup = _interopRequireDefault(require("./TableColumnGroup"));
|
|
13
13
|
var _CustomProvider = require("../CustomProvider");
|
|
14
14
|
var _rsuiteTable = require("rsuite-table");
|
|
15
|
-
const CustomTable = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
15
|
+
const CustomTable = /*#__PURE__*/_react.default.forwardRef(function Table(props, ref) {
|
|
16
16
|
const {
|
|
17
17
|
propsWithDefaults,
|
|
18
18
|
rtl,
|
|
@@ -23,7 +23,7 @@ const CustomTable = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
23
23
|
loadAnimation = true,
|
|
24
24
|
...rest
|
|
25
25
|
} = propsWithDefaults;
|
|
26
|
-
const locale = getLocale('
|
|
26
|
+
const locale = getLocale('common', overrideLocale);
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_rsuiteTable.Table, (0, _extends2.default)({}, rest, {
|
|
28
28
|
rtl: rtl,
|
|
29
29
|
ref: ref,
|
package/cjs/Tabs/Tabs.js
CHANGED
|
@@ -109,7 +109,7 @@ const renderTabs = (children, tabPanelProps) => {
|
|
|
109
109
|
* @version 5.53.0
|
|
110
110
|
* @see https://rsuitejs.com/components/tabs
|
|
111
111
|
*/
|
|
112
|
-
const Tabs = /*#__PURE__*/_react.default.forwardRef((props, ref)
|
|
112
|
+
const Tabs = /*#__PURE__*/_react.default.forwardRef(function Tabs(props, ref) {
|
|
113
113
|
const {
|
|
114
114
|
propsWithDefaults,
|
|
115
115
|
rtl
|
|
@@ -167,16 +167,15 @@ const Tabs = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
167
167
|
event.preventDefault();
|
|
168
168
|
break;
|
|
169
169
|
case 'End':
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
{
|
|
171
|
+
const tabs = getFocusableTabs(tablistRef.current);
|
|
172
|
+
item = tabs[tabs.length - 1];
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
174
176
|
}
|
|
175
177
|
if (item) {
|
|
176
|
-
|
|
177
|
-
const {
|
|
178
|
-
eventKey
|
|
179
|
-
} = (_item = item) === null || _item === void 0 ? void 0 : _item.dataset;
|
|
178
|
+
const eventKey = item ? item.dataset.eventKey : undefined;
|
|
180
179
|
handleSelect(eventKey, event);
|
|
181
180
|
item.focus();
|
|
182
181
|
}
|
package/cjs/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 */
|
package/cjs/Tag/Tag.js
CHANGED
|
@@ -5,10 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _CloseButton = _interopRequireDefault(require("../internals/CloseButton"));
|
|
10
10
|
var _hooks = require("../internals/hooks");
|
|
11
11
|
var _CustomProvider = require("../CustomProvider");
|
|
12
|
+
var _utils = require("../internals/utils");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
15
|
/**
|
|
13
16
|
* The `Tag` component is used to label and categorize.
|
|
14
17
|
* It can be used to mark the status of an object or classify it into different categories.
|
|
@@ -24,11 +27,12 @@ const Tag = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
24
27
|
as: Component = 'div',
|
|
25
28
|
classPrefix = 'tag',
|
|
26
29
|
size = 'md',
|
|
27
|
-
color
|
|
30
|
+
color,
|
|
28
31
|
children,
|
|
29
32
|
closable,
|
|
30
33
|
className,
|
|
31
34
|
locale: overrideLocale,
|
|
35
|
+
style,
|
|
32
36
|
onClose,
|
|
33
37
|
...rest
|
|
34
38
|
} = propsWithDefaults;
|
|
@@ -40,13 +44,15 @@ const Tag = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
40
44
|
prefix,
|
|
41
45
|
merge
|
|
42
46
|
} = (0, _hooks.useClassNames)(classPrefix);
|
|
43
|
-
const classes = merge(className, withClassPrefix(size, color, {
|
|
47
|
+
const classes = merge(className, withClassPrefix(size, (0, _utils.isPresetColor)(color) && color, {
|
|
44
48
|
closable
|
|
45
49
|
}));
|
|
46
|
-
|
|
50
|
+
const styles = (0, _react.useMemo)(() => (0, _utils.mergeStyles)(style, (0, _utils.createColorVariables)(color, '--rs-tag-bg', '--rs-tag-text')), [style, color]);
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
47
52
|
ref: ref,
|
|
48
|
-
className: classes
|
|
49
|
-
|
|
53
|
+
className: classes,
|
|
54
|
+
style: styles
|
|
55
|
+
}, rest), /*#__PURE__*/_react.default.createElement("span", {
|
|
50
56
|
className: prefix`text`
|
|
51
57
|
}, children), closable && /*#__PURE__*/_react.default.createElement(_CloseButton.default, {
|
|
52
58
|
className: prefix`icon-close`,
|