rsuite 5.0.0-beta.5 → 5.0.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/Animation/styles/index.less +16 -16
- package/Animation/styles/mixin.less +2 -2
- package/Button/styles/index.less +36 -1
- package/Button/styles/mixin.less +7 -1
- package/CHANGELOG.md +47 -4
- package/Calendar/styles/index.less +7 -1
- package/Checkbox/styles/index.less +18 -2
- package/DatePicker/styles/index.less +6 -2
- package/Drawer/styles/index.less +11 -2
- package/Drawer/styles/mixin.less +2 -2
- package/Dropdown/styles/index.less +4 -0
- package/Form/styles/mixin.less +6 -0
- package/InputGroup/styles/index.less +4 -0
- package/Message/styles/index.less +16 -0
- package/Modal/styles/index.less +3 -2
- package/Nav/styles/index.less +18 -2
- package/Navbar/styles/index.less +68 -34
- package/Notification/styles/index.less +9 -3
- package/Pagination/styles/index.less +12 -1
- package/Pagination/styles/mixin.less +7 -0
- package/Picker/styles/index.less +25 -3
- package/Picker/styles/mixin.less +7 -2
- package/Popover/styles/index.less +23 -30
- package/Popover/styles/mixins.less +72 -0
- package/README.md +4 -4
- package/Radio/styles/index.less +16 -0
- package/RadioGroup/styles/index.less +4 -0
- package/Rate/styles/index.less +13 -2
- package/Ripple/styles/index.less +8 -4
- package/Sidenav/styles/index.less +160 -47
- package/Table/styles/index.less +8 -0
- package/TagInput/package.json +7 -0
- package/TagInput/styles/index.less +13 -0
- package/Toggle/styles/index.less +29 -19
- package/Tooltip/styles/index.less +32 -38
- package/Tooltip/styles/mixins.less +72 -0
- package/Uploader/styles/index.less +11 -1
- package/cjs/@types/common.d.ts +2 -0
- package/cjs/Animation/Bounce.js +10 -4
- package/cjs/Animation/Collapse.d.ts +1 -48
- package/cjs/Animation/Collapse.js +60 -106
- package/cjs/Animation/Fade.js +10 -5
- package/cjs/Animation/Slide.js +8 -4
- package/cjs/Carousel/Carousel.d.ts +7 -0
- package/cjs/Carousel/Carousel.js +24 -11
- package/cjs/CheckTree/index.js +14 -5
- package/cjs/CheckTreePicker/CheckTreePicker.js +9 -5
- package/cjs/DatePicker/DatePicker.d.ts +5 -1
- package/cjs/DatePicker/DatePicker.js +2 -13
- package/cjs/DateRangePicker/Calendar.d.ts +2 -1
- package/cjs/DateRangePicker/Calendar.js +4 -3
- package/cjs/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/cjs/DateRangePicker/DateRangePicker.js +58 -43
- package/cjs/DateRangePicker/utils.d.ts +1 -1
- package/cjs/DateRangePicker/utils.js +9 -5
- package/cjs/Dropdown/Dropdown.js +31 -18
- package/cjs/Dropdown/DropdownContext.d.ts +4 -1
- package/cjs/Dropdown/DropdownItem.js +31 -4
- package/cjs/Dropdown/DropdownState.d.ts +37 -0
- package/cjs/Dropdown/DropdownState.js +66 -0
- package/cjs/Dropdown/DropdownToggle.js +3 -6
- package/cjs/InputNumber/InputNumber.js +11 -10
- package/cjs/InputPicker/InputPicker.d.ts +16 -3
- package/cjs/InputPicker/InputPicker.js +85 -44
- package/cjs/List/ListItem.d.ts +1 -1
- package/cjs/Menu/MenuItem.js +1 -1
- package/cjs/MultiCascader/MultiCascader.js +4 -3
- package/cjs/Nav/NavItem.js +11 -63
- package/cjs/Navbar/NavbarItem.d.ts +19 -0
- package/cjs/Navbar/NavbarItem.js +93 -0
- package/cjs/Pagination/Pagination.js +1 -1
- package/cjs/Picker/PickerToggle.js +2 -2
- package/cjs/Picker/utils.d.ts +1 -1
- package/cjs/Picker/utils.js +26 -22
- package/cjs/Progress/ProgressCircle.js +15 -15
- package/cjs/SelectPicker/SelectPicker.d.ts +1 -3
- package/cjs/Sidenav/SidenavDropdown.js +6 -1
- package/cjs/Sidenav/SidenavItem.js +46 -12
- package/cjs/Slider/Slider.js +2 -1
- package/cjs/TagInput/index.d.ts +13 -0
- package/cjs/TagInput/index.js +58 -0
- package/cjs/TagPicker/index.d.ts +10 -2
- package/cjs/TagPicker/index.js +25 -6
- package/cjs/Tree/Tree.d.ts +0 -2
- package/cjs/Tree/Tree.js +13 -4
- package/cjs/Tree/TreeContext.d.ts +7 -0
- package/cjs/Tree/TreeContext.js +13 -0
- package/cjs/TreePicker/TreeNode.js +10 -3
- package/cjs/TreePicker/TreePicker.js +22 -10
- package/cjs/Uploader/UploadFileItem.d.ts +5 -0
- package/cjs/Uploader/UploadFileItem.js +4 -3
- package/cjs/Uploader/Uploader.d.ts +8 -3
- package/cjs/Uploader/Uploader.js +12 -6
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +5 -1
- package/cjs/utils/ajaxUpload.d.ts +5 -1
- package/cjs/utils/ajaxUpload.js +24 -13
- package/cjs/utils/constants.d.ts +1 -0
- package/cjs/utils/constants.js +1 -0
- package/cjs/utils/dateUtils.d.ts +1 -0
- package/cjs/utils/dateUtils.js +5 -1
- package/cjs/utils/useInternalId.d.ts +4 -0
- package/cjs/utils/useInternalId.js +24 -0
- package/cjs/utils/useUniqueId.d.ts +1 -1
- package/cjs/utils/useUniqueId.js +1 -1
- package/dist/rsuite-rtl.css +1614 -221
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +1618 -221
- package/dist/rsuite.js +288 -288
- 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/@types/common.d.ts +2 -0
- package/esm/Animation/Bounce.js +8 -4
- package/esm/Animation/Collapse.d.ts +1 -48
- package/esm/Animation/Collapse.js +59 -104
- package/esm/Animation/Fade.js +8 -4
- package/esm/Animation/Slide.js +6 -3
- package/esm/Carousel/Carousel.d.ts +7 -0
- package/esm/Carousel/Carousel.js +25 -12
- package/esm/CheckTree/index.js +11 -5
- package/esm/CheckTreePicker/CheckTreePicker.js +8 -6
- package/esm/DatePicker/DatePicker.d.ts +5 -1
- package/esm/DatePicker/DatePicker.js +2 -13
- package/esm/DateRangePicker/Calendar.d.ts +2 -1
- package/esm/DateRangePicker/Calendar.js +4 -3
- package/esm/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/esm/DateRangePicker/DateRangePicker.js +27 -12
- package/esm/DateRangePicker/utils.d.ts +1 -1
- package/esm/DateRangePicker/utils.js +7 -3
- package/esm/Dropdown/Dropdown.js +30 -19
- package/esm/Dropdown/DropdownContext.d.ts +4 -1
- package/esm/Dropdown/DropdownItem.js +30 -6
- package/esm/Dropdown/DropdownState.d.ts +37 -0
- package/esm/Dropdown/DropdownState.js +55 -0
- package/esm/Dropdown/DropdownToggle.js +3 -6
- package/esm/InputNumber/InputNumber.js +11 -10
- package/esm/InputPicker/InputPicker.d.ts +16 -3
- package/esm/InputPicker/InputPicker.js +84 -45
- package/esm/List/ListItem.d.ts +1 -1
- package/esm/Menu/MenuItem.js +1 -1
- package/esm/MultiCascader/MultiCascader.js +4 -3
- package/esm/Nav/NavItem.js +12 -61
- package/esm/Navbar/NavbarItem.d.ts +19 -0
- package/esm/Navbar/NavbarItem.js +73 -0
- package/esm/Pagination/Pagination.js +1 -1
- package/esm/Picker/PickerToggle.js +2 -2
- package/esm/Picker/utils.d.ts +1 -1
- package/esm/Picker/utils.js +26 -22
- package/esm/Progress/ProgressCircle.js +15 -15
- package/esm/SelectPicker/SelectPicker.d.ts +1 -3
- package/esm/Sidenav/SidenavDropdown.js +5 -1
- package/esm/Sidenav/SidenavItem.js +47 -13
- package/esm/Slider/Slider.js +2 -1
- package/esm/TagInput/index.d.ts +13 -0
- package/esm/TagInput/index.js +44 -0
- package/esm/TagPicker/index.d.ts +10 -2
- package/esm/TagPicker/index.js +23 -6
- package/esm/Tree/Tree.d.ts +0 -2
- package/esm/Tree/Tree.js +10 -4
- package/esm/Tree/TreeContext.d.ts +7 -0
- package/esm/Tree/TreeContext.js +3 -0
- package/esm/TreePicker/TreeNode.js +10 -4
- package/esm/TreePicker/TreePicker.js +23 -12
- package/esm/Uploader/UploadFileItem.d.ts +5 -0
- package/esm/Uploader/UploadFileItem.js +2 -3
- package/esm/Uploader/Uploader.d.ts +8 -3
- package/esm/Uploader/Uploader.js +12 -6
- package/esm/index.d.ts +2 -0
- package/esm/index.js +1 -0
- package/esm/utils/ajaxUpload.d.ts +5 -1
- package/esm/utils/ajaxUpload.js +24 -13
- package/esm/utils/constants.d.ts +1 -0
- package/esm/utils/constants.js +1 -0
- package/esm/utils/dateUtils.d.ts +1 -0
- package/esm/utils/dateUtils.js +1 -0
- package/esm/utils/useInternalId.d.ts +4 -0
- package/esm/utils/useInternalId.js +16 -0
- package/esm/utils/useUniqueId.d.ts +1 -1
- package/esm/utils/useUniqueId.js +1 -1
- package/package.json +4 -9
- package/styles/color-modes/dark.less +28 -5
- package/styles/color-modes/high-contrast.less +317 -0
- package/styles/color-modes/light.less +24 -1
- package/styles/color-modes.less +5 -0
- package/styles/colors/high-contrast.less +105 -0
- package/styles/index.less +1 -0
- package/styles/mixins/color-modes.less +6 -0
- package/styles/mixins/listbox.less +13 -1
- package/styles/mixins/menu.less +7 -0
- package/styles/mixins/utilities.less +9 -1
- package/styles/variables.less +11 -0
|
@@ -38,12 +38,17 @@ export interface UploaderProps extends WithAsProps {
|
|
|
38
38
|
multiple?: boolean;
|
|
39
39
|
/** Disabled upload button */
|
|
40
40
|
disabled?: boolean;
|
|
41
|
+
/** Disabled file item */
|
|
42
|
+
disabledFileItem?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* If 'true', disable using a multipart form for file upload and instead stream the file.
|
|
45
|
+
* Some APIs (e.g. Amazon S3) may expect the file to be streamed rather than sent via a form. Defaults to false.
|
|
46
|
+
**/
|
|
47
|
+
disableMultipart?: boolean;
|
|
41
48
|
/** Render the control as plain text */
|
|
42
49
|
plaintext?: boolean;
|
|
43
50
|
/** Make the control readonly */
|
|
44
51
|
readOnly?: boolean;
|
|
45
|
-
/** Disabled file item */
|
|
46
|
-
disabledFileItem?: boolean;
|
|
47
52
|
/** Upload the parameter name of the corresponding file */
|
|
48
53
|
name?: string;
|
|
49
54
|
/** Set upload timeout */
|
|
@@ -73,7 +78,7 @@ export interface UploaderProps extends WithAsProps {
|
|
|
73
78
|
/** callback function that the upload queue has changed */
|
|
74
79
|
onChange?: (fileList: FileType[]) => void;
|
|
75
80
|
/** The callback function that starts the upload file */
|
|
76
|
-
onUpload?: (file: FileType) => void;
|
|
81
|
+
onUpload?: (file: FileType, uploadData: any, xhr: XMLHttpRequest) => void;
|
|
77
82
|
/** In the file list, for uploading failed files, click the callback function to upload */
|
|
78
83
|
onReupload?: (file: FileType) => void;
|
|
79
84
|
/** In the file list, click the callback function for the uploaded file */
|
package/esm/Uploader/Uploader.js
CHANGED
|
@@ -130,6 +130,7 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
130
130
|
action = props.action,
|
|
131
131
|
headers = props.headers,
|
|
132
132
|
withCredentials = props.withCredentials,
|
|
133
|
+
disableMultipart = props.disableMultipart,
|
|
133
134
|
timeout = props.timeout,
|
|
134
135
|
data = props.data,
|
|
135
136
|
onRemove = props.onRemove,
|
|
@@ -143,7 +144,7 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
143
144
|
onError = props.onError,
|
|
144
145
|
onProgress = props.onProgress,
|
|
145
146
|
onReupload = props.onReupload,
|
|
146
|
-
rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "listType", "defaultFileList", "fileList", "fileListVisible", "locale", "style", "draggable", "name", "multiple", "disabled", "readOnly", "plaintext", "accept", "children", "toggleAs", "removable", "disabledFileItem", "maxPreviewFileSize", "autoUpload", "action", "headers", "withCredentials", "timeout", "data", "onRemove", "onUpload", "shouldUpload", "shouldQueueUpdate", "renderFileInfo", "onPreview", "onChange", "onSuccess", "onError", "onProgress", "onReupload"]);
|
|
147
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "listType", "defaultFileList", "fileList", "fileListVisible", "locale", "style", "draggable", "name", "multiple", "disabled", "readOnly", "plaintext", "accept", "children", "toggleAs", "removable", "disabledFileItem", "maxPreviewFileSize", "autoUpload", "action", "headers", "withCredentials", "disableMultipart", "timeout", "data", "onRemove", "onUpload", "shouldUpload", "shouldQueueUpdate", "renderFileInfo", "onPreview", "onChange", "onSuccess", "onError", "onProgress", "onReupload"]);
|
|
147
148
|
|
|
148
149
|
var _useClassNames = useClassNames(classPrefix),
|
|
149
150
|
merge = _useClassNames.merge,
|
|
@@ -243,24 +244,28 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
243
244
|
*/
|
|
244
245
|
|
|
245
246
|
var handleUploadFile = useCallback(function (file) {
|
|
246
|
-
var
|
|
247
|
+
var _ajaxUpload = ajaxUpload({
|
|
247
248
|
name: name,
|
|
248
249
|
timeout: timeout,
|
|
249
250
|
headers: headers,
|
|
250
251
|
data: data,
|
|
251
252
|
withCredentials: withCredentials,
|
|
253
|
+
disableMultipart: disableMultipart,
|
|
252
254
|
file: file.blobFile,
|
|
253
255
|
url: action,
|
|
254
256
|
onError: handleAjaxUploadError.bind(null, file),
|
|
255
257
|
onSuccess: handleAjaxUploadSuccess.bind(null, file),
|
|
256
258
|
onProgress: handleAjaxUploadProgress.bind(null, file)
|
|
257
|
-
})
|
|
259
|
+
}),
|
|
260
|
+
xhr = _ajaxUpload.xhr,
|
|
261
|
+
uploadData = _ajaxUpload.data;
|
|
262
|
+
|
|
258
263
|
updateFileStatus(_extends({}, file, {
|
|
259
264
|
status: 'uploading'
|
|
260
265
|
}));
|
|
261
266
|
xhrs.current[file.fileKey] = xhr;
|
|
262
|
-
onUpload === null || onUpload === void 0 ? void 0 : onUpload(file);
|
|
263
|
-
}, [action, data, handleAjaxUploadError, handleAjaxUploadProgress, handleAjaxUploadSuccess, headers, name, onUpload, timeout, updateFileStatus, withCredentials]);
|
|
267
|
+
onUpload === null || onUpload === void 0 ? void 0 : onUpload(file, uploadData, xhr);
|
|
268
|
+
}, [action, data, handleAjaxUploadError, handleAjaxUploadProgress, handleAjaxUploadSuccess, headers, name, onUpload, timeout, updateFileStatus, withCredentials, disableMultipart]);
|
|
264
269
|
var handleAjaxUpload = useCallback(function () {
|
|
265
270
|
fileList.current.forEach(function (file) {
|
|
266
271
|
var checkState = shouldUpload === null || shouldUpload === void 0 ? void 0 : shouldUpload(file);
|
|
@@ -458,6 +463,7 @@ Uploader.propTypes = {
|
|
|
458
463
|
renderFileInfo: PropTypes.func,
|
|
459
464
|
removable: PropTypes.bool,
|
|
460
465
|
fileListVisible: PropTypes.bool,
|
|
461
|
-
draggable: PropTypes.bool
|
|
466
|
+
draggable: PropTypes.bool,
|
|
467
|
+
disableMultipart: PropTypes.bool
|
|
462
468
|
};
|
|
463
469
|
export default Uploader;
|
package/esm/index.d.ts
CHANGED
|
@@ -74,6 +74,8 @@ export { default as InputPicker } from './InputPicker';
|
|
|
74
74
|
export type { InputPickerProps } from './InputPicker';
|
|
75
75
|
export { default as TagPicker } from './TagPicker';
|
|
76
76
|
export type { TagPickerProps } from './TagPicker';
|
|
77
|
+
export { default as TagInput } from './TagInput';
|
|
78
|
+
export type { TagInputProps } from './TagInput';
|
|
77
79
|
export { default as TreePicker } from './TreePicker';
|
|
78
80
|
export type { TreePickerProps } from './TreePicker';
|
|
79
81
|
export { default as CheckTreePicker } from './CheckTreePicker';
|
package/esm/index.js
CHANGED
|
@@ -39,6 +39,7 @@ export { default as SelectPicker } from './SelectPicker';
|
|
|
39
39
|
export { default as CheckPicker } from './CheckPicker';
|
|
40
40
|
export { default as InputPicker } from './InputPicker';
|
|
41
41
|
export { default as TagPicker } from './TagPicker';
|
|
42
|
+
export { default as TagInput } from './TagInput';
|
|
42
43
|
export { default as TreePicker } from './TreePicker';
|
|
43
44
|
export { default as CheckTreePicker } from './CheckTreePicker';
|
|
44
45
|
export { default as Cascader } from './Cascader';
|
|
@@ -7,6 +7,7 @@ interface Options {
|
|
|
7
7
|
timeout?: number;
|
|
8
8
|
data?: any;
|
|
9
9
|
withCredentials?: boolean;
|
|
10
|
+
disableMultipart?: boolean;
|
|
10
11
|
headers?: any;
|
|
11
12
|
file: File;
|
|
12
13
|
url: string;
|
|
@@ -14,5 +15,8 @@ interface Options {
|
|
|
14
15
|
onSuccess: (response: any, event: ProgressEvent, xhr: XMLHttpRequest) => void;
|
|
15
16
|
onProgress: (percent: number, event: ProgressEvent, xhr: XMLHttpRequest) => void;
|
|
16
17
|
}
|
|
17
|
-
export default function ajaxUpload(options: Options):
|
|
18
|
+
export default function ajaxUpload(options: Options): {
|
|
19
|
+
xhr: XMLHttpRequest;
|
|
20
|
+
data: any;
|
|
21
|
+
};
|
|
18
22
|
export {};
|
package/esm/utils/ajaxUpload.js
CHANGED
|
@@ -24,14 +24,22 @@ export default function ajaxUpload(options) {
|
|
|
24
24
|
onProgress = options.onProgress,
|
|
25
25
|
file = options.file,
|
|
26
26
|
url = options.url,
|
|
27
|
-
withCredentials = options.withCredentials
|
|
27
|
+
withCredentials = options.withCredentials,
|
|
28
|
+
disableMultipart = options.disableMultipart;
|
|
28
29
|
var xhr = new XMLHttpRequest();
|
|
29
|
-
var
|
|
30
|
-
formData.append(name, file, file.name);
|
|
30
|
+
var sendableData = null;
|
|
31
31
|
xhr.open('POST', url, true);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
|
|
33
|
+
if (!disableMultipart) {
|
|
34
|
+
sendableData = new FormData();
|
|
35
|
+
sendableData.append(name, file, file.name);
|
|
36
|
+
Object.keys(data).forEach(function (key) {
|
|
37
|
+
return sendableData.append(key, data[key]);
|
|
38
|
+
});
|
|
39
|
+
} else {
|
|
40
|
+
sendableData = file;
|
|
41
|
+
}
|
|
42
|
+
|
|
35
43
|
Object.keys(headers).forEach(function (key) {
|
|
36
44
|
if (headers[key] !== null) {
|
|
37
45
|
xhr.setRequestHeader(key, headers[key]);
|
|
@@ -46,7 +54,7 @@ export default function ajaxUpload(options) {
|
|
|
46
54
|
xhr.timeout = timeout;
|
|
47
55
|
|
|
48
56
|
xhr.ontimeout = function (event) {
|
|
49
|
-
onError({
|
|
57
|
+
onError === null || onError === void 0 ? void 0 : onError({
|
|
50
58
|
type: 'timeout'
|
|
51
59
|
}, event, xhr);
|
|
52
60
|
};
|
|
@@ -60,14 +68,14 @@ export default function ajaxUpload(options) {
|
|
|
60
68
|
var resp = getResponse(xhr);
|
|
61
69
|
|
|
62
70
|
if (xhr.status < 200 || xhr.status >= 300) {
|
|
63
|
-
onError({
|
|
71
|
+
onError === null || onError === void 0 ? void 0 : onError({
|
|
64
72
|
type: 'server_error',
|
|
65
73
|
response: resp
|
|
66
74
|
}, event, xhr);
|
|
67
75
|
return;
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
onSuccess(resp, event, xhr);
|
|
78
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(resp, event, xhr);
|
|
71
79
|
};
|
|
72
80
|
|
|
73
81
|
if (xhr.upload) {
|
|
@@ -78,16 +86,19 @@ export default function ajaxUpload(options) {
|
|
|
78
86
|
percent = event.loaded / event.total * 100;
|
|
79
87
|
}
|
|
80
88
|
|
|
81
|
-
onProgress(percent, event, xhr);
|
|
89
|
+
onProgress === null || onProgress === void 0 ? void 0 : onProgress(percent, event, xhr);
|
|
82
90
|
};
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
xhr.onerror = function (event) {
|
|
86
|
-
onError({
|
|
94
|
+
onError === null || onError === void 0 ? void 0 : onError({
|
|
87
95
|
type: 'xhr_error'
|
|
88
96
|
}, event, xhr);
|
|
89
97
|
};
|
|
90
98
|
|
|
91
|
-
xhr.send(
|
|
92
|
-
return
|
|
99
|
+
xhr.send(sendableData);
|
|
100
|
+
return {
|
|
101
|
+
xhr: xhr,
|
|
102
|
+
data: sendableData
|
|
103
|
+
};
|
|
93
104
|
}
|
package/esm/utils/constants.d.ts
CHANGED
package/esm/utils/constants.js
CHANGED
package/esm/utils/dateUtils.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { default as isBefore } from 'date-fns/isBefore';
|
|
|
19
19
|
export { default as isEqual } from 'date-fns/isEqual';
|
|
20
20
|
export { default as isSameDay } from 'date-fns/isSameDay';
|
|
21
21
|
export { default as isSameMonth } from 'date-fns/isSameMonth';
|
|
22
|
+
export { default as isSameSecond } from 'date-fns/isSameSecond';
|
|
22
23
|
export { default as parse } from 'date-fns/parse';
|
|
23
24
|
export { default as parseISO } from 'date-fns/parseISO';
|
|
24
25
|
export { default as setDate } from 'date-fns/setDate';
|
package/esm/utils/dateUtils.js
CHANGED
|
@@ -26,6 +26,7 @@ export { default as isBefore } from 'date-fns/isBefore';
|
|
|
26
26
|
export { default as isEqual } from 'date-fns/isEqual';
|
|
27
27
|
export { default as isSameDay } from 'date-fns/isSameDay';
|
|
28
28
|
export { default as isSameMonth } from 'date-fns/isSameMonth';
|
|
29
|
+
export { default as isSameSecond } from 'date-fns/isSameSecond';
|
|
29
30
|
export { default as parse } from 'date-fns/parse';
|
|
30
31
|
export { default as parseISO } from 'date-fns/parseISO';
|
|
31
32
|
export { default as setDate } from 'date-fns/setDate';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useDebugValue, useRef } from 'react';
|
|
2
|
+
import uniqueId from 'lodash/uniqueId';
|
|
3
|
+
/**
|
|
4
|
+
* Used for generating unique ID for DOM elements
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export default function useInternalId(prefix) {
|
|
8
|
+
var idRef = useRef();
|
|
9
|
+
|
|
10
|
+
if (!idRef.current) {
|
|
11
|
+
idRef.current = uniqueId("internal://" + prefix);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
useDebugValue(idRef.current);
|
|
15
|
+
return idRef.current;
|
|
16
|
+
}
|
package/esm/utils/useUniqueId.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsuite",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "A suite of react components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"prop-types": "^15.7.2",
|
|
40
40
|
"react-text-mask": "^5.4.3",
|
|
41
41
|
"react-virtualized": "^9.22.3",
|
|
42
|
-
"rsuite-table": "^5.0.0
|
|
43
|
-
"schema-typed": "^2.0.
|
|
42
|
+
"rsuite-table": "^5.0.0",
|
|
43
|
+
"schema-typed": "^2.0.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.8.0",
|
|
@@ -57,10 +57,5 @@
|
|
|
57
57
|
"dist/*",
|
|
58
58
|
"*.less",
|
|
59
59
|
"*.css"
|
|
60
|
-
]
|
|
61
|
-
"husky": {
|
|
62
|
-
"hooks": {
|
|
63
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
60
|
+
]
|
|
66
61
|
}
|
|
@@ -82,19 +82,19 @@
|
|
|
82
82
|
--rs-message-success-header: #fff;
|
|
83
83
|
--rs-message-success-text: #fff;
|
|
84
84
|
--rs-message-success-icon: #fff;
|
|
85
|
-
--rs-message-success-bg: @green;
|
|
85
|
+
--rs-message-success-bg: @green-500;
|
|
86
86
|
--rs-message-info-header: #fff;
|
|
87
87
|
--rs-message-info-text: #fff;
|
|
88
88
|
--rs-message-info-icon: #fff;
|
|
89
|
-
--rs-message-info-bg: @blue;
|
|
89
|
+
--rs-message-info-bg: @blue-500;
|
|
90
90
|
--rs-message-warning-header: @B900;
|
|
91
91
|
--rs-message-warning-text: @B900;
|
|
92
92
|
--rs-message-warning-icon: @B900;
|
|
93
|
-
--rs-message-warning-bg: @yellow;
|
|
93
|
+
--rs-message-warning-bg: @yellow-500;
|
|
94
94
|
--rs-message-error-header: #fff;
|
|
95
95
|
--rs-message-error-text: #fff;
|
|
96
96
|
--rs-message-error-icon: #fff;
|
|
97
|
-
--rs-message-error-bg: @red;
|
|
97
|
+
--rs-message-error-bg: @red-500;
|
|
98
98
|
|
|
99
99
|
// Tooltip
|
|
100
100
|
--rs-tooltip-bg: @B500;
|
|
@@ -159,6 +159,22 @@
|
|
|
159
159
|
--rs-navbar-subtle-hover-bg: @B700;
|
|
160
160
|
--rs-navbar-subtle-hover-text: @B050;
|
|
161
161
|
|
|
162
|
+
// Sidenav
|
|
163
|
+
--rs-sidenav-default-bg: @B800;
|
|
164
|
+
--rs-sidenav-default-text: @B200;
|
|
165
|
+
--rs-sidenav-default-selected-text: @H500;
|
|
166
|
+
--rs-sidenav-default-hover-bg: @B700;
|
|
167
|
+
--rs-sidenav-default-hover-text: @B050;
|
|
168
|
+
--rs-sidenav-inverse-bg: @H700;
|
|
169
|
+
--rs-sidenav-inverse-text: #fff;
|
|
170
|
+
--rs-sidenav-inverse-selected-bg: @H400;
|
|
171
|
+
--rs-sidenav-inverse-hover-bg: @H600;
|
|
172
|
+
--rs-sidenav-subtle-bg: transparent;
|
|
173
|
+
--rs-sidenav-subtle-text: @B200;
|
|
174
|
+
--rs-sidenav-subtle-selected-text: @H500;
|
|
175
|
+
--rs-sidenav-subtle-hover-bg: @B700;
|
|
176
|
+
--rs-sidenav-subtle-hover-text: @B050;
|
|
177
|
+
|
|
162
178
|
// Input
|
|
163
179
|
--rs-input-bg: @B800;
|
|
164
180
|
--rs-input-focus-border: @H500;
|
|
@@ -184,6 +200,10 @@
|
|
|
184
200
|
--rs-radio-checked-bg: @H500;
|
|
185
201
|
--rs-radio-disabled-bg: @B500;
|
|
186
202
|
|
|
203
|
+
// Rate
|
|
204
|
+
--rs-rate-symbol: @B600;
|
|
205
|
+
--rs-rate-symbol-checked: @yellow-500;
|
|
206
|
+
|
|
187
207
|
// Toggle
|
|
188
208
|
--rs-toggle-bg: @B400;
|
|
189
209
|
--rs-toggle-thumb: #fff;
|
|
@@ -191,6 +211,7 @@
|
|
|
191
211
|
--rs-toggle-disabled-bg: @B600;
|
|
192
212
|
--rs-toggle-disabled-thumb: @B500;
|
|
193
213
|
--rs-toggle-checked-bg: @H700;
|
|
214
|
+
--rs-toggle-checked-thumb: #fff;
|
|
194
215
|
--rs-toggle-checked-hover-bg: @H600;
|
|
195
216
|
--rs-toggle-checked-disabled-bg: @H900;
|
|
196
217
|
--rs-toggle-checked-disabled-thumb: @B300;
|
|
@@ -265,13 +286,15 @@
|
|
|
265
286
|
|
|
266
287
|
// Picker
|
|
267
288
|
--rs-picker-value: @H500;
|
|
268
|
-
--rs-picker-count: @H700;
|
|
289
|
+
--rs-picker-count-bg: @H700;
|
|
290
|
+
--rs-picker-count-text: #fff;
|
|
269
291
|
|
|
270
292
|
// Calendar
|
|
271
293
|
--rs-calendar-today-bg: @H700;
|
|
272
294
|
--rs-calendar-today-text: #fff;
|
|
273
295
|
--rs-calendar-range-bg: fade(@H900, 50%);
|
|
274
296
|
--rs-calendar-time-unit-bg: @B600;
|
|
297
|
+
--rs-calendar-date-selected-text: #fff;
|
|
275
298
|
|
|
276
299
|
// Popover
|
|
277
300
|
--rs-popover-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|