rsuite 5.65.0 → 5.66.0
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/Accordion/styles/index.css +9 -9
- package/AutoComplete/styles/index.css +59 -55
- package/Avatar/styles/index.css +2 -2
- package/Breadcrumb/styles/index.css +4 -4
- package/Button/styles/index.css +20 -20
- package/CHANGELOG.md +27 -0
- package/Calendar/styles/index.css +32 -32
- package/Carousel/styles/index.css +4 -4
- package/CascadeTree/styles/index.css +9 -9
- package/Cascader/styles/index.css +63 -59
- package/CheckPicker/styles/index.css +61 -57
- package/CheckTree/styles/index.css +62 -58
- package/CheckTreePicker/styles/index.css +62 -58
- package/Checkbox/styles/index.css +6 -6
- package/DateInput/styles/index.css +11 -11
- package/DatePicker/styles/index.css +70 -66
- package/DateRangeInput/styles/index.css +11 -11
- package/DateRangePicker/styles/index.css +71 -67
- package/Divider/styles/index.css +1 -1
- package/Drawer/styles/index.css +7 -7
- package/Dropdown/styles/index.css +26 -26
- package/FormControlLabel/styles/index.css +2 -2
- package/FormHelpText/styles/index.css +2 -2
- package/IconButton/styles/index.css +21 -21
- package/InlineEdit/styles/index.css +1 -1
- package/Input/styles/index.css +11 -11
- package/InputGroup/styles/index.css +28 -28
- package/InputNumber/styles/index.css +34 -34
- package/InputPicker/styles/index.css +62 -58
- package/List/styles/index.css +3 -3
- package/Loader/styles/index.css +10 -6
- package/Loader/styles/index.less +4 -0
- package/Message/styles/index.css +12 -12
- package/Modal/styles/index.css +9 -9
- package/MultiCascadeTree/styles/index.css +64 -60
- package/MultiCascader/styles/index.css +64 -60
- package/Nav/styles/index.css +30 -30
- package/Navbar/styles/index.css +30 -30
- package/Notification/styles/index.css +6 -6
- package/Pagination/styles/index.css +69 -65
- package/Panel/styles/index.css +9 -9
- package/PanelGroup/styles/index.css +1 -1
- package/Placeholder/styles/index.css +3 -3
- package/Popover/styles/index.css +3 -3
- package/Progress/styles/index.css +4 -3
- package/Progress/styles/index.less +1 -0
- package/Radio/styles/index.css +6 -6
- package/RadioGroup/styles/index.css +5 -5
- package/RangeSlider/styles/index.css +12 -12
- package/Rate/styles/index.css +2 -2
- package/SelectPicker/styles/index.css +62 -58
- package/Sidenav/styles/index.css +12 -12
- package/Slider/styles/index.css +12 -12
- package/Steps/styles/index.css +8 -8
- package/Table/styles/index.css +9 -9
- package/Tabs/styles/index.css +30 -30
- package/Tag/styles/index.css +3 -3
- package/TagInput/styles/index.css +63 -59
- package/TagPicker/styles/index.css +63 -59
- package/Text/styles/index.css +5 -5
- package/Timeline/styles/index.css +1 -1
- package/Toggle/styles/index.css +9 -9
- package/Tooltip/styles/index.css +9 -9
- package/Tree/styles/index.css +9 -9
- package/TreePicker/styles/index.css +9 -9
- package/Uploader/styles/index.css +40 -40
- package/cjs/CheckTree/CheckTreeView.d.ts +4 -0
- package/cjs/CheckTreePicker/CheckTreePicker.js +1 -0
- package/cjs/Drawer/Drawer.js +1 -0
- package/cjs/FormControl/hooks/useField.d.ts +1 -1
- package/cjs/FormControl/hooks/useField.js +15 -5
- package/cjs/Loader/Loader.d.ts +1 -1
- package/cjs/Loader/Loader.js +1 -1
- package/cjs/Tree/TreeView.d.ts +4 -0
- package/cjs/TreePicker/TreePicker.js +1 -0
- package/cjs/internals/hooks/useCustom.js +1 -1
- package/cjs/internals/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/dist/rsuite-no-reset-rtl.css +203 -198
- 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 +203 -198
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +205 -200
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +205 -200
- package/dist/rsuite.js +11 -11
- 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/CheckTree/CheckTreeView.d.ts +4 -0
- package/esm/CheckTreePicker/CheckTreePicker.js +1 -0
- package/esm/Drawer/Drawer.js +1 -0
- package/esm/FormControl/hooks/useField.d.ts +1 -1
- package/esm/FormControl/hooks/useField.js +13 -3
- package/esm/Loader/Loader.d.ts +1 -1
- package/esm/Loader/Loader.js +1 -1
- package/esm/Tree/TreeView.d.ts +4 -0
- package/esm/TreePicker/TreePicker.js +1 -0
- package/esm/internals/hooks/useCustom.js +1 -1
- package/esm/internals/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/package.json +1 -1
- package/styles/color-modes/light.less +2 -2
- package/styles/colors/light.less +6 -6
- package/styles/variables.less +1 -0
|
@@ -52,6 +52,10 @@ interface CheckTreeViewInnerProps<V = (string | number)[]> extends Omit<CheckTre
|
|
|
52
52
|
* Flattened nodes.
|
|
53
53
|
*/
|
|
54
54
|
flattenedNodes?: TreeNodeMap;
|
|
55
|
+
/**
|
|
56
|
+
* A collection of localized strings.
|
|
57
|
+
*/
|
|
58
|
+
locale?: Record<string, string>;
|
|
55
59
|
/**
|
|
56
60
|
* Callback function triggered when an item is focused.
|
|
57
61
|
*/
|
|
@@ -215,6 +215,7 @@ var CheckTreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
215
215
|
showIndentLine: showIndentLine,
|
|
216
216
|
listProps: listProps,
|
|
217
217
|
listRef: list,
|
|
218
|
+
locale: overrideLocale,
|
|
218
219
|
searchBy: searchBy,
|
|
219
220
|
searchable: searchable,
|
|
220
221
|
searchKeyword: searchKeyword,
|
package/esm/Drawer/Drawer.js
CHANGED
|
@@ -47,6 +47,7 @@ var Drawer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
47
47
|
value: contextValue
|
|
48
48
|
}, /*#__PURE__*/React.createElement(Modal, _extends({}, rest, {
|
|
49
49
|
ref: ref,
|
|
50
|
+
overflow: false,
|
|
50
51
|
classPrefix: classPrefix,
|
|
51
52
|
className: classes,
|
|
52
53
|
animation: animation,
|
|
@@ -4,6 +4,17 @@ import { useCallback, useMemo } from 'react';
|
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import set from 'lodash/set';
|
|
6
6
|
import { nameToPath } from "../utils.js";
|
|
7
|
+
function getErrorMessage(error) {
|
|
8
|
+
var _error$array;
|
|
9
|
+
/**
|
|
10
|
+
* When using some components as the field, such as TagInput, and using `ArrayType().of` as the validation rule,
|
|
11
|
+
* the error object won't contain the errorMessage directly. @see https://github.com/rsuite/rsuite/issues/3866
|
|
12
|
+
*/
|
|
13
|
+
if (error !== null && error !== void 0 && error.array && ((_error$array = error.array) === null || _error$array === void 0 ? void 0 : _error$array.length) > 0) {
|
|
14
|
+
return error.array[0].errorMessage;
|
|
15
|
+
}
|
|
16
|
+
return error === null || error === void 0 ? void 0 : error.errorMessage;
|
|
17
|
+
}
|
|
7
18
|
function useField(props) {
|
|
8
19
|
var name = props.name,
|
|
9
20
|
formValue = props.formValue,
|
|
@@ -23,14 +34,13 @@ function useField(props) {
|
|
|
23
34
|
return errorMessage;
|
|
24
35
|
}
|
|
25
36
|
if (nestedField) {
|
|
26
|
-
|
|
27
|
-
return (_get = get(formError, nameToPath(name))) === null || _get === void 0 ? void 0 : _get.errorMessage;
|
|
37
|
+
return getErrorMessage(get(formError, nameToPath(name)));
|
|
28
38
|
}
|
|
29
39
|
var fieldError = formError === null || formError === void 0 ? void 0 : formError[name];
|
|
30
40
|
if (typeof fieldError === 'string') {
|
|
31
41
|
return fieldError;
|
|
32
42
|
}
|
|
33
|
-
return fieldError
|
|
43
|
+
return getErrorMessage(fieldError);
|
|
34
44
|
}, [errorFromContext, errorMessage, formError, name, nestedField]);
|
|
35
45
|
var setFieldValue = useCallback(function (fieldName, fieldValue) {
|
|
36
46
|
var _extends2;
|
package/esm/Loader/Loader.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface LoaderProps extends WithAsProps {
|
|
|
12
12
|
/** Custom descriptive text */
|
|
13
13
|
content?: React.ReactNode;
|
|
14
14
|
/** The speed at which the loader rotates */
|
|
15
|
-
speed?: 'normal' | 'fast' | 'slow';
|
|
15
|
+
speed?: 'normal' | 'fast' | 'slow' | 'paused';
|
|
16
16
|
/** A loader can have different sizes */
|
|
17
17
|
size?: TypeAttributes.Size;
|
|
18
18
|
}
|
package/esm/Loader/Loader.js
CHANGED
package/esm/Tree/TreeView.d.ts
CHANGED
|
@@ -44,6 +44,10 @@ interface TreeViewInnerProps<V = string | number | null> extends Omit<TreeViewPr
|
|
|
44
44
|
* An array of values representing the loading nodes.
|
|
45
45
|
*/
|
|
46
46
|
loadingNodeValues?: V[];
|
|
47
|
+
/**
|
|
48
|
+
* A collection of localized strings.
|
|
49
|
+
*/
|
|
50
|
+
locale?: Record<string, string>;
|
|
47
51
|
/**
|
|
48
52
|
* A map of flattened nodes.
|
|
49
53
|
*/
|
|
@@ -220,6 +220,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
220
220
|
flattenedNodes: flattenedNodes,
|
|
221
221
|
listProps: listProps,
|
|
222
222
|
listRef: list,
|
|
223
|
+
locale: overrideLocale,
|
|
223
224
|
height: treeHeight,
|
|
224
225
|
onExpand: handleExpandTreeNode,
|
|
225
226
|
onSearch: onSearch,
|
|
@@ -11,7 +11,7 @@ var mergeObject = function mergeObject(list) {
|
|
|
11
11
|
}, {});
|
|
12
12
|
};
|
|
13
13
|
var getDefaultRTL = function getDefaultRTL() {
|
|
14
|
-
return typeof
|
|
14
|
+
return typeof document !== 'undefined' && (document.body.getAttribute('dir') || document.dir) === 'rtl';
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useEffect, useLayoutEffect } from 'react';
|
|
3
|
-
export var useIsomorphicLayoutEffect = typeof
|
|
3
|
+
export var useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
|
|
4
4
|
export default useIsomorphicLayoutEffect;
|
package/package.json
CHANGED
|
@@ -298,11 +298,11 @@
|
|
|
298
298
|
--rs-rate-symbol-checked: var(--rs-blue-500);
|
|
299
299
|
|
|
300
300
|
// Toggle
|
|
301
|
-
--rs-toggle-bg: var(--rs-gray-
|
|
301
|
+
--rs-toggle-bg: var(--rs-gray-400);
|
|
302
302
|
--rs-toggle-thumb: #fff;
|
|
303
303
|
--rs-toggle-loader-ring: rgb(from var(--rs-gray-50) r g b / 30%);
|
|
304
304
|
--rs-toggle-loader-rotor: var(--rs-gray-0);
|
|
305
|
-
--rs-toggle-hover-bg: var(--rs-gray-
|
|
305
|
+
--rs-toggle-hover-bg: var(--rs-gray-500);
|
|
306
306
|
--rs-toggle-disabled-bg: var(--rs-gray-200);
|
|
307
307
|
--rs-toggle-disabled-thumb: #fff;
|
|
308
308
|
--rs-toggle-checked-bg: var(--rs-primary-500);
|
package/styles/colors/light.less
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
@B100: #f2f2f5;
|
|
19
19
|
@B200: #e5e5ea;
|
|
20
20
|
@B300: #d9d9d9;
|
|
21
|
-
@B400: #
|
|
22
|
-
@B500: #
|
|
23
|
-
@B600: #
|
|
24
|
-
@B700: #
|
|
25
|
-
@B800: #
|
|
26
|
-
@B900: #
|
|
21
|
+
@B400: #b6b7b8;
|
|
22
|
+
@B500: #939393;
|
|
23
|
+
@B600: #717273;
|
|
24
|
+
@B700: #575757;
|
|
25
|
+
@B800: #343434;
|
|
26
|
+
@B900: #121212;
|
|
27
27
|
|
|
28
28
|
// Secondary palette
|
|
29
29
|
|