rsuite 4.8.9 → 4.9.3
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/CHANGELOG.md +43 -0
- package/dist/rsuite.js +4744 -2892
- package/dist/rsuite.min.js +2 -2
- package/dist/rsuite.min.js.map +1 -1
- package/dist/styles/rsuite-dark-rtl.css +2 -0
- package/dist/styles/rsuite-dark-rtl.min.css +1 -1
- package/dist/styles/rsuite-dark-rtl.min.css.map +1 -1
- package/dist/styles/rsuite-dark.css +2 -0
- package/dist/styles/rsuite-dark.min.css +1 -1
- package/dist/styles/rsuite-dark.min.css.map +1 -1
- package/dist/styles/rsuite-default-rtl.css +2 -0
- package/dist/styles/rsuite-default-rtl.min.css +1 -1
- package/dist/styles/rsuite-default-rtl.min.css.map +1 -1
- package/dist/styles/rsuite-default.css +2 -0
- package/dist/styles/rsuite-default.min.css +1 -1
- package/dist/styles/rsuite-default.min.css.map +1 -1
- package/es/Footer/Footer.js +1 -1
- package/es/InputPicker/InputAutosize.js +3 -1
- package/es/InputPicker/InputPicker.js +20 -17
- package/es/Nav/Nav.js +5 -4
- package/es/Overlay/OverlayTrigger.js +7 -1
- package/es/RangeSlider/RangeSlider.js +1 -1
- package/es/Uploader/Uploader.d.ts +5 -2
- package/es/Uploader/Uploader.js +75 -53
- package/es/styles/utilities.less +2 -0
- package/lib/Footer/Footer.js +1 -1
- package/lib/InputPicker/InputAutosize.js +3 -1
- package/lib/InputPicker/InputPicker.js +20 -17
- package/lib/Nav/Nav.js +4 -3
- package/lib/Overlay/OverlayTrigger.js +7 -1
- package/lib/RangeSlider/RangeSlider.js +1 -1
- package/lib/Uploader/Uploader.d.ts +5 -2
- package/lib/Uploader/Uploader.js +75 -53
- package/lib/styles/utilities.less +2 -0
- package/package.json +2 -2
- package/src/Footer/Footer.tsx +1 -1
- package/src/Footer/test/FooterSpec.js +1 -0
- package/src/InputPicker/InputAutosize.tsx +3 -1
- package/src/InputPicker/InputPicker.tsx +13 -16
- package/src/InputPicker/test/InputPickerSpec.js +5 -0
- package/src/Nav/Nav.tsx +10 -4
- package/src/Nav/test/NavSpec.js +35 -0
- package/src/Overlay/OverlayTrigger.tsx +7 -1
- package/src/RangeSlider/RangeSlider.tsx +1 -1
- package/src/TagPicker/test/TagPickerSpec.js +5 -0
- package/src/Uploader/Uploader.d.ts +5 -2
- package/src/Uploader/Uploader.tsx +29 -8
- package/src/Whisper/test/WhisperSpec.js +46 -1
- package/src/styles/utilities.less +2 -0
package/es/Footer/Footer.js
CHANGED
|
@@ -24,7 +24,7 @@ function (_React$Component) {
|
|
|
24
24
|
props = _objectWithoutPropertiesLoose(_this$props, ["className", "classPrefix"]);
|
|
25
25
|
|
|
26
26
|
var classes = classNames(classPrefix, className);
|
|
27
|
-
return React.createElement("
|
|
27
|
+
return React.createElement("footer", _extends({}, props, {
|
|
28
28
|
className: classes
|
|
29
29
|
}));
|
|
30
30
|
};
|
|
@@ -138,7 +138,8 @@ function (_React$Component) {
|
|
|
138
138
|
className = _this$props3.className,
|
|
139
139
|
placeholder = _this$props3.placeholder,
|
|
140
140
|
inputClassName = _this$props3.inputClassName,
|
|
141
|
-
inputStyle = _this$props3.inputStyle
|
|
141
|
+
inputStyle = _this$props3.inputStyle,
|
|
142
|
+
tabIndex = _this$props3.tabIndex;
|
|
142
143
|
var inputId = this.getInputId();
|
|
143
144
|
var sizerValue = [defaultValue, value, ''].reduce(function (previousValue, currentValue) {
|
|
144
145
|
if (previousValue !== null && previousValue !== undefined) {
|
|
@@ -165,6 +166,7 @@ function (_React$Component) {
|
|
|
165
166
|
htmlInputProps.className = inputClassName;
|
|
166
167
|
htmlInputProps.id = inputId || inputId;
|
|
167
168
|
htmlInputProps.style = nextInputStyle;
|
|
169
|
+
htmlInputProps.tabIndex = tabIndex;
|
|
168
170
|
return React.createElement("div", {
|
|
169
171
|
className: className,
|
|
170
172
|
style: wrapperStyle
|
|
@@ -353,21 +353,12 @@ function (_React$Component) {
|
|
|
353
353
|
|
|
354
354
|
var value = _this.getValue();
|
|
355
355
|
|
|
356
|
-
var nextState = {
|
|
357
|
-
focusItemValue: multi ? _get(value, 0) : value
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
if (multi) {
|
|
361
|
-
/**
|
|
362
|
-
在多选的情况下, 当 searchKeyword 过长,在 focus 的时候会导致内容换行。
|
|
363
|
-
把 searchKeyword 清空是为了,Menu 在展开时候位置正确。
|
|
364
|
-
*/
|
|
365
|
-
nextState.searchKeyword = '';
|
|
366
|
-
}
|
|
367
|
-
|
|
368
356
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
369
357
|
|
|
370
|
-
_this.setState(
|
|
358
|
+
_this.setState({
|
|
359
|
+
focusItemValue: multi ? _get(value, 0) : value,
|
|
360
|
+
searchKeyword: ''
|
|
361
|
+
});
|
|
371
362
|
};
|
|
372
363
|
|
|
373
364
|
_this.handleEnter = function () {
|
|
@@ -402,6 +393,16 @@ function (_React$Component) {
|
|
|
402
393
|
_this.handleChange(value, event);
|
|
403
394
|
};
|
|
404
395
|
|
|
396
|
+
_this.handleInputFocus = function () {
|
|
397
|
+
var _this$triggerRef$curr5;
|
|
398
|
+
|
|
399
|
+
_this.setState({
|
|
400
|
+
open: true
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
(_this$triggerRef$curr5 = _this.triggerRef.current) === null || _this$triggerRef$curr5 === void 0 ? void 0 : _this$triggerRef$curr5.show();
|
|
404
|
+
};
|
|
405
|
+
|
|
405
406
|
_this.removeLastItem = function (event) {
|
|
406
407
|
var tagName = _get(event, 'target.tagName');
|
|
407
408
|
|
|
@@ -764,10 +765,9 @@ function (_React$Component) {
|
|
|
764
765
|
var _this$props17 = this.props,
|
|
765
766
|
multi = _this$props17.multi,
|
|
766
767
|
onBlur = _this$props17.onBlur,
|
|
767
|
-
onFocus = _this$props17.onFocus
|
|
768
|
+
onFocus = _this$props17.onFocus,
|
|
769
|
+
tabIndex = _this$props17.tabIndex;
|
|
768
770
|
var props = {
|
|
769
|
-
onBlur: onBlur,
|
|
770
|
-
onFocus: onFocus,
|
|
771
771
|
componentClass: 'input',
|
|
772
772
|
inputRef: this.inputRef
|
|
773
773
|
};
|
|
@@ -781,8 +781,11 @@ function (_React$Component) {
|
|
|
781
781
|
}
|
|
782
782
|
|
|
783
783
|
return React.createElement(InputSearch, _extends({}, props, {
|
|
784
|
+
tabIndex: tabIndex,
|
|
784
785
|
onChange: this.handleSearch,
|
|
785
|
-
value: this.state.open ? this.state.searchKeyword : ''
|
|
786
|
+
value: this.state.open ? this.state.searchKeyword : '',
|
|
787
|
+
onBlur: onBlur,
|
|
788
|
+
onFocus: createChainedFunction(this.handleInputFocus, onFocus)
|
|
786
789
|
}));
|
|
787
790
|
};
|
|
788
791
|
|
package/es/Nav/Nav.js
CHANGED
|
@@ -7,7 +7,7 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { setStatic } from 'recompose';
|
|
8
8
|
import shallowEqual from '../utils/shallowEqual';
|
|
9
9
|
import NavItem from './NavItem';
|
|
10
|
-
import { prefix, getUnhandledProps, defaultProps, ReactChildren } from '../utils';
|
|
10
|
+
import { prefix, getUnhandledProps, defaultProps, ReactChildren, createChainedFunction } from '../utils';
|
|
11
11
|
import { getClassNamePrefix } from '../utils/prefix';
|
|
12
12
|
import { NavbarContext } from '../Navbar/Navbar';
|
|
13
13
|
import { SidenavContext } from '../Sidenav/Sidenav';
|
|
@@ -54,20 +54,21 @@ function (_React$Component) {
|
|
|
54
54
|
var _item$props = item.props,
|
|
55
55
|
eventKey = _item$props.eventKey,
|
|
56
56
|
active = _item$props.active,
|
|
57
|
-
|
|
57
|
+
onSelectItem = _item$props.onSelect,
|
|
58
|
+
rest = _objectWithoutPropertiesLoose(_item$props, ["eventKey", "active", "onSelect"]);
|
|
58
59
|
|
|
59
60
|
var displayName = item === null || item === void 0 ? void 0 : (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.displayName;
|
|
60
61
|
var hasTooltip = sidenav && !expanded;
|
|
61
62
|
|
|
62
63
|
if (~(displayName === null || displayName === void 0 ? void 0 : displayName.indexOf('(NavItem)'))) {
|
|
63
64
|
return _extends({}, rest, {
|
|
64
|
-
onSelect: onSelect,
|
|
65
|
+
onSelect: createChainedFunction(onSelect, onSelectItem),
|
|
65
66
|
hasTooltip: hasTooltip,
|
|
66
67
|
active: typeof activeKey === 'undefined' ? active : shallowEqual(activeKey, eventKey)
|
|
67
68
|
});
|
|
68
69
|
} else if (~(displayName === null || displayName === void 0 ? void 0 : displayName.indexOf('(Dropdown)'))) {
|
|
69
70
|
return _extends({}, rest, {
|
|
70
|
-
onSelect: onSelect,
|
|
71
|
+
onSelect: createChainedFunction(onSelect, onSelectItem),
|
|
71
72
|
activeKey: activeKey,
|
|
72
73
|
showHeader: hasTooltip,
|
|
73
74
|
componentClass: 'li'
|
|
@@ -200,6 +200,8 @@ function (_React$Component) {
|
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
_proto.renderOverlay = function renderOverlay() {
|
|
203
|
+
var _this2 = this;
|
|
204
|
+
|
|
203
205
|
var _this$props4 = this.props,
|
|
204
206
|
open = _this$props4.open,
|
|
205
207
|
speaker = _this$props4.speaker,
|
|
@@ -228,7 +230,11 @@ function (_React$Component) {
|
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
if (typeof speaker === 'function') {
|
|
231
|
-
return React.createElement(Overlay, overlayProps,
|
|
233
|
+
return React.createElement(Overlay, overlayProps, function (props, ref) {
|
|
234
|
+
return speaker(_extends({}, props, {
|
|
235
|
+
onClose: _this2.hide
|
|
236
|
+
}), ref);
|
|
237
|
+
});
|
|
232
238
|
}
|
|
233
239
|
|
|
234
240
|
return React.createElement(Overlay, overlayProps, React.cloneElement(speaker, speakerProps));
|
|
@@ -67,10 +67,13 @@ export interface UploaderProps extends StandardProps {
|
|
|
67
67
|
listType?: 'text' | 'picture-text' | 'picture';
|
|
68
68
|
|
|
69
69
|
/** Allow the queue to be updated. After you select a file, update the checksum function before the upload file queue, and return false to not update */
|
|
70
|
-
shouldQueueUpdate?: (
|
|
70
|
+
shouldQueueUpdate?: (
|
|
71
|
+
fileList: FileType[],
|
|
72
|
+
newFile: FileType[] | FileType
|
|
73
|
+
) => boolean | Promise<boolean>;
|
|
71
74
|
|
|
72
75
|
/** Allow uploading of files. Check function before file upload, return false without uploading */
|
|
73
|
-
shouldUpload?: (file: FileType) => boolean
|
|
76
|
+
shouldUpload?: (file: FileType) => boolean | Promise<boolean>;
|
|
74
77
|
|
|
75
78
|
/** callback function that the upload queue has changed */
|
|
76
79
|
onChange?: (fileList: FileType[]) => void;
|
package/es/Uploader/Uploader.js
CHANGED
|
@@ -48,14 +48,15 @@ function (_React$Component) {
|
|
|
48
48
|
|
|
49
49
|
(_this$props$onRemove = (_this$props = _this.props).onRemove) === null || _this$props$onRemove === void 0 ? void 0 : _this$props$onRemove.call(_this$props, file);
|
|
50
50
|
(_this$props$onChange = (_this$props2 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, nextFileList);
|
|
51
|
+
|
|
52
|
+
_this.cleanInputValue();
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
_this.handleUploadTriggerChange = function (event) {
|
|
54
|
-
var _this$props$onChange2, _this$props4;
|
|
55
|
-
|
|
56
56
|
var _this$props3 = _this.props,
|
|
57
57
|
autoUpload = _this$props3.autoUpload,
|
|
58
|
-
shouldQueueUpdate = _this$props3.shouldQueueUpdate
|
|
58
|
+
shouldQueueUpdate = _this$props3.shouldQueueUpdate,
|
|
59
|
+
onChange = _this$props3.onChange;
|
|
59
60
|
|
|
60
61
|
var fileList = _this.getFileList();
|
|
61
62
|
|
|
@@ -70,20 +71,32 @@ function (_React$Component) {
|
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
73
|
var nextFileList = [].concat(fileList, newFileList);
|
|
74
|
+
var checkState = shouldQueueUpdate === null || shouldQueueUpdate === void 0 ? void 0 : shouldQueueUpdate(nextFileList, newFileList);
|
|
75
|
+
|
|
76
|
+
var upload = function upload() {
|
|
77
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextFileList);
|
|
78
|
+
|
|
79
|
+
_this.setState({
|
|
80
|
+
fileList: nextFileList
|
|
81
|
+
}, function () {
|
|
82
|
+
autoUpload && _this.handleAjaxUpload();
|
|
83
|
+
});
|
|
84
|
+
};
|
|
73
85
|
|
|
74
|
-
if (
|
|
86
|
+
if (checkState instanceof Promise) {
|
|
87
|
+
checkState.then(function (res) {
|
|
88
|
+
if (res) {
|
|
89
|
+
upload();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
} else if (checkState === false) {
|
|
75
94
|
_this.cleanInputValue();
|
|
76
95
|
|
|
77
96
|
return;
|
|
78
97
|
}
|
|
79
98
|
|
|
80
|
-
(
|
|
81
|
-
|
|
82
|
-
_this.setState({
|
|
83
|
-
fileList: nextFileList
|
|
84
|
-
}, function () {
|
|
85
|
-
autoUpload && _this.handleAjaxUpload();
|
|
86
|
-
});
|
|
99
|
+
upload();
|
|
87
100
|
};
|
|
88
101
|
|
|
89
102
|
_this.handleAjaxUploadSuccess = function (file, response, event, xhr) {
|
|
@@ -93,9 +106,9 @@ function (_React$Component) {
|
|
|
93
106
|
});
|
|
94
107
|
|
|
95
108
|
_this.updateFileList(nextFile, function () {
|
|
96
|
-
var _this$props$onSuccess, _this$
|
|
109
|
+
var _this$props$onSuccess, _this$props4;
|
|
97
110
|
|
|
98
|
-
(_this$props$onSuccess = (_this$
|
|
111
|
+
(_this$props$onSuccess = (_this$props4 = _this.props).onSuccess) === null || _this$props$onSuccess === void 0 ? void 0 : _this$props$onSuccess.call(_this$props4, response, nextFile, event, xhr);
|
|
99
112
|
});
|
|
100
113
|
};
|
|
101
114
|
|
|
@@ -105,9 +118,9 @@ function (_React$Component) {
|
|
|
105
118
|
});
|
|
106
119
|
|
|
107
120
|
_this.updateFileList(nextFile, function () {
|
|
108
|
-
var _this$props$onError, _this$
|
|
121
|
+
var _this$props$onError, _this$props5;
|
|
109
122
|
|
|
110
|
-
(_this$props$onError = (_this$
|
|
123
|
+
(_this$props$onError = (_this$props5 = _this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props5, status, nextFile, event, xhr);
|
|
111
124
|
});
|
|
112
125
|
};
|
|
113
126
|
|
|
@@ -118,21 +131,21 @@ function (_React$Component) {
|
|
|
118
131
|
});
|
|
119
132
|
|
|
120
133
|
_this.updateFileList(nextFile, function () {
|
|
121
|
-
var _this$props$onProgres, _this$
|
|
134
|
+
var _this$props$onProgres, _this$props6;
|
|
122
135
|
|
|
123
|
-
(_this$props$onProgres = (_this$
|
|
136
|
+
(_this$props$onProgres = (_this$props6 = _this.props).onProgress) === null || _this$props$onProgres === void 0 ? void 0 : _this$props$onProgres.call(_this$props6, percent, nextFile, event, xhr);
|
|
124
137
|
});
|
|
125
138
|
};
|
|
126
139
|
|
|
127
140
|
_this.handleUploadFile = function (file) {
|
|
128
|
-
var _this$
|
|
129
|
-
name = _this$
|
|
130
|
-
action = _this$
|
|
131
|
-
headers = _this$
|
|
132
|
-
withCredentials = _this$
|
|
133
|
-
timeout = _this$
|
|
134
|
-
data = _this$
|
|
135
|
-
onUpload = _this$
|
|
141
|
+
var _this$props7 = _this.props,
|
|
142
|
+
name = _this$props7.name,
|
|
143
|
+
action = _this$props7.action,
|
|
144
|
+
headers = _this$props7.headers,
|
|
145
|
+
withCredentials = _this$props7.withCredentials,
|
|
146
|
+
timeout = _this$props7.timeout,
|
|
147
|
+
data = _this$props7.data,
|
|
148
|
+
onUpload = _this$props7.onUpload;
|
|
136
149
|
var xhr = ajaxUpload({
|
|
137
150
|
name: name,
|
|
138
151
|
timeout: timeout,
|
|
@@ -155,9 +168,9 @@ function (_React$Component) {
|
|
|
155
168
|
};
|
|
156
169
|
|
|
157
170
|
_this.handleReupload = function (file) {
|
|
158
|
-
var _this$
|
|
159
|
-
onReupload = _this$
|
|
160
|
-
autoUpload = _this$
|
|
171
|
+
var _this$props8 = _this.props,
|
|
172
|
+
onReupload = _this$props8.onReupload,
|
|
173
|
+
autoUpload = _this$props8.autoUpload;
|
|
161
174
|
autoUpload && _this.handleUploadFile(file);
|
|
162
175
|
onReupload === null || onReupload === void 0 ? void 0 : onReupload(file);
|
|
163
176
|
};
|
|
@@ -227,7 +240,16 @@ function (_React$Component) {
|
|
|
227
240
|
var shouldUpload = this.props.shouldUpload;
|
|
228
241
|
var fileList = this.getFileList();
|
|
229
242
|
fileList.forEach(function (file) {
|
|
230
|
-
|
|
243
|
+
var checkState = shouldUpload === null || shouldUpload === void 0 ? void 0 : shouldUpload(file);
|
|
244
|
+
|
|
245
|
+
if (checkState instanceof Promise) {
|
|
246
|
+
checkState.then(function (res) {
|
|
247
|
+
if (res) {
|
|
248
|
+
_this2.handleUploadFile(file);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
return;
|
|
252
|
+
} else if (checkState === false) {
|
|
231
253
|
return;
|
|
232
254
|
}
|
|
233
255
|
|
|
@@ -262,13 +284,13 @@ function (_React$Component) {
|
|
|
262
284
|
_proto.renderFileItems = function renderFileItems() {
|
|
263
285
|
var _this3 = this;
|
|
264
286
|
|
|
265
|
-
var _this$
|
|
266
|
-
disabledFileItem = _this$
|
|
267
|
-
listType = _this$
|
|
268
|
-
onPreview = _this$
|
|
269
|
-
maxPreviewFileSize = _this$
|
|
270
|
-
renderFileInfo = _this$
|
|
271
|
-
removable = _this$
|
|
287
|
+
var _this$props9 = this.props,
|
|
288
|
+
disabledFileItem = _this$props9.disabledFileItem,
|
|
289
|
+
listType = _this$props9.listType,
|
|
290
|
+
onPreview = _this$props9.onPreview,
|
|
291
|
+
maxPreviewFileSize = _this$props9.maxPreviewFileSize,
|
|
292
|
+
renderFileInfo = _this$props9.renderFileInfo,
|
|
293
|
+
removable = _this$props9.removable;
|
|
272
294
|
var fileList = this.getFileList();
|
|
273
295
|
return React.createElement("div", {
|
|
274
296
|
key: "items",
|
|
@@ -290,15 +312,15 @@ function (_React$Component) {
|
|
|
290
312
|
};
|
|
291
313
|
|
|
292
314
|
_proto.renderUploadTrigger = function renderUploadTrigger() {
|
|
293
|
-
var _this$
|
|
294
|
-
name = _this$
|
|
295
|
-
multiple = _this$
|
|
296
|
-
disabled = _this$
|
|
297
|
-
accept = _this$
|
|
298
|
-
children = _this$
|
|
299
|
-
toggleComponentClass = _this$
|
|
300
|
-
draggable = _this$
|
|
301
|
-
rest = _objectWithoutPropertiesLoose(_this$
|
|
315
|
+
var _this$props10 = this.props,
|
|
316
|
+
name = _this$props10.name,
|
|
317
|
+
multiple = _this$props10.multiple,
|
|
318
|
+
disabled = _this$props10.disabled,
|
|
319
|
+
accept = _this$props10.accept,
|
|
320
|
+
children = _this$props10.children,
|
|
321
|
+
toggleComponentClass = _this$props10.toggleComponentClass,
|
|
322
|
+
draggable = _this$props10.draggable,
|
|
323
|
+
rest = _objectWithoutPropertiesLoose(_this$props10, ["name", "multiple", "disabled", "accept", "children", "toggleComponentClass", "draggable"]);
|
|
302
324
|
|
|
303
325
|
var unhandled = getUnhandledProps(Uploader, rest);
|
|
304
326
|
return React.createElement(UploadTrigger, _extends({}, unhandled, {
|
|
@@ -317,14 +339,14 @@ function (_React$Component) {
|
|
|
317
339
|
_proto.render = function render() {
|
|
318
340
|
var _classNames;
|
|
319
341
|
|
|
320
|
-
var _this$
|
|
321
|
-
classPrefix = _this$
|
|
322
|
-
className = _this$
|
|
323
|
-
listType = _this$
|
|
324
|
-
fileListVisible = _this$
|
|
325
|
-
locale = _this$
|
|
326
|
-
style = _this$
|
|
327
|
-
draggable = _this$
|
|
342
|
+
var _this$props11 = this.props,
|
|
343
|
+
classPrefix = _this$props11.classPrefix,
|
|
344
|
+
className = _this$props11.className,
|
|
345
|
+
listType = _this$props11.listType,
|
|
346
|
+
fileListVisible = _this$props11.fileListVisible,
|
|
347
|
+
locale = _this$props11.locale,
|
|
348
|
+
style = _this$props11.style,
|
|
349
|
+
draggable = _this$props11.draggable;
|
|
328
350
|
var classes = classNames(className, classPrefix, this.addPrefix(listType), (_classNames = {}, _classNames[this.addPrefix('draggable')] = draggable, _classNames));
|
|
329
351
|
var renderList = [this.renderUploadTrigger()];
|
|
330
352
|
|
package/es/styles/utilities.less
CHANGED
package/lib/Footer/Footer.js
CHANGED
|
@@ -38,7 +38,7 @@ function (_React$Component) {
|
|
|
38
38
|
classPrefix = _this$props.classPrefix,
|
|
39
39
|
props = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["className", "classPrefix"]);
|
|
40
40
|
var classes = (0, _classnames.default)(classPrefix, className);
|
|
41
|
-
return React.createElement("
|
|
41
|
+
return React.createElement("footer", (0, _extends2.default)({}, props, {
|
|
42
42
|
className: classes
|
|
43
43
|
}));
|
|
44
44
|
};
|
|
@@ -152,7 +152,8 @@ function (_React$Component) {
|
|
|
152
152
|
className = _this$props3.className,
|
|
153
153
|
placeholder = _this$props3.placeholder,
|
|
154
154
|
inputClassName = _this$props3.inputClassName,
|
|
155
|
-
inputStyle = _this$props3.inputStyle
|
|
155
|
+
inputStyle = _this$props3.inputStyle,
|
|
156
|
+
tabIndex = _this$props3.tabIndex;
|
|
156
157
|
var inputId = this.getInputId();
|
|
157
158
|
var sizerValue = [defaultValue, value, ''].reduce(function (previousValue, currentValue) {
|
|
158
159
|
if (previousValue !== null && previousValue !== undefined) {
|
|
@@ -178,6 +179,7 @@ function (_React$Component) {
|
|
|
178
179
|
htmlInputProps.className = inputClassName;
|
|
179
180
|
htmlInputProps.id = inputId || inputId;
|
|
180
181
|
htmlInputProps.style = nextInputStyle;
|
|
182
|
+
htmlInputProps.tabIndex = tabIndex;
|
|
181
183
|
return React.createElement("div", {
|
|
182
184
|
className: className,
|
|
183
185
|
style: wrapperStyle
|
|
@@ -386,21 +386,12 @@ function (_React$Component) {
|
|
|
386
386
|
|
|
387
387
|
var value = _this.getValue();
|
|
388
388
|
|
|
389
|
-
var nextState = {
|
|
390
|
-
focusItemValue: multi ? (0, _get2.default)(value, 0) : value
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
if (multi) {
|
|
394
|
-
/**
|
|
395
|
-
在多选的情况下, 当 searchKeyword 过长,在 focus 的时候会导致内容换行。
|
|
396
|
-
把 searchKeyword 清空是为了,Menu 在展开时候位置正确。
|
|
397
|
-
*/
|
|
398
|
-
nextState.searchKeyword = '';
|
|
399
|
-
}
|
|
400
|
-
|
|
401
389
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
402
390
|
|
|
403
|
-
_this.setState(
|
|
391
|
+
_this.setState({
|
|
392
|
+
focusItemValue: multi ? (0, _get2.default)(value, 0) : value,
|
|
393
|
+
searchKeyword: ''
|
|
394
|
+
});
|
|
404
395
|
};
|
|
405
396
|
|
|
406
397
|
_this.handleEnter = function () {
|
|
@@ -435,6 +426,16 @@ function (_React$Component) {
|
|
|
435
426
|
_this.handleChange(value, event);
|
|
436
427
|
};
|
|
437
428
|
|
|
429
|
+
_this.handleInputFocus = function () {
|
|
430
|
+
var _this$triggerRef$curr5;
|
|
431
|
+
|
|
432
|
+
_this.setState({
|
|
433
|
+
open: true
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
(_this$triggerRef$curr5 = _this.triggerRef.current) === null || _this$triggerRef$curr5 === void 0 ? void 0 : _this$triggerRef$curr5.show();
|
|
437
|
+
};
|
|
438
|
+
|
|
438
439
|
_this.removeLastItem = function (event) {
|
|
439
440
|
var tagName = (0, _get2.default)(event, 'target.tagName');
|
|
440
441
|
|
|
@@ -795,10 +796,9 @@ function (_React$Component) {
|
|
|
795
796
|
var _this$props17 = this.props,
|
|
796
797
|
multi = _this$props17.multi,
|
|
797
798
|
onBlur = _this$props17.onBlur,
|
|
798
|
-
onFocus = _this$props17.onFocus
|
|
799
|
+
onFocus = _this$props17.onFocus,
|
|
800
|
+
tabIndex = _this$props17.tabIndex;
|
|
799
801
|
var props = {
|
|
800
|
-
onBlur: onBlur,
|
|
801
|
-
onFocus: onFocus,
|
|
802
802
|
componentClass: 'input',
|
|
803
803
|
inputRef: this.inputRef
|
|
804
804
|
};
|
|
@@ -812,8 +812,11 @@ function (_React$Component) {
|
|
|
812
812
|
}
|
|
813
813
|
|
|
814
814
|
return React.createElement(_InputSearch.default, (0, _extends2.default)({}, props, {
|
|
815
|
+
tabIndex: tabIndex,
|
|
815
816
|
onChange: this.handleSearch,
|
|
816
|
-
value: this.state.open ? this.state.searchKeyword : ''
|
|
817
|
+
value: this.state.open ? this.state.searchKeyword : '',
|
|
818
|
+
onBlur: onBlur,
|
|
819
|
+
onFocus: (0, _utils.createChainedFunction)(this.handleInputFocus, onFocus)
|
|
817
820
|
}));
|
|
818
821
|
};
|
|
819
822
|
|
package/lib/Nav/Nav.js
CHANGED
|
@@ -76,19 +76,20 @@ function (_React$Component) {
|
|
|
76
76
|
var _item$props = item.props,
|
|
77
77
|
eventKey = _item$props.eventKey,
|
|
78
78
|
active = _item$props.active,
|
|
79
|
-
|
|
79
|
+
onSelectItem = _item$props.onSelect,
|
|
80
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(_item$props, ["eventKey", "active", "onSelect"]);
|
|
80
81
|
var displayName = item === null || item === void 0 ? void 0 : (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.displayName;
|
|
81
82
|
var hasTooltip = sidenav && !expanded;
|
|
82
83
|
|
|
83
84
|
if (~(displayName === null || displayName === void 0 ? void 0 : displayName.indexOf('(NavItem)'))) {
|
|
84
85
|
return (0, _extends2.default)({}, rest, {
|
|
85
|
-
onSelect: onSelect,
|
|
86
|
+
onSelect: (0, _utils.createChainedFunction)(onSelect, onSelectItem),
|
|
86
87
|
hasTooltip: hasTooltip,
|
|
87
88
|
active: typeof activeKey === 'undefined' ? active : (0, _shallowEqual.default)(activeKey, eventKey)
|
|
88
89
|
});
|
|
89
90
|
} else if (~(displayName === null || displayName === void 0 ? void 0 : displayName.indexOf('(Dropdown)'))) {
|
|
90
91
|
return (0, _extends2.default)({}, rest, {
|
|
91
|
-
onSelect: onSelect,
|
|
92
|
+
onSelect: (0, _utils.createChainedFunction)(onSelect, onSelectItem),
|
|
92
93
|
activeKey: activeKey,
|
|
93
94
|
showHeader: hasTooltip,
|
|
94
95
|
componentClass: 'li'
|
|
@@ -221,6 +221,8 @@ function (_React$Component) {
|
|
|
221
221
|
};
|
|
222
222
|
|
|
223
223
|
_proto.renderOverlay = function renderOverlay() {
|
|
224
|
+
var _this2 = this;
|
|
225
|
+
|
|
224
226
|
var _this$props4 = this.props,
|
|
225
227
|
open = _this$props4.open,
|
|
226
228
|
speaker = _this$props4.speaker,
|
|
@@ -248,7 +250,11 @@ function (_React$Component) {
|
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
if (typeof speaker === 'function') {
|
|
251
|
-
return React.createElement(_Overlay.default, overlayProps,
|
|
253
|
+
return React.createElement(_Overlay.default, overlayProps, function (props, ref) {
|
|
254
|
+
return speaker((0, _extends2.default)({}, props, {
|
|
255
|
+
onClose: _this2.hide
|
|
256
|
+
}), ref);
|
|
257
|
+
});
|
|
252
258
|
}
|
|
253
259
|
|
|
254
260
|
return React.createElement(_Overlay.default, overlayProps, React.cloneElement(speaker, speakerProps));
|
|
@@ -67,10 +67,13 @@ export interface UploaderProps extends StandardProps {
|
|
|
67
67
|
listType?: 'text' | 'picture-text' | 'picture';
|
|
68
68
|
|
|
69
69
|
/** Allow the queue to be updated. After you select a file, update the checksum function before the upload file queue, and return false to not update */
|
|
70
|
-
shouldQueueUpdate?: (
|
|
70
|
+
shouldQueueUpdate?: (
|
|
71
|
+
fileList: FileType[],
|
|
72
|
+
newFile: FileType[] | FileType
|
|
73
|
+
) => boolean | Promise<boolean>;
|
|
71
74
|
|
|
72
75
|
/** Allow uploading of files. Check function before file upload, return false without uploading */
|
|
73
|
-
shouldUpload?: (file: FileType) => boolean
|
|
76
|
+
shouldUpload?: (file: FileType) => boolean | Promise<boolean>;
|
|
74
77
|
|
|
75
78
|
/** callback function that the upload queue has changed */
|
|
76
79
|
onChange?: (fileList: FileType[]) => void;
|