@nutui/nutui-react 1.3.3-beta.2 → 1.3.4-beta.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/CHANGELOG.md +21 -0
- package/README.md +3 -2
- package/dist/esm/Address.js +7 -5
- package/dist/esm/Audio.js +7 -5
- package/dist/esm/Avatar.js +5 -3
- package/dist/esm/BackTop.js +5 -3
- package/dist/esm/Badge.js +5 -3
- package/dist/esm/Barrage.js +1 -1
- package/dist/esm/Button.js +7 -5
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/Cell.js +7 -5
- package/dist/esm/Checkbox.js +2 -2
- package/dist/esm/Collapse.js +2 -1
- package/dist/esm/CollapseItem.js +13 -9
- package/dist/esm/FixedNav.js +5 -3
- package/dist/esm/GridItem.js +5 -3
- package/dist/esm/Infiniteloading.js +13 -11
- package/dist/esm/Input.js +9 -7
- package/dist/esm/InputNumber.js +7 -5
- package/dist/esm/Menu.js +5 -3
- package/dist/esm/MenuItem.js +5 -5
- package/dist/esm/NavBar.js +7 -5
- package/dist/esm/NoticeBar.js +9 -7
- package/dist/esm/Notify.js +1 -1
- package/dist/esm/Popover.js +5 -3
- package/dist/esm/Popup.js +5 -3
- package/dist/esm/Progress.js +5 -3
- package/dist/esm/PullToRefresh.js +1 -30
- package/dist/esm/Radio.js +5 -3
- package/dist/esm/Rate.js +10 -8
- package/dist/esm/SearchBar.js +5 -3
- package/dist/esm/ShortPassword.js +5 -3
- package/dist/esm/Step.js +5 -3
- package/dist/esm/Sticky/style/index.js +2 -0
- package/dist/esm/Sticky.js +209 -0
- package/dist/esm/TabbarItem.js +5 -3
- package/dist/esm/Table.js +5 -3
- package/dist/esm/Tabs.js +2 -2
- package/dist/esm/Tag.js +5 -3
- package/dist/esm/Toast.js +1 -1
- package/dist/esm/Uploader.js +121 -44
- package/dist/esm/get-scroll-parent-3dcd3f53.js +32 -0
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/esm/render-18227751.js +43 -0
- package/dist/esm/{tabs-41234c2c.js → tabs-0896a61b.js} +5 -3
- package/dist/esm/types/src/packages/button/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/collapseitem/collapseitem.d.ts +1 -0
- package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
- package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/esm/types/src/packages/griditem/griditem.d.ts +1 -1
- package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +3 -3
- package/dist/esm/types/src/packages/input/input.d.ts +1 -1
- package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -1
- package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
- package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
- package/dist/esm/types/src/packages/popover/popover.d.ts +1 -1
- package/dist/esm/types/src/packages/progress/progress.d.ts +1 -1
- package/dist/esm/types/src/packages/radio/radio.d.ts +1 -1
- package/dist/esm/types/src/packages/sticky/__test__/sticky.spec.d.ts +1 -0
- package/dist/esm/types/src/packages/sticky/demo.d.ts +3 -0
- package/dist/esm/types/src/packages/sticky/index.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/index.taro.d.ts +2 -0
- package/dist/esm/types/src/packages/sticky/sticky.d.ts +13 -0
- package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -1
- package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
- package/dist/esm/types/src/packages/uploader/demo.d.ts +1 -0
- package/dist/esm/types/src/packages/uploader/upload.d.ts +4 -0
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +16 -12
- package/dist/esm/types/src/utils/date.d.ts +1 -1
- package/dist/esm/types/src/utils/useWatch.d.ts +6 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +1002 -616
- package/dist/nutui.react.umd.js +1002 -615
- package/dist/packages/barrage/barrage.scss +7 -2
- package/dist/packages/circleprogress/circleprogress.scss +3 -0
- package/dist/packages/sticky/sticky.scss +0 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/types/index.d.ts +37 -24
- package/dist/types/nutui.react.build.ts +3 -1
- package/package.json +10 -5
- package/dist/esm/render-4a3856cb.js +0 -32
package/dist/esm/Table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["children", "className", "style", "columns", "data", "bordered", "summary", "striped", "noData", "onSorter"];
|
|
4
|
+
var _excluded = ["children", "className", "style", "columns", "data", "bordered", "summary", "striped", "noData", "onSorter", "iconClassPrefix", "iconFontClassName"];
|
|
5
5
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
|
|
@@ -42,6 +42,8 @@ var Table = function Table(props) {
|
|
|
42
42
|
striped = _defaultProps$props.striped,
|
|
43
43
|
noData = _defaultProps$props.noData,
|
|
44
44
|
onSorter = _defaultProps$props.onSorter,
|
|
45
|
+
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
46
|
+
iconFontClassName = _defaultProps$props.iconFontClassName,
|
|
45
47
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
46
48
|
|
|
47
49
|
var _useState = useState(data),
|
|
@@ -91,8 +93,8 @@ var Table = function Table(props) {
|
|
|
91
93
|
return handleSorterClick(item);
|
|
92
94
|
}
|
|
93
95
|
}, item.title, item.sorter && React__default.createElement(Icon, {
|
|
94
|
-
classPrefix:
|
|
95
|
-
fontClassName:
|
|
96
|
+
classPrefix: iconClassPrefix,
|
|
97
|
+
fontClassName: iconFontClassName,
|
|
96
98
|
name: "down-arrow",
|
|
97
99
|
size: "12px"
|
|
98
100
|
}));
|
package/dist/esm/Tabs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Tabs } from './tabs-
|
|
2
|
-
export { T as default } from './tabs-
|
|
1
|
+
import { T as Tabs } from './tabs-0896a61b.js';
|
|
2
|
+
export { T as default } from './tabs-0896a61b.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import './bem-893ad28d.js';
|
package/dist/esm/Tag.js
CHANGED
|
@@ -34,7 +34,9 @@ var Tag = function Tag(props) {
|
|
|
34
34
|
closeable = _defaultProps$props.closeable,
|
|
35
35
|
textColor = _defaultProps$props.textColor,
|
|
36
36
|
onClick = _defaultProps$props.onClick,
|
|
37
|
-
onClose = _defaultProps$props.onClose
|
|
37
|
+
onClose = _defaultProps$props.onClose,
|
|
38
|
+
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
39
|
+
iconFontClassName = _defaultProps$props.iconFontClassName;
|
|
38
40
|
|
|
39
41
|
var _useState = useState(''),
|
|
40
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -89,8 +91,8 @@ var Tag = function Tag(props) {
|
|
|
89
91
|
}, children && React__default.createElement("span", {
|
|
90
92
|
className: "text"
|
|
91
93
|
}, children), React__default.createElement(Icon, {
|
|
92
|
-
classPrefix:
|
|
93
|
-
fontClassName:
|
|
94
|
+
classPrefix: iconClassPrefix,
|
|
95
|
+
fontClassName: iconFontClassName,
|
|
94
96
|
className: "_icon",
|
|
95
97
|
name: "close",
|
|
96
98
|
size: "12",
|
package/dist/esm/Toast.js
CHANGED
|
@@ -19,7 +19,7 @@ import * as ReactDOM from 'react-dom';
|
|
|
19
19
|
import classNames from 'classnames';
|
|
20
20
|
import { c as cn } from './bem-893ad28d.js';
|
|
21
21
|
import Icon from './Icon.js';
|
|
22
|
-
import { r as render } from './render-
|
|
22
|
+
import { r as render } from './render-18227751.js';
|
|
23
23
|
import '@bem-react/classname';
|
|
24
24
|
|
|
25
25
|
var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
package/dist/esm/Uploader.js
CHANGED
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
5
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
var _excluded = ["children", "uploadIcon", "uploadIconSize", "name", "accept", "defaultFileList", "listType", "disabled", "multiple", "url", "defaultImg", "headers", "timeout", "method", "xhrState", "withCredentials", "data", "isPreview", "isDeletable", "maximum", "capture", "maximize", "className", "autoUpload", "clearInput", "
|
|
7
|
+
var _excluded = ["children", "uploadIcon", "uploadIconSize", "name", "accept", "defaultFileList", "listType", "disabled", "multiple", "url", "defaultImg", "headers", "timeout", "method", "xhrState", "withCredentials", "data", "isPreview", "isDeletable", "maximum", "capture", "maximize", "className", "autoUpload", "clearInput", "iconClassPrefix", "iconFontClassName", "onStart", "onRemove", "onChange", "onFileItemClick", "onProgress", "onSuccess", "onUpdate", "onFailure", "onOversize", "onBeforeUpload", "onBeforeXhrUpload", "onBeforeDelete"];
|
|
8
8
|
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
|
|
@@ -13,6 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
13
13
|
import React__default, { useState, useEffect, useImperativeHandle } from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import Icon from './Icon.js';
|
|
16
|
+
import Progress from './Progress.js';
|
|
16
17
|
import { c as cn } from './bem-893ad28d.js';
|
|
17
18
|
import { useConfig } from './ConfigProvider.js';
|
|
18
19
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
@@ -25,8 +26,12 @@ var UploadOptions = /*#__PURE__*/_createClass(function UploadOptions() {
|
|
|
25
26
|
|
|
26
27
|
_defineProperty(this, "name", 'file');
|
|
27
28
|
|
|
29
|
+
_defineProperty(this, "fileType", 'image');
|
|
30
|
+
|
|
28
31
|
_defineProperty(this, "formData", void 0);
|
|
29
32
|
|
|
33
|
+
_defineProperty(this, "sourceFile", void 0);
|
|
34
|
+
|
|
30
35
|
_defineProperty(this, "method", 'post');
|
|
31
36
|
|
|
32
37
|
_defineProperty(this, "xhrState", 200);
|
|
@@ -46,6 +51,8 @@ var UploadOptions = /*#__PURE__*/_createClass(function UploadOptions() {
|
|
|
46
51
|
_defineProperty(this, "onSuccess", void 0);
|
|
47
52
|
|
|
48
53
|
_defineProperty(this, "onFailure", void 0);
|
|
54
|
+
|
|
55
|
+
_defineProperty(this, "beforeXhrUpload", void 0);
|
|
49
56
|
});
|
|
50
57
|
|
|
51
58
|
var Upload = /*#__PURE__*/function () {
|
|
@@ -99,11 +106,64 @@ var Upload = /*#__PURE__*/function () {
|
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
(_options$onStart = options.onStart) === null || _options$onStart === void 0 ? void 0 : _options$onStart.call(options, options);
|
|
102
|
-
|
|
109
|
+
|
|
110
|
+
if (options.beforeXhrUpload) {
|
|
111
|
+
options.beforeXhrUpload(xhr, options);
|
|
112
|
+
} else {
|
|
113
|
+
xhr.send(options.formData);
|
|
114
|
+
}
|
|
103
115
|
} else {
|
|
104
116
|
console.warn('浏览器不支持 XMLHttpRequest');
|
|
105
117
|
}
|
|
106
118
|
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "uploadTaro",
|
|
121
|
+
value: function uploadTaro(uploadFile, env) {
|
|
122
|
+
var options = this.options;
|
|
123
|
+
|
|
124
|
+
if (env === 'WEB') {
|
|
125
|
+
this.upload();
|
|
126
|
+
} else if (options.beforeXhrUpload) {
|
|
127
|
+
options.beforeXhrUpload(uploadFile, options);
|
|
128
|
+
} else {
|
|
129
|
+
var _options$onStart2;
|
|
130
|
+
|
|
131
|
+
var uploadTask = uploadFile({
|
|
132
|
+
url: options.url,
|
|
133
|
+
filePath: options.taroFilePath,
|
|
134
|
+
fileType: options.fileType,
|
|
135
|
+
header: _objectSpread({
|
|
136
|
+
'Content-Type': 'multipart/form-data'
|
|
137
|
+
}, options.headers),
|
|
138
|
+
formData: options.formData,
|
|
139
|
+
name: options.name,
|
|
140
|
+
success: function success(response) {
|
|
141
|
+
if (options.xhrState == response.statusCode) {
|
|
142
|
+
var _options$onSuccess2;
|
|
143
|
+
|
|
144
|
+
(_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 ? void 0 : _options$onSuccess2.call(options, response, options);
|
|
145
|
+
} else {
|
|
146
|
+
var _options$onFailure2;
|
|
147
|
+
|
|
148
|
+
(_options$onFailure2 = options.onFailure) === null || _options$onFailure2 === void 0 ? void 0 : _options$onFailure2.call(options, response, options);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
fail: function fail(e) {
|
|
152
|
+
var _options$onFailure3;
|
|
153
|
+
|
|
154
|
+
(_options$onFailure3 = options.onFailure) === null || _options$onFailure3 === void 0 ? void 0 : _options$onFailure3.call(options, e, options);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
(_options$onStart2 = options.onStart) === null || _options$onStart2 === void 0 ? void 0 : _options$onStart2.call(options, options);
|
|
158
|
+
uploadTask.progress(function (res) {
|
|
159
|
+
var _options$onProgress2;
|
|
160
|
+
|
|
161
|
+
(_options$onProgress2 = options.onProgress) === null || _options$onProgress2 === void 0 ? void 0 : _options$onProgress2.call(options, res, options); // console.log('上传进度', res.progress);
|
|
162
|
+
// console.log('已经上传的数据长度', res.totalBytesSent);
|
|
163
|
+
// console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend);
|
|
164
|
+
}); // uploadTask.abort(); // 取消上传任务
|
|
165
|
+
}
|
|
166
|
+
}
|
|
107
167
|
}]);
|
|
108
168
|
|
|
109
169
|
return Upload;
|
|
@@ -128,11 +188,11 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
128
188
|
xhrState: 200,
|
|
129
189
|
timeout: 1000 * 30,
|
|
130
190
|
withCredentials: false,
|
|
131
|
-
clearInput:
|
|
191
|
+
clearInput: true,
|
|
132
192
|
isPreview: true,
|
|
133
193
|
isDeletable: true,
|
|
134
194
|
capture: false,
|
|
135
|
-
|
|
195
|
+
onBeforeDelete: function onBeforeDelete(file, files) {
|
|
136
196
|
return true;
|
|
137
197
|
}
|
|
138
198
|
});
|
|
@@ -152,6 +212,10 @@ var FileItem = /*#__PURE__*/_createClass(function FileItem() {
|
|
|
152
212
|
|
|
153
213
|
_defineProperty(this, "type", void 0);
|
|
154
214
|
|
|
215
|
+
_defineProperty(this, "path", void 0);
|
|
216
|
+
|
|
217
|
+
_defineProperty(this, "percentage", 0);
|
|
218
|
+
|
|
155
219
|
_defineProperty(this, "formData", new FormData());
|
|
156
220
|
});
|
|
157
221
|
|
|
@@ -185,17 +249,20 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
185
249
|
className = _defaultProps$props.className,
|
|
186
250
|
autoUpload = _defaultProps$props.autoUpload,
|
|
187
251
|
clearInput = _defaultProps$props.clearInput,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
252
|
+
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
253
|
+
iconFontClassName = _defaultProps$props.iconFontClassName,
|
|
254
|
+
onStart = _defaultProps$props.onStart,
|
|
255
|
+
onRemove = _defaultProps$props.onRemove,
|
|
256
|
+
onChange = _defaultProps$props.onChange,
|
|
257
|
+
onFileItemClick = _defaultProps$props.onFileItemClick,
|
|
258
|
+
onProgress = _defaultProps$props.onProgress,
|
|
259
|
+
onSuccess = _defaultProps$props.onSuccess,
|
|
260
|
+
onUpdate = _defaultProps$props.onUpdate,
|
|
261
|
+
onFailure = _defaultProps$props.onFailure,
|
|
262
|
+
onOversize = _defaultProps$props.onOversize,
|
|
263
|
+
onBeforeUpload = _defaultProps$props.onBeforeUpload,
|
|
264
|
+
onBeforeXhrUpload = _defaultProps$props.onBeforeXhrUpload,
|
|
265
|
+
onBeforeDelete = _defaultProps$props.onBeforeDelete,
|
|
199
266
|
restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
200
267
|
|
|
201
268
|
var _useState = useState([]),
|
|
@@ -209,8 +276,6 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
209
276
|
setUploadQueue = _useState4[1];
|
|
210
277
|
|
|
211
278
|
useEffect(function () {
|
|
212
|
-
console.log('defaultFileList', defaultFileList);
|
|
213
|
-
|
|
214
279
|
if (defaultFileList) {
|
|
215
280
|
setFileList(defaultFileList);
|
|
216
281
|
}
|
|
@@ -262,6 +327,11 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
262
327
|
uploadOption.xhrState = xhrState;
|
|
263
328
|
uploadOption.headers = headers;
|
|
264
329
|
uploadOption.withCredentials = withCredentials;
|
|
330
|
+
uploadOption.beforeXhrUpload = onBeforeXhrUpload;
|
|
331
|
+
|
|
332
|
+
try {
|
|
333
|
+
uploadOption.sourceFile = fileItem.formData.get(name);
|
|
334
|
+
} catch (error) {}
|
|
265
335
|
|
|
266
336
|
uploadOption.onStart = function (option) {
|
|
267
337
|
clearUploadQueue(index);
|
|
@@ -276,7 +346,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
276
346
|
});
|
|
277
347
|
return _toConsumableArray(fileList);
|
|
278
348
|
});
|
|
279
|
-
|
|
349
|
+
onStart && onStart(option);
|
|
280
350
|
};
|
|
281
351
|
|
|
282
352
|
uploadOption.onProgress = function (e, option) {
|
|
@@ -285,21 +355,23 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
285
355
|
if (item.uid === fileItem.uid) {
|
|
286
356
|
item.status = 'uploading';
|
|
287
357
|
item.message = locale.uploader.uploading;
|
|
358
|
+
item.percentage = (e.loaded / e.total * 100).toFixed(0);
|
|
359
|
+
onProgress && onProgress({
|
|
360
|
+
e: e,
|
|
361
|
+
option: option,
|
|
362
|
+
percentage: item.percentage
|
|
363
|
+
});
|
|
288
364
|
}
|
|
289
365
|
|
|
290
366
|
return item;
|
|
291
367
|
});
|
|
292
368
|
return _toConsumableArray(fileList);
|
|
293
369
|
});
|
|
294
|
-
progress && progress({
|
|
295
|
-
e: e,
|
|
296
|
-
option: option
|
|
297
|
-
});
|
|
298
370
|
};
|
|
299
371
|
|
|
300
372
|
uploadOption.onSuccess = function (responseText, option) {
|
|
301
373
|
setFileList(function (fileList) {
|
|
302
|
-
|
|
374
|
+
onUpdate && onUpdate(fileList);
|
|
303
375
|
fileList.map(function (item) {
|
|
304
376
|
if (item.uid === fileItem.uid) {
|
|
305
377
|
item.status = 'success';
|
|
@@ -310,7 +382,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
310
382
|
});
|
|
311
383
|
return _toConsumableArray(fileList);
|
|
312
384
|
});
|
|
313
|
-
|
|
385
|
+
onSuccess && onSuccess({
|
|
314
386
|
responseText: responseText,
|
|
315
387
|
option: option
|
|
316
388
|
});
|
|
@@ -328,7 +400,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
328
400
|
});
|
|
329
401
|
return _toConsumableArray(fileList);
|
|
330
402
|
});
|
|
331
|
-
|
|
403
|
+
onFailure && onFailure({
|
|
332
404
|
responseText: responseText,
|
|
333
405
|
option: option
|
|
334
406
|
});
|
|
@@ -389,7 +461,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
389
461
|
});
|
|
390
462
|
|
|
391
463
|
if (oversizes.length) {
|
|
392
|
-
|
|
464
|
+
onOversize && onOversize(files);
|
|
393
465
|
}
|
|
394
466
|
|
|
395
467
|
if (filterFile.length > maximum) {
|
|
@@ -407,9 +479,9 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
407
479
|
var onDelete = function onDelete(file, index) {
|
|
408
480
|
clearUploadQueue(index);
|
|
409
481
|
|
|
410
|
-
if (
|
|
482
|
+
if (onBeforeDelete && onBeforeDelete(file, fileList)) {
|
|
411
483
|
fileList.splice(index, 1);
|
|
412
|
-
|
|
484
|
+
onRemove && onRemove(file, fileList);
|
|
413
485
|
setFileList(_toConsumableArray(fileList));
|
|
414
486
|
} else {
|
|
415
487
|
console.log(locale.uploader.deleteWord);
|
|
@@ -424,8 +496,8 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
424
496
|
var $el = event.target;
|
|
425
497
|
var files = $el.files;
|
|
426
498
|
|
|
427
|
-
if (
|
|
428
|
-
|
|
499
|
+
if (onBeforeUpload) {
|
|
500
|
+
onBeforeUpload(new Array().slice.call(files)).then(function (f) {
|
|
429
501
|
var _files = filterFiles(new Array().slice.call(f));
|
|
430
502
|
|
|
431
503
|
readFile(_files);
|
|
@@ -436,7 +508,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
436
508
|
readFile(_files);
|
|
437
509
|
}
|
|
438
510
|
|
|
439
|
-
|
|
511
|
+
onChange && onChange({
|
|
440
512
|
fileList: fileList,
|
|
441
513
|
event: event
|
|
442
514
|
});
|
|
@@ -447,7 +519,7 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
447
519
|
};
|
|
448
520
|
|
|
449
521
|
var handleItemClick = function handleItemClick(file) {
|
|
450
|
-
|
|
522
|
+
onFileItemClick && onFileItemClick(file);
|
|
451
523
|
};
|
|
452
524
|
|
|
453
525
|
return React__default.createElement("div", _objectSpread({
|
|
@@ -484,15 +556,15 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
484
556
|
}, item.message)) : item.status !== 'success' && React__default.createElement("div", {
|
|
485
557
|
className: "nut-uploader__preview__progress"
|
|
486
558
|
}, React__default.createElement(Icon, {
|
|
487
|
-
classPrefix:
|
|
488
|
-
fontClassName:
|
|
559
|
+
classPrefix: iconClassPrefix,
|
|
560
|
+
fontClassName: iconFontClassName,
|
|
489
561
|
color: "#fff",
|
|
490
562
|
name: "".concat(item.status === 'error' ? 'failure' : 'loading')
|
|
491
563
|
}), React__default.createElement("div", {
|
|
492
564
|
className: "nut-uploader__preview__progress__msg"
|
|
493
565
|
}, item.message)), isDeletable && React__default.createElement(Icon, {
|
|
494
|
-
classPrefix:
|
|
495
|
-
fontClassName:
|
|
566
|
+
classPrefix: iconClassPrefix,
|
|
567
|
+
fontClassName: iconFontClassName,
|
|
496
568
|
color: "rgba(0,0,0,0.6)",
|
|
497
569
|
className: "close",
|
|
498
570
|
name: "failure",
|
|
@@ -521,8 +593,8 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
521
593
|
},
|
|
522
594
|
className: "nut-uploader__preview-img__file__name"
|
|
523
595
|
}, React__default.createElement(Icon, {
|
|
524
|
-
classPrefix:
|
|
525
|
-
fontClassName:
|
|
596
|
+
classPrefix: iconClassPrefix,
|
|
597
|
+
fontClassName: iconFontClassName,
|
|
526
598
|
color: "#808080",
|
|
527
599
|
name: "link"
|
|
528
600
|
}), "\xA0", item.name))), React__default.createElement("div", {
|
|
@@ -535,24 +607,29 @@ var InternalUploader = function InternalUploader(props, ref) {
|
|
|
535
607
|
return handleItemClick(item);
|
|
536
608
|
}
|
|
537
609
|
}, React__default.createElement(Icon, {
|
|
538
|
-
classPrefix:
|
|
539
|
-
fontClassName:
|
|
610
|
+
classPrefix: iconClassPrefix,
|
|
611
|
+
fontClassName: iconFontClassName,
|
|
540
612
|
name: "link"
|
|
541
613
|
}), "\xA0", item.name), React__default.createElement(Icon, {
|
|
542
|
-
classPrefix:
|
|
543
|
-
fontClassName:
|
|
614
|
+
classPrefix: iconClassPrefix,
|
|
615
|
+
fontClassName: iconFontClassName,
|
|
544
616
|
color: "#808080",
|
|
545
617
|
className: "nut-uploader__preview-img__file__del",
|
|
546
618
|
name: "del",
|
|
547
619
|
onClick: function onClick() {
|
|
548
620
|
return onDelete(item, index);
|
|
549
621
|
}
|
|
622
|
+
}), item.status === 'uploading' && React__default.createElement(Progress, {
|
|
623
|
+
size: "small",
|
|
624
|
+
percentage: item.percentage,
|
|
625
|
+
strokeColor: "linear-gradient(270deg, rgba(18,126,255,1) 0%,rgba(32,147,255,1) 32.815625%,rgba(13,242,204,1) 100%)",
|
|
626
|
+
showText: false
|
|
550
627
|
})));
|
|
551
628
|
}), maximum > fileList.length && listType === 'picture' && !children && React__default.createElement("div", {
|
|
552
629
|
className: "nut-uploader__upload ".concat(listType)
|
|
553
630
|
}, React__default.createElement(Icon, {
|
|
554
|
-
classPrefix:
|
|
555
|
-
fontClassName:
|
|
631
|
+
classPrefix: iconClassPrefix,
|
|
632
|
+
fontClassName: iconFontClassName,
|
|
556
633
|
size: uploadIconSize,
|
|
557
634
|
color: "#808080",
|
|
558
635
|
name: uploadIcon
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var canUseDom = !!(typeof window !== 'undefined' && typeof document !== 'undefined' && window.document && window.document.createElement);
|
|
2
|
+
var defaultRoot = canUseDom ? window : undefined;
|
|
3
|
+
var overflowStylePatterns = ['scroll', 'auto', 'overlay'];
|
|
4
|
+
|
|
5
|
+
function isElement(node) {
|
|
6
|
+
var ELEMENT_NODE_TYPE = 1;
|
|
7
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function getScrollParent(el) {
|
|
11
|
+
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
|
|
12
|
+
var node = el;
|
|
13
|
+
|
|
14
|
+
while (node && node !== root && isElement(node)) {
|
|
15
|
+
if (node === document.body) {
|
|
16
|
+
return root;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var _window$getComputedSt = window.getComputedStyle(node),
|
|
20
|
+
overflowY = _window$getComputedSt.overflowY;
|
|
21
|
+
|
|
22
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
23
|
+
return node;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
node = node.parentNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return root;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { canUseDom as c, getScrollParent as g };
|
|
@@ -11,6 +11,7 @@ export { default as Row } from './Row.js';
|
|
|
11
11
|
export { default as Divider } from './Divider.js';
|
|
12
12
|
export { default as Grid } from './Grid.js';
|
|
13
13
|
export { default as GridItem } from './GridItem.js';
|
|
14
|
+
export { default as Sticky } from './Sticky.js';
|
|
14
15
|
export { default as NavBar } from './NavBar.js';
|
|
15
16
|
export { default as FixedNav } from './FixedNav.js';
|
|
16
17
|
export { default as Tabbar } from './Tabbar.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
|
|
7
|
+
import * as ReactDOM from 'react-dom';
|
|
8
|
+
var createRoot;
|
|
9
|
+
var version = ReactDOM.version;
|
|
10
|
+
|
|
11
|
+
var reactDOMClone = _objectSpread({}, ReactDOM);
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
var mainVersion = Number((version || '').split('.')[0]);
|
|
15
|
+
|
|
16
|
+
if (mainVersion >= 18) {
|
|
17
|
+
createRoot = reactDOMClone.createRoot;
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.log(e);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function legacyRender(node, container) {
|
|
24
|
+
ReactDOM.render(node, container);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function concurrentRender(node, container) {
|
|
28
|
+
if (createRoot) {
|
|
29
|
+
var root = createRoot(container);
|
|
30
|
+
root.render(node);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function render(node, container) {
|
|
35
|
+
if (createRoot) {
|
|
36
|
+
concurrentRender(node, container);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
legacyRender(node, container);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { render as r };
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
var _excluded = ["value", "color", "background", "direction", "type", "titleScroll", "ellipsis", "animatedTime", "titleGutter", "size", "titleNode", "children", "onClick", "onChange", "className", "autoHeight"];
|
|
6
|
+
var _excluded = ["value", "color", "background", "direction", "type", "titleScroll", "ellipsis", "animatedTime", "titleGutter", "size", "titleNode", "children", "onClick", "onChange", "className", "autoHeight", "iconClassPrefix", "iconFontClassName"];
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
@@ -66,6 +66,8 @@ var Tabs = function Tabs(props) {
|
|
|
66
66
|
onChange = _defaultProps$props.onChange,
|
|
67
67
|
className = _defaultProps$props.className,
|
|
68
68
|
autoHeight = _defaultProps$props.autoHeight,
|
|
69
|
+
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
70
|
+
iconFontClassName = _defaultProps$props.iconFontClassName,
|
|
69
71
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
70
72
|
|
|
71
73
|
var _useState = useState({
|
|
@@ -161,8 +163,8 @@ var Tabs = function Tabs(props) {
|
|
|
161
163
|
className: "".concat(b(''), "__titles-item__smile"),
|
|
162
164
|
style: tabsActiveStyle
|
|
163
165
|
}, React__default.createElement(Icon, {
|
|
164
|
-
classPrefix:
|
|
165
|
-
fontClassName:
|
|
166
|
+
classPrefix: iconClassPrefix,
|
|
167
|
+
fontClassName: iconFontClassName,
|
|
166
168
|
color: color,
|
|
167
169
|
name: "joy-smile"
|
|
168
170
|
})), React__default.createElement("div", {
|
|
@@ -14,6 +14,7 @@ export interface CollapseItemProps extends IComponent {
|
|
|
14
14
|
titleIconColor: string;
|
|
15
15
|
titleIconPosition: string;
|
|
16
16
|
titleIconSize: string;
|
|
17
|
+
childnull: boolean;
|
|
17
18
|
onToggle: (isOpen: boolean, name: string) => void;
|
|
18
19
|
}
|
|
19
20
|
export declare const CollapseItem: FunctionComponent<Partial<CollapseItemProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { FunctionComponent, MouseEvent } from 'react';
|
|
2
|
+
import { IComponent } from '@/utils/typings';
|
|
2
3
|
declare type Direction = 'right' | 'left';
|
|
3
4
|
declare type Position = {
|
|
4
5
|
top?: string;
|
|
5
6
|
bottom?: string;
|
|
6
7
|
};
|
|
7
|
-
import { IComponent } from '@/utils/typings';
|
|
8
8
|
export interface FixedNavProps extends IComponent {
|
|
9
9
|
fixednavClass: string;
|
|
10
10
|
visible: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FunctionComponent, ReactNode } from 'react';
|
|
2
|
-
declare type GridDirection = 'horizontal' | 'vertical';
|
|
3
2
|
import { IComponent } from '@/utils/typings';
|
|
3
|
+
declare type GridDirection = 'horizontal' | 'vertical';
|
|
4
4
|
export interface GridItemProps extends IComponent {
|
|
5
5
|
text: string | ReactNode;
|
|
6
6
|
icon: string | ReactNode;
|
|
@@ -14,8 +14,8 @@ export interface InfiniteloadingProps extends IComponent {
|
|
|
14
14
|
loadMoreTxt: string;
|
|
15
15
|
className: string;
|
|
16
16
|
style: React.CSSProperties;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
onRefresh: (param: () => void) => void;
|
|
18
|
+
onLoadMore: (param: () => void) => void;
|
|
19
|
+
onScrollChange: (param: number) => void;
|
|
20
20
|
}
|
|
21
21
|
export declare const Infiniteloading: FunctionComponent<Partial<InfiniteloadingProps> & React.HTMLAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties, FunctionComponent, HTMLInputTypeAttribute } from 'react';
|
|
2
|
+
import { IComponent } from '@/utils/typings';
|
|
2
3
|
export declare type InputAlignType = 'left' | 'center' | 'right';
|
|
3
4
|
export declare type InputFormatTrigger = 'onChange' | 'onBlur';
|
|
4
5
|
export declare type InputType = HTMLInputTypeAttribute;
|
|
@@ -8,7 +9,6 @@ export declare type InputRule = {
|
|
|
8
9
|
required?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare type ConfirmTextType = 'send' | 'search' | 'next' | 'go' | 'done';
|
|
11
|
-
import { IComponent } from '@/utils/typings';
|
|
12
12
|
export interface InputProps extends IComponent {
|
|
13
13
|
type: InputType;
|
|
14
14
|
defaultValue: any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { IComponent } from '@/utils/typings';
|
|
2
3
|
export interface OptionItem {
|
|
3
4
|
text: string;
|
|
4
5
|
value: string | number;
|
|
5
6
|
}
|
|
6
|
-
import { IComponent } from '@/utils/typings';
|
|
7
7
|
export interface MenuItemProps extends IComponent {
|
|
8
8
|
className: string;
|
|
9
9
|
style: React.CSSProperties;
|
|
@@ -11,6 +11,7 @@ import Row from '@/packages/row';
|
|
|
11
11
|
import Divider from '@/packages/divider';
|
|
12
12
|
import Grid from '@/packages/grid';
|
|
13
13
|
import GridItem from '@/packages/griditem';
|
|
14
|
+
import Sticky from '@/packages/sticky';
|
|
14
15
|
import NavBar from '@/packages/navbar';
|
|
15
16
|
import FixedNav from '@/packages/fixednav';
|
|
16
17
|
import Tabbar from '@/packages/tabbar';
|
|
@@ -84,4 +85,4 @@ import Card from '@/packages/card';
|
|
|
84
85
|
import TimePannel from '@/packages/timepannel';
|
|
85
86
|
import TimeDetail from '@/packages/timedetail';
|
|
86
87
|
import TimeSelect from '@/packages/timeselect';
|
|
87
|
-
export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Layout, Col, Row, Divider, Grid, GridItem, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
|
|
88
|
+
export { Button, Cell, CellGroup, Icon, Overlay, Popup, ConfigProvider, Layout, Col, Row, Divider, Grid, GridItem, Sticky, NavBar, FixedNav, Tabbar, TabbarItem, Elevator, Pagination, Tabs, TabPane, Indicator, SideNavBar, SubSideNavBar, SideNavBarItem, Menu, MenuItem, Range, Calendar, Checkbox, CheckboxGroup, DatePicker, InputNumber, Input, Radio, RadioGroup, Rate, CalendarItem, Picker, ShortPassword, TextArea, Uploader, Cascader, SearchBar, NumberKeyboard, ActionSheet, BackTop, Drag, Dialog, Infiniteloading, Notify, Switch, Toast, Swipe, PullToRefresh, CircleProgress, NoticeBar, Steps, Step, Swiper, SwiperItem, Avatar, AvatarGroup, Price, Badge, Tag, Popover, Skeleton, CountDown, Collapse, CollapseItem, AnimatingNumbers, Empty, VirtualList, Table, Video, Progress, Audio, ImagePreview, Address, Barrage, Signature, Card, TimePannel, TimeDetail, TimeSelect };
|