rsuite 5.4.2 → 5.5.1
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/Button/styles/index.less +1 -5
- package/CHANGELOG.md +47 -0
- package/Carousel/styles/index.less +1 -0
- package/CheckTreePicker/styles/index.less +51 -50
- package/Drawer/styles/index.less +3 -0
- package/Dropdown/styles/index.less +3 -19
- package/Dropdown/styles/mixin.less +0 -2
- package/Modal/styles/mixin.less +1 -0
- package/Navbar/styles/index.less +8 -3
- package/Picker/styles/mixin.less +3 -2
- package/README.md +1 -1
- package/Sidenav/styles/index.less +59 -58
- package/TreePicker/styles/index.less +3 -3
- package/cjs/Calendar/useCalendarDate.d.ts +1 -1
- package/cjs/Calendar/useCalendarDate.js +1 -1
- package/cjs/Carousel/Carousel.js +7 -1
- package/cjs/Cascader/Cascader.js +13 -2
- package/cjs/CheckPicker/CheckPicker.d.ts +5 -2
- package/cjs/CheckPicker/test/CheckPicker.test.js +8 -0
- package/cjs/CheckTreePicker/CheckTreePicker.js +1 -1
- package/cjs/CheckTreePicker/utils.js +1 -1
- package/cjs/CustomProvider/CustomProvider.d.ts +14 -14
- package/cjs/CustomProvider/CustomProvider.js +4 -3
- package/cjs/DatePicker/DatePicker.d.ts +1 -1
- package/cjs/DatePicker/DatePicker.js +2 -4
- package/cjs/DateRangePicker/Calendar.js +2 -16
- package/cjs/Dropdown/Dropdown.d.ts +5 -0
- package/cjs/Dropdown/DropdownMenu.js +5 -11
- package/cjs/Dropdown/test/Dropdown.test.d.ts +1 -0
- package/cjs/Dropdown/test/Dropdown.test.js +30 -0
- package/cjs/InputNumber/InputNumber.d.ts +1 -1
- package/cjs/InputNumber/InputNumber.js +36 -6
- package/cjs/InputNumber/test/InputNumber.test.d.ts +1 -0
- package/cjs/InputNumber/test/InputNumber.test.js +14 -0
- package/cjs/Modal/utils.js +16 -8
- package/cjs/MultiCascader/MultiCascader.js +7 -3
- package/cjs/Nav/NavItem.js +3 -1
- package/cjs/Picker/DropdownMenu.js +5 -0
- package/cjs/Picker/PickerToggle.js +2 -4
- package/cjs/RangeSlider/RangeSlider.d.ts +12 -2
- package/cjs/RangeSlider/RangeSlider.js +35 -12
- package/cjs/SelectPicker/SelectPicker.d.ts +5 -2
- package/cjs/SelectPicker/test/SelectPicker.test.js +8 -0
- package/cjs/Uploader/UploadFileItem.d.ts +1 -1
- package/cjs/Uploader/UploadFileItem.js +1 -1
- package/cjs/Uploader/Uploader.js +3 -0
- package/cjs/utils/propTypeChecker.d.ts +2 -6
- package/cjs/utils/propTypeChecker.js +7 -59
- package/cjs/utils/treeUtils.js +4 -3
- package/cjs/utils/useClickOutside.js +6 -2
- package/dist/rsuite-rtl.css +399 -252
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +399 -252
- package/dist/rsuite.js +27 -27
- 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/Calendar/useCalendarDate.d.ts +1 -1
- package/esm/Calendar/useCalendarDate.js +1 -1
- package/esm/Carousel/Carousel.js +9 -3
- package/esm/Cascader/Cascader.js +13 -2
- package/esm/CheckPicker/CheckPicker.d.ts +5 -2
- package/esm/CheckPicker/test/CheckPicker.test.js +7 -0
- package/esm/CheckTreePicker/CheckTreePicker.js +1 -1
- package/esm/CheckTreePicker/utils.js +1 -1
- package/esm/CustomProvider/CustomProvider.d.ts +14 -14
- package/esm/CustomProvider/CustomProvider.js +2 -2
- package/esm/DatePicker/DatePicker.d.ts +1 -1
- package/esm/DatePicker/DatePicker.js +2 -3
- package/esm/DateRangePicker/Calendar.js +2 -16
- package/esm/Dropdown/Dropdown.d.ts +5 -0
- package/esm/Dropdown/DropdownMenu.js +5 -11
- package/esm/Dropdown/test/Dropdown.test.d.ts +1 -0
- package/esm/Dropdown/test/Dropdown.test.js +22 -0
- package/esm/InputNumber/InputNumber.d.ts +1 -1
- package/esm/InputNumber/InputNumber.js +38 -7
- package/esm/InputNumber/test/InputNumber.test.d.ts +1 -0
- package/esm/InputNumber/test/InputNumber.test.js +7 -0
- package/esm/Modal/utils.js +16 -8
- package/esm/MultiCascader/MultiCascader.js +7 -3
- package/esm/Nav/NavItem.js +3 -1
- package/esm/Picker/DropdownMenu.js +5 -0
- package/esm/Picker/PickerToggle.js +2 -4
- package/esm/RangeSlider/RangeSlider.d.ts +12 -2
- package/esm/RangeSlider/RangeSlider.js +35 -12
- package/esm/SelectPicker/SelectPicker.d.ts +5 -2
- package/esm/SelectPicker/test/SelectPicker.test.js +7 -0
- package/esm/Uploader/UploadFileItem.d.ts +1 -1
- package/esm/Uploader/UploadFileItem.js +1 -1
- package/esm/Uploader/Uploader.js +4 -1
- package/esm/utils/propTypeChecker.d.ts +2 -6
- package/esm/utils/propTypeChecker.js +7 -59
- package/esm/utils/treeUtils.js +6 -3
- package/esm/utils/useClickOutside.js +6 -2
- package/package.json +2 -2
- 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/mixins/utilities.less +17 -5
|
@@ -4,7 +4,7 @@ import { UploaderLocale } from '../locales';
|
|
|
4
4
|
import { WithAsProps } from '../@types/common';
|
|
5
5
|
export interface UploadFileItemProps extends WithAsProps {
|
|
6
6
|
file: FileType;
|
|
7
|
-
listType
|
|
7
|
+
listType?: 'text' | 'picture-text' | 'picture';
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
maxPreviewFileSize?: number;
|
|
@@ -297,7 +297,7 @@ UploadFileItem.displayName = 'UploadFileItem';
|
|
|
297
297
|
UploadFileItem.propTypes = {
|
|
298
298
|
locale: _propTypes.default.any,
|
|
299
299
|
file: _propTypes.default.object.isRequired,
|
|
300
|
-
listType: _propTypes.default.oneOf(['text', 'picture-text', 'picture'])
|
|
300
|
+
listType: _propTypes.default.oneOf(['text', 'picture-text', 'picture']),
|
|
301
301
|
disabled: _propTypes.default.bool,
|
|
302
302
|
className: _propTypes.default.string,
|
|
303
303
|
maxPreviewFileSize: _propTypes.default.number,
|
package/cjs/Uploader/Uploader.js
CHANGED
|
@@ -100,6 +100,9 @@ var useFileList = function useFileList(defaultFileList) {
|
|
|
100
100
|
(_fileListUpdateCallba = fileListUpdateCallback.current) === null || _fileListUpdateCallba === void 0 ? void 0 : _fileListUpdateCallba.call(fileListUpdateCallback, fileList);
|
|
101
101
|
fileListUpdateCallback.current = null;
|
|
102
102
|
}, [fileList]);
|
|
103
|
+
(0, _utils.useWillUnmount)(function () {
|
|
104
|
+
fileListUpdateCallback.current = null;
|
|
105
|
+
});
|
|
103
106
|
var dispatchCallback = (0, _react.useCallback)(function (action, callback) {
|
|
104
107
|
dispatch(action);
|
|
105
108
|
fileListUpdateCallback.current = callback;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import PropTypes
|
|
2
|
-
declare
|
|
3
|
-
[K in keyof T]: T[K] extends Validator<infer V> ? V : never;
|
|
4
|
-
};
|
|
5
|
-
export declare function tupleType<T extends readonly Validator<any>[]>(...types: T): Requireable<ExtractValue<T>>;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export declare function tupleType<T>(...typeCheckers: any[]): PropTypes.Requireable<T>;
|
|
6
3
|
export declare const refType: PropTypes.Requireable<any>;
|
|
7
|
-
export {};
|
|
@@ -8,71 +8,19 @@ exports.refType = void 0;
|
|
|
8
8
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
|
|
11
|
-
var ANONYMOUS = '';
|
|
12
|
-
|
|
13
|
-
function createChainableTypeChecker(validate) {
|
|
14
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName) {
|
|
15
|
-
componentName = componentName || ANONYMOUS;
|
|
16
|
-
propFullName = propFullName || propName;
|
|
17
|
-
|
|
18
|
-
if (props[propName] == null) {
|
|
19
|
-
if (isRequired) {
|
|
20
|
-
if (props[propName] === null) {
|
|
21
|
-
return new Error('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return new Error('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return null;
|
|
28
|
-
} else {
|
|
29
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var chainedCheckType = Object.assign(checkType.bind(null, false), {
|
|
34
|
-
isRequired: checkType.bind(null, true)
|
|
35
|
-
});
|
|
36
|
-
return chainedCheckType;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
11
|
function tupleType() {
|
|
40
|
-
for (var _len = arguments.length,
|
|
41
|
-
|
|
12
|
+
for (var _len = arguments.length, typeCheckers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
typeCheckers[_key] = arguments[_key];
|
|
42
14
|
}
|
|
43
15
|
|
|
44
|
-
return
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
if (!location) {
|
|
48
|
-
location = 'prop';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (!propFullName) {
|
|
52
|
-
propFullName = propName;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!Array.isArray(value)) {
|
|
56
|
-
return new Error("Invalid " + location + " `" + propFullName + "` supplied to `" + componentName + "`, expected " + types.length + "-element array");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (value.length === 0) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (value.length !== types.length) {
|
|
64
|
-
return new Error("Invalid " + location + " `" + propFullName + "` supplied to `" + componentName + "`, expected " + types.length + "-element array, got array of length " + value.length);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
for (var i = 0; i < value.length; ++i) {
|
|
68
|
-
var error = types[i](value, String(i), componentName, 'element', propFullName + "[" + i + "]");
|
|
16
|
+
return _propTypes.default.arrayOf(function (value, index) {
|
|
17
|
+
var _typeCheckers$index;
|
|
69
18
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
19
|
+
for (var _len2 = arguments.length, rest = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
20
|
+
rest[_key2 - 2] = arguments[_key2];
|
|
73
21
|
}
|
|
74
22
|
|
|
75
|
-
return
|
|
23
|
+
return (_typeCheckers$index = typeCheckers[index]).call.apply(_typeCheckers$index, [_propTypes.default, value, index].concat(rest));
|
|
76
24
|
});
|
|
77
25
|
}
|
|
78
26
|
|
package/cjs/utils/treeUtils.js
CHANGED
|
@@ -322,6 +322,7 @@ function createUpdateTreeDataFunction(params, _ref2) {
|
|
|
322
322
|
var dragNode = params.dragNode,
|
|
323
323
|
dropNode = params.dropNode,
|
|
324
324
|
dropNodePosition = params.dropNodePosition;
|
|
325
|
+
var cloneDragNode = (0, _extends3.default)({}, dragNode);
|
|
325
326
|
removeDragNode(data, params, {
|
|
326
327
|
valueKey: valueKey,
|
|
327
328
|
childrenKey: childrenKey
|
|
@@ -336,16 +337,16 @@ function createUpdateTreeDataFunction(params, _ref2) {
|
|
|
336
337
|
if (dropNodePosition === _utils2.TREE_NODE_DROP_POSITION.DRAG_OVER) {
|
|
337
338
|
_item2[childrenKey] = (0, _isNil2.default)(_item2[childrenKey]) ? [] : _item2[childrenKey];
|
|
338
339
|
|
|
339
|
-
_item2[childrenKey].push(
|
|
340
|
+
_item2[childrenKey].push(cloneDragNode);
|
|
340
341
|
|
|
341
342
|
break;
|
|
342
343
|
} else if (dropNodePosition === _utils2.TREE_NODE_DROP_POSITION.DRAG_OVER_TOP) {
|
|
343
344
|
// drag to top of node
|
|
344
|
-
items.splice(_index2, 0,
|
|
345
|
+
items.splice(_index2, 0, cloneDragNode);
|
|
345
346
|
break;
|
|
346
347
|
} else if (dropNodePosition === _utils2.TREE_NODE_DROP_POSITION.DRAG_OVER_BOTTOM) {
|
|
347
348
|
// drag to bottom of node
|
|
348
|
-
items.splice(_index2 + 1, 0,
|
|
349
|
+
items.splice(_index2 + 1, 0, cloneDragNode);
|
|
349
350
|
break;
|
|
350
351
|
}
|
|
351
352
|
}
|
|
@@ -19,8 +19,12 @@ function useClickOutside(_ref) {
|
|
|
19
19
|
(0, _react.useEffect)(function () {
|
|
20
20
|
if (enabled) {
|
|
21
21
|
var eventHandler = function eventHandler(event) {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
var _isOutsideRef$current;
|
|
23
|
+
|
|
24
|
+
if ((_isOutsideRef$current = isOutsideRef.current) !== null && _isOutsideRef$current !== void 0 && _isOutsideRef$current.call(isOutsideRef, event)) {
|
|
25
|
+
var _handleRef$current;
|
|
26
|
+
|
|
27
|
+
(_handleRef$current = handleRef.current) === null || _handleRef$current === void 0 ? void 0 : _handleRef$current.call(handleRef, event);
|
|
24
28
|
}
|
|
25
29
|
};
|
|
26
30
|
|