@hi-ui/hiui 2.15.11 → 2.15.12
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/es/_util/SwitchVersion.js +40 -0
- package/es/_util/depreactedPropsCompat.js +58 -0
- package/es/_util/index.js +31 -0
- package/es/_util/warning.js +2 -2
- package/es/alert/Alert.js +126 -0
- package/es/alert/__tests__/index.test.js +84 -0
- package/es/alert/index.js +6 -147
- package/es/alert/style/index.css +1 -1
- package/es/badge/Badge.js +82 -0
- package/es/badge/__tests__/index.test.js +82 -0
- package/es/badge/index.js +9 -87
- package/es/badge/style/index.css +1 -1
- package/es/badge/style/index.js +0 -0
- package/es/breadcrumb/__tests__/index.test.js +61 -0
- package/es/breadcrumb/index.js +85 -0
- package/es/breadcrumb/style/index.css +1 -0
- package/es/button/Button.js +62 -60
- package/es/button/ButtonGroup.js +24 -40
- package/es/button/IconLoading.js +6 -6
- package/es/button/__tests__/index.test.js +221 -0
- package/es/button/index.js +3 -2
- package/es/button/style/index.css +1 -1
- package/es/card/__tests__/index.test.js +179 -0
- package/es/card/index.js +61 -57
- package/es/card/style/index.css +1 -1
- package/es/carousel/__tests__/index.test.js +104 -0
- package/es/carousel/index.js +219 -0
- package/es/carousel/style/index.css +1 -0
- package/es/carousel/style/index.js +3 -0
- package/es/cascader/Cascader.js +190 -133
- package/es/cascader/Menu.js +168 -0
- package/es/cascader/__tests__/index.test.js +392 -0
- package/es/cascader/index.js +5 -2
- package/es/cascader/style/cascader.css +1 -1
- package/es/cascader/style/menu.css +1 -1
- package/es/checkbox/Checkbox.js +136 -0
- package/es/checkbox/Group.js +194 -0
- package/es/checkbox/__tests__/index.test.js +226 -0
- package/es/checkbox/checkbox-legacy/Base.js +212 -0
- package/es/checkbox/checkbox-legacy/CheckBox.js +157 -0
- package/es/checkbox/checkbox-legacy/index.js +15 -0
- package/es/checkbox/checkbox-legacy/style/index.css +1 -0
- package/es/checkbox/checkbox-legacy/style/index.js +3 -0
- package/es/checkbox/index.js +13 -4
- package/es/checkbox/style/index.css +1 -1
- package/es/collapse/__tests__/index.test.js +111 -0
- package/es/collapse/index.js +88 -110
- package/es/collapse/style/index.css +1 -1
- package/es/confirm/index.js +39 -60
- package/es/context/index.js +45 -51
- package/es/counter/Counter.js +339 -0
- package/es/counter/__tests__/index.test.js +134 -0
- package/es/counter/counter-legacy/index.js +267 -0
- package/es/counter/index.js +6 -270
- package/es/counter/style/index.css +1 -1
- package/es/date-picker/BasePicker.js +380 -302
- package/es/date-picker/Calender.js +326 -98
- package/es/date-picker/DatePanel.js +194 -213
- package/es/date-picker/DatePicker.js +143 -47
- package/es/date-picker/DateRangePanel.js +272 -208
- package/es/date-picker/Modal.js +18 -32
- package/es/date-picker/Time.js +231 -345
- package/es/date-picker/TimeList.js +246 -0
- package/es/date-picker/TimePanel.js +28 -41
- package/es/date-picker/TimePeriodPanel.js +27 -46
- package/es/date-picker/TimePicker.js +44 -46
- package/es/date-picker/TimeRangePanel.js +33 -51
- package/es/date-picker/Type.js +5 -1
- package/es/date-picker/WeekRangePanel.js +254 -175
- package/es/date-picker/YMRangePanel.js +364 -0
- package/es/date-picker/__tests__/index.test.js +956 -0
- package/es/date-picker/constants.js +14 -28
- package/es/date-picker/dateUtil.js +221 -52
- package/es/date-picker/datepicker-legacy/BasePicker.js +511 -0
- package/es/date-picker/datepicker-legacy/Calender.js +422 -0
- package/es/date-picker/datepicker-legacy/DatePanel.js +455 -0
- package/es/date-picker/datepicker-legacy/DatePicker.js +103 -0
- package/es/date-picker/datepicker-legacy/DateRangePanel.js +488 -0
- package/es/date-picker/datepicker-legacy/Modal.js +67 -0
- package/es/date-picker/datepicker-legacy/Time.js +405 -0
- package/es/date-picker/datepicker-legacy/TimePanel.js +85 -0
- package/es/date-picker/datepicker-legacy/TimePeriodPanel.js +118 -0
- package/es/date-picker/datepicker-legacy/TimePicker.js +78 -0
- package/es/date-picker/datepicker-legacy/TimeRangePanel.js +90 -0
- package/es/date-picker/datepicker-legacy/Type.js +31 -0
- package/es/date-picker/datepicker-legacy/WeekRangePanel.js +337 -0
- package/es/date-picker/datepicker-legacy/constants.js +79 -0
- package/es/date-picker/datepicker-legacy/dateUtil.js +258 -0
- package/es/date-picker/datepicker-legacy/index.js +15 -0
- package/es/date-picker/datepicker-legacy/local.js +11 -0
- package/es/date-picker/datepicker-legacy/style/index.css +1 -0
- package/es/date-picker/datepicker-legacy/style/index.js +3 -0
- package/es/date-picker/datepicker-legacy/style/timepicker.css +1 -0
- package/es/date-picker/datepicker-legacy/util.js +60 -0
- package/es/date-picker/index.js +5 -2
- package/es/date-picker/style/index.css +1 -1
- package/es/date-picker/toLunar.js +172 -0
- package/es/date-picker/util.js +101 -8
- package/es/dropdown/Dropdown.js +191 -203
- package/es/dropdown/DropdownButton.js +102 -0
- package/es/dropdown/DropdownMenu.js +107 -0
- package/es/dropdown/DropdownMenuItem.js +172 -0
- package/es/dropdown/__tests__/index.test.js +313 -0
- package/es/dropdown/index.js +69 -4
- package/es/dropdown/style/index.css +1 -1
- package/es/dropdown/style/index.js +0 -2
- package/es/dropdown/{__test__ → tests}/index.test.js +7 -7
- package/es/dropdown/utils.js +35 -0
- package/es/ficon/index.js +16 -30
- package/es/form/Form.js +176 -0
- package/es/form/{item.js → Item.js} +52 -60
- package/es/form/__tests__/index.test.js +571 -0
- package/es/form/index.js +6 -171
- package/es/form/style/index.css +1 -1
- package/es/grid/__tests__/index.test.js +100 -0
- package/es/grid/index.js +36 -56
- package/es/icon/index.js +23 -38
- package/es/index.js +61 -9
- package/es/input/Input.js +400 -0
- package/es/input/__tests__/index.test.js +376 -0
- package/es/input/index.js +26 -347
- package/es/input/input-legacy/index.js +341 -0
- package/es/input/input-legacy/util.js +176 -0
- package/es/input/style/index.css +1 -1
- package/es/input/util.js +26 -18
- package/es/lib/withDragDropContext.js +2 -2
- package/es/loading/Loading.js +173 -0
- package/es/loading/__tests__/index.test.js +110 -0
- package/es/loading/index.js +5 -129
- package/es/loading/style/index.css +0 -0
- package/es/loading/style/index.js +0 -0
- package/es/locales/en-US.js +45 -9
- package/es/locales/index.js +16 -2
- package/es/locales/zh-CN.js +46 -10
- package/es/locales/zh-Hant-HK.js +123 -0
- package/es/locales/zh-Hant-TW.js +125 -0
- package/es/menu/Item.js +34 -51
- package/es/menu/Menu.js +414 -0
- package/es/menu/SubMenu.js +63 -90
- package/es/menu/Title.js +37 -51
- package/es/menu/__tests__/index.test.js +274 -0
- package/es/menu/index.js +12 -419
- package/es/menu/style/index.css +1 -1
- package/es/message/__tests__/index.test.js +71 -0
- package/es/message/index.js +58 -0
- package/es/message/style/index.css +1 -0
- package/es/message/style/index.js +5 -0
- package/es/modal/__tests__/index.test.js +178 -0
- package/es/modal/index.js +85 -77
- package/es/modal/style/index.css +1 -1
- package/es/nav-menu/NavMenu.js +44 -61
- package/es/nav-menu/__test__/index.test.js +8 -8
- package/es/nav-menu/__tests__/index.test.js +23 -0
- package/es/nav-menu/index.js +2 -2
- package/es/notice/Notice.js +136 -0
- package/es/notice/NoticeContainer.js +107 -0
- package/es/notice/__tests__/index.test.js +174 -0
- package/es/notice/index.js +66 -0
- package/es/notice/style/index.css +1 -0
- package/es/notice/style/index.js +5 -0
- package/es/notification/HandleNotification/index.js +216 -0
- package/es/notification/HandleNotification/style/index.css +1 -0
- package/es/notification/HandleNotification/style/index.js +5 -0
- package/es/notification/__tests__/index.test.js +114 -0
- package/es/notification/index.js +68 -231
- package/es/notification/style/index.css +1 -1
- package/es/notification/style/index.js +0 -0
- package/es/pagination/Pager.js +7 -9
- package/es/pagination/Pagination.js +134 -133
- package/es/pagination/__tests__/index.test.js +244 -0
- package/es/pagination/index.js +9 -8
- package/es/pagination/style/index.css +1 -1
- package/es/panel/index.js +28 -46
- package/es/popover/__test__/index.test.js +10 -10
- package/es/popover/__tests__/index.test.js +152 -0
- package/es/popover/index.js +77 -83
- package/es/popper/index.js +68 -64
- package/es/popper/style/index.css +1 -1
- package/es/preview/index.js +529 -0
- package/es/preview/style/index.css +1 -0
- package/es/preview/style/index.js +3 -0
- package/es/progress/BarProgress.js +107 -43
- package/es/progress/CircleProgress.js +13 -14
- package/es/progress/DashboardProgress.js +11 -13
- package/es/progress/Progress.js +102 -0
- package/es/progress/__tests__/index.test.js +131 -0
- package/es/progress/index.js +8 -100
- package/es/progress/style/index.css +1 -1
- package/es/radio/Group.js +199 -0
- package/es/radio/Radio.js +147 -0
- package/es/radio/__tests__/index.test.js +127 -0
- package/es/radio/index.js +10 -216
- package/es/radio/{__test__ → radio-legacy/__test__}/index.test.js +13 -13
- package/es/radio/radio-legacy/index.js +214 -0
- package/es/radio/radio-legacy/style/index.css +1 -0
- package/es/radio/radio-legacy/style/index.js +3 -0
- package/es/radio/style/index.css +1 -1
- package/es/rate/Icons.js +70 -70
- package/es/rate/Rate.js +75 -108
- package/es/rate/__tests__/index.test.js +124 -0
- package/es/rate/index.js +5 -2
- package/es/rate/style/index.css +1 -1
- package/es/select/Select.js +330 -265
- package/es/select/SelectDropdown.js +223 -79
- package/es/select/SelectInput.js +120 -91
- package/es/select/__tests__/index.test.js +505 -0
- package/es/select/index.js +6 -4
- package/es/select/select-legacy/Option.js +78 -0
- package/es/select/select-legacy/Select.js +702 -0
- package/es/select/select-legacy/SelectDropdown.js +157 -0
- package/es/select/select-legacy/SelectInput.js +308 -0
- package/es/select/select-legacy/common.js +19 -0
- package/es/select/select-legacy/index.js +16 -0
- package/es/select/style/select-dropdown.css +1 -1
- package/es/select/style/select-input.css +1 -1
- package/es/stepper/Stepper.js +147 -0
- package/es/stepper/__tests__/index.test.js +161 -0
- package/es/stepper/index.js +21 -127
- package/es/stepper/style/index.css +1 -1
- package/es/style/icon/diyIcon.css +1 -1
- package/es/style/icon/index.css +1 -1
- package/es/switch/__tests__/index.test.js +68 -0
- package/es/switch/index.js +26 -46
- package/es/switch/style/index.css +1 -1
- package/es/table/Body.js +294 -0
- package/es/table/ClickOuterside.js +95 -0
- package/es/table/Footer.js +171 -0
- package/es/table/Header.js +320 -0
- package/es/table/TableContent.js +101 -0
- package/es/table/__tests__/index.test.js +129 -0
- package/es/table/checkbox/index.js +36 -47
- package/es/table/checkbox/style/index.css +1 -0
- package/es/table/checkbox/style/index.js +3 -0
- package/es/table/index.js +269 -314
- package/es/table/menu/index.js +34 -44
- package/es/table/prefix.js +2 -2
- package/es/table/style/Table.css +1 -1
- package/es/table/style/index.css +1 -1
- package/es/tabs/ItemDropdown.js +45 -65
- package/es/tabs/TabPane.js +26 -44
- package/es/tabs/Tabs.js +110 -111
- package/es/tabs/__tests__/index.test.js +329 -0
- package/es/tabs/index.js +9 -3
- package/es/tabs/style/index.css +1 -1
- package/es/tabs/tabs-legacy/ItemDropdown.js +162 -0
- package/es/tabs/tabs-legacy/TabPane.js +70 -0
- package/es/tabs/tabs-legacy/Tabs.js +291 -0
- package/es/tabs/tabs-legacy/index.js +18 -0
- package/es/tabs/tabs-legacy/style/index.css +1 -0
- package/es/tabs/tabs-legacy/style/index.js +3 -0
- package/es/tag/__tests__/index.test.js +46 -0
- package/es/tag/index.js +86 -0
- package/es/tag/style/index.css +1 -0
- package/es/tag/style/index.js +3 -0
- package/es/timeline/__tests__/index.test.js +198 -0
- package/es/timeline/index.js +206 -136
- package/es/timeline/style/index.css +1 -1
- package/es/tooltip/__tests__/index.test.js +166 -0
- package/es/tooltip/index.js +93 -52
- package/es/tooltip/style/index.css +1 -1
- package/es/transfer/Item.js +73 -71
- package/es/transfer/Transfer.js +558 -0
- package/es/transfer/__tests__/index.test.js +210 -0
- package/es/transfer/index.js +4 -443
- package/es/transfer/style/index.css +1 -1
- package/es/tree/IconLoading.js +38 -0
- package/es/tree/Tree.js +94 -111
- package/es/tree/TreeDivider.js +6 -6
- package/es/tree/TreeItem.js +217 -123
- package/es/tree/TreeNode.js +472 -333
- package/es/tree/__tests__/index.test.js +599 -0
- package/es/tree/index.js +9 -2
- package/es/tree/style/index.css +1 -1
- package/es/tree/tree-legacy/Tree.js +330 -0
- package/es/tree/tree-legacy/TreeDivider.js +25 -0
- package/es/tree/tree-legacy/TreeItem.js +326 -0
- package/es/tree/tree-legacy/TreeNode.js +711 -0
- package/es/tree/tree-legacy/index.js +13 -0
- package/es/tree/tree-legacy/style/index.css +1 -0
- package/es/tree/tree-legacy/style/index.js +3 -0
- package/es/tree/tree-legacy/util.js +434 -0
- package/es/tree/util.js +8 -256
- package/es/upload/Upload.js +292 -200
- package/es/upload/UploadAvatar.js +61 -79
- package/es/upload/UploadClick.js +62 -60
- package/es/upload/UploadDrag.js +63 -66
- package/es/upload/UploadPhoto.js +86 -75
- package/es/upload/UploadPictureCard.js +53 -60
- package/es/upload/__tests__/index.test.js +760 -0
- package/es/upload/index.js +8 -71
- package/es/upload/main.js +83 -0
- package/es/upload/style/index.css +1 -1
- package/es/upload/tool.js +0 -1
- package/es/upload/{Preview.js → upload-legacy/Preview.js} +48 -62
- package/es/upload/upload-legacy/Upload.js +431 -0
- package/es/upload/upload-legacy/UploadAvatar.js +318 -0
- package/es/upload/upload-legacy/UploadClick.js +121 -0
- package/es/upload/upload-legacy/UploadDrag.js +176 -0
- package/es/upload/upload-legacy/UploadPhoto.js +179 -0
- package/es/upload/upload-legacy/UploadPictureCard.js +122 -0
- package/es/upload/upload-legacy/index.js +67 -0
- package/es/upload/upload-legacy/style/index.css +1 -0
- package/es/upload/upload-legacy/style/index.js +5 -0
- package/es/upload/upload-legacy/tool.js +84 -0
- package/es/watermark/index.js +97 -0
- package/es/watermark/watermark.js +263 -0
- package/package.json +1 -1
- package/es/alert/__test__/index.test.js +0 -67
- package/es/button/__test__/index.test.js +0 -29
- package/es/cascader/__test__/index.test.js +0 -283
- package/es/cascader/menu.js +0 -155
- package/es/checkbox/Base.js +0 -205
- package/es/checkbox/CheckBox.js +0 -185
- package/es/collapse/__test__/index.test.js +0 -58
- package/es/counter/__test__/index.test.js +0 -52
- package/es/menu/ItemGroup.js +0 -81
- package/es/modal/__test__/index.test.js +0 -123
- package/es/notification/__test__/index.test.js +0 -56
- package/es/pagination/__test__/index.test.js +0 -140
- package/es/rate/__test__/index.test.js +0 -54
- package/es/select/Option.js +0 -93
- package/es/select/__test__/index.test.js +0 -429
- package/es/style/color/colors.css +0 -0
- package/es/style/index.css +0 -0
- package/es/style/mixins/colors.css +0 -0
- package/es/style/mixins/index.css +0 -0
- package/es/style/theme/dark.css +0 -0
- package/es/style/theme/default.css +0 -0
- package/es/switch/__test__/index.test.js +0 -39
- package/es/table/__test__/index.test.js +0 -73
- package/es/table/body.js +0 -318
- package/es/table/clickOuterside.js +0 -115
- package/es/table/footer.js +0 -196
- package/es/table/header.js +0 -337
- package/es/table/pover.js +0 -154
- package/es/table/tableContent.js +0 -120
- package/es/timeline/__test__/index.test.js +0 -49
- package/es/timeline/foldingItem.js +0 -82
- package/es/tooltip/__test__/index.test.js +0 -67
- package/es/transfer/__test__/index.test.js +0 -11
- /package/es/{style → breadcrumb/style}/index.js +0 -0
- /package/es/checkbox/{common.js → checkbox-legacy/common.js} +0 -0
- /package/es/upload/{style → upload-legacy/style}/preview.css +0 -0
- /package/es/upload/{style → upload-legacy/style}/preview.js +0 -0
package/es/upload/Upload.js
CHANGED
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
3
7
|
Object.defineProperty(exports, "__esModule", {
|
|
4
8
|
value: true
|
|
5
9
|
});
|
|
6
10
|
exports["default"] = void 0;
|
|
7
11
|
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
+
|
|
18
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
+
|
|
20
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
+
|
|
22
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
+
|
|
24
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
25
|
+
|
|
26
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
27
|
+
|
|
28
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
29
|
+
|
|
30
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
+
|
|
8
32
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
33
|
|
|
10
34
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
@@ -21,72 +45,240 @@ var _button = _interopRequireDefault(require("../button"));
|
|
|
21
45
|
|
|
22
46
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
23
47
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
48
|
+
var fileId = 0;
|
|
27
49
|
|
|
28
|
-
|
|
50
|
+
var Upload =
|
|
51
|
+
/*#__PURE__*/
|
|
52
|
+
function (_Component) {
|
|
53
|
+
(0, _inherits2["default"])(Upload, _Component);
|
|
29
54
|
|
|
30
|
-
function
|
|
55
|
+
function Upload(props) {
|
|
56
|
+
var _this;
|
|
31
57
|
|
|
32
|
-
|
|
58
|
+
(0, _classCallCheck2["default"])(this, Upload);
|
|
59
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(Upload).call(this, props));
|
|
60
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "cancelEvent", function () {
|
|
61
|
+
_this.setState({
|
|
62
|
+
visibleModal: false
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "uploadFile",
|
|
66
|
+
/*#__PURE__*/
|
|
67
|
+
function () {
|
|
68
|
+
var _ref = (0, _asyncToGenerator2["default"])(
|
|
69
|
+
/*#__PURE__*/
|
|
70
|
+
_regenerator["default"].mark(function _callee(file) {
|
|
71
|
+
var dataUrl,
|
|
72
|
+
FileReader,
|
|
73
|
+
XMLHttpRequest,
|
|
74
|
+
FormData,
|
|
75
|
+
fileList,
|
|
76
|
+
_this$props,
|
|
77
|
+
name,
|
|
78
|
+
params,
|
|
79
|
+
headers,
|
|
80
|
+
uploadAction,
|
|
81
|
+
withCredentials,
|
|
82
|
+
maxCount,
|
|
83
|
+
_uploadAction,
|
|
84
|
+
onerror,
|
|
85
|
+
fr,
|
|
86
|
+
xhr,
|
|
87
|
+
formFile,
|
|
88
|
+
i,
|
|
89
|
+
j,
|
|
90
|
+
_args = arguments;
|
|
91
|
+
|
|
92
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
93
|
+
while (1) {
|
|
94
|
+
switch (_context.prev = _context.next) {
|
|
95
|
+
case 0:
|
|
96
|
+
dataUrl = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
|
|
97
|
+
FileReader = window.FileReader;
|
|
98
|
+
XMLHttpRequest = window.XMLHttpRequest;
|
|
99
|
+
FormData = window.FormData;
|
|
100
|
+
fileList = _this.state.fileList;
|
|
101
|
+
_this$props = _this.props, name = _this$props.name, params = _this$props.params, headers = _this$props.headers, uploadAction = _this$props.uploadAction, withCredentials = _this$props.withCredentials, maxCount = _this$props.maxCount;
|
|
102
|
+
_uploadAction = typeof uploadAction === 'string' ? uploadAction : uploadAction(file);
|
|
103
|
+
|
|
104
|
+
if (!(_uploadAction.toString() === '[object Promise]')) {
|
|
105
|
+
_context.next = 10;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
_context.next = 10;
|
|
110
|
+
return _uploadAction.then(function (res) {
|
|
111
|
+
_uploadAction = res;
|
|
112
|
+
})["catch"](function (error) {
|
|
113
|
+
throw new Error(error);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
case 10:
|
|
117
|
+
_this.setState({
|
|
118
|
+
fileCountLimted: fileList.length >= maxCount
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
onerror = function onerror(err) {
|
|
122
|
+
var fileList = _this.state.fileList;
|
|
123
|
+
var errRes = err !== undefined ? err : {
|
|
124
|
+
status: xhr.status,
|
|
125
|
+
statusText: xhr.statusText
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
var _fileList = (0, _toConsumableArray2["default"])(fileList);
|
|
129
|
+
|
|
130
|
+
file.uploadState = 'error';
|
|
131
|
+
|
|
132
|
+
var idx = _fileList.findIndex(function (item) {
|
|
133
|
+
return item.fileId === file.fileId;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
_fileList.splice(idx, 1, file);
|
|
137
|
+
|
|
138
|
+
_this.setState({
|
|
139
|
+
fileList: _fileList
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
_this.onUpload(file, _fileList, errRes);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
if (file.fileType === 'img') {
|
|
146
|
+
// 用来图片预览
|
|
147
|
+
if (dataUrl) {
|
|
148
|
+
file.url = dataUrl;
|
|
149
|
+
} else if (dataUrl !== false) {
|
|
150
|
+
fr = new FileReader();
|
|
151
|
+
|
|
152
|
+
fr.onload = function (e) {
|
|
153
|
+
var url = e.target.result;
|
|
154
|
+
|
|
155
|
+
var _fileList = (0, _toConsumableArray2["default"])(fileList);
|
|
156
|
+
|
|
157
|
+
file.url = url;
|
|
158
|
+
|
|
159
|
+
var idx = _fileList.findIndex(function (item) {
|
|
160
|
+
return item.fileId === file.fileId;
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
_fileList.splice(idx, 1, file);
|
|
164
|
+
|
|
165
|
+
_this.setState({
|
|
166
|
+
fileList: _fileList
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
fr.readAsDataURL(file);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
xhr = new XMLHttpRequest();
|
|
175
|
+
formFile = new FormData();
|
|
176
|
+
file.xhr = xhr;
|
|
177
|
+
xhr.withCredentials = withCredentials;
|
|
178
|
+
|
|
179
|
+
if (dataUrl) {
|
|
180
|
+
formFile.append(name, dataUrl);
|
|
181
|
+
} else {
|
|
182
|
+
formFile.append(name, file);
|
|
183
|
+
} // 设置除file外需要带入的参数
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
if (params) {
|
|
187
|
+
for (i in params) {
|
|
188
|
+
formFile.append(i, params[i]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
xhr.onreadystatechange = function () {
|
|
193
|
+
if (xhr.readyState === 4) {
|
|
194
|
+
if (xhr.status === 200) {
|
|
195
|
+
var _fileList3 = _this.state.fileList;
|
|
33
196
|
|
|
34
|
-
|
|
197
|
+
var _fileList = (0, _toConsumableArray2["default"])(_fileList3);
|
|
35
198
|
|
|
36
|
-
|
|
199
|
+
file.uploadState = 'success';
|
|
37
200
|
|
|
38
|
-
|
|
201
|
+
var idx = _fileList.findIndex(function (item) {
|
|
202
|
+
return item.fileId === file.fileId;
|
|
203
|
+
});
|
|
39
204
|
|
|
40
|
-
|
|
205
|
+
_fileList.splice(idx, 1, file);
|
|
41
206
|
|
|
42
|
-
|
|
207
|
+
_this.setState({
|
|
208
|
+
fileList: _fileList
|
|
209
|
+
}, function () {
|
|
210
|
+
return _this.onUpload(file, _fileList, JSON.parse(xhr.response));
|
|
211
|
+
});
|
|
212
|
+
} else {
|
|
213
|
+
onerror();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
43
217
|
|
|
44
|
-
|
|
218
|
+
xhr.upload.onerror = function () {
|
|
219
|
+
onerror();
|
|
220
|
+
};
|
|
45
221
|
|
|
46
|
-
|
|
222
|
+
xhr.upload.onprogress = function (event) {
|
|
223
|
+
var fileList = _this.state.fileList;
|
|
224
|
+
var e = event || window.event;
|
|
225
|
+
var percentComplete = Math.ceil(e.loaded / e.total * 100);
|
|
47
226
|
|
|
48
|
-
|
|
227
|
+
var _fileList = (0, _toConsumableArray2["default"])(fileList);
|
|
49
228
|
|
|
50
|
-
|
|
229
|
+
var idx = _fileList.findIndex(function (item) {
|
|
230
|
+
return item.fileId === file.fileId;
|
|
231
|
+
});
|
|
51
232
|
|
|
52
|
-
|
|
233
|
+
_fileList.splice(idx, 1, file);
|
|
53
234
|
|
|
54
|
-
|
|
235
|
+
file.progressNumber = percentComplete;
|
|
55
236
|
|
|
56
|
-
|
|
57
|
-
|
|
237
|
+
_this.setState({
|
|
238
|
+
fileList: _fileList
|
|
239
|
+
});
|
|
240
|
+
};
|
|
58
241
|
|
|
59
|
-
|
|
242
|
+
xhr.open('post', _uploadAction, true); // 设置用户传入的请求头
|
|
60
243
|
|
|
61
|
-
|
|
62
|
-
|
|
244
|
+
if (headers) {
|
|
245
|
+
for (j in headers) {
|
|
246
|
+
xhr.setRequestHeader(j, headers[j]);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
63
249
|
|
|
64
|
-
|
|
250
|
+
xhr.send(formFile);
|
|
65
251
|
|
|
66
|
-
|
|
252
|
+
case 25:
|
|
253
|
+
case "end":
|
|
254
|
+
return _context.stop();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}, _callee);
|
|
258
|
+
}));
|
|
67
259
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
260
|
+
return function (_x) {
|
|
261
|
+
return _ref.apply(this, arguments);
|
|
262
|
+
};
|
|
263
|
+
}());
|
|
73
264
|
|
|
74
|
-
var
|
|
265
|
+
var _fileList2 = _this.prepareDefaultFileList(props.fileList || props.defaultFileList);
|
|
75
266
|
|
|
76
267
|
_this.state = {
|
|
77
268
|
visibleModal: false,
|
|
78
|
-
fileList:
|
|
79
|
-
fileCountLimted:
|
|
269
|
+
fileList: _fileList2,
|
|
270
|
+
fileCountLimted: _fileList2.length >= props.maxCount
|
|
80
271
|
};
|
|
81
272
|
return _this;
|
|
82
273
|
}
|
|
83
274
|
|
|
84
|
-
|
|
275
|
+
(0, _createClass2["default"])(Upload, [{
|
|
85
276
|
key: "componentWillReceiveProps",
|
|
86
277
|
value: function componentWillReceiveProps(nextProps) {
|
|
87
|
-
if (!(0, _shallowequal["default"])(nextProps.
|
|
278
|
+
if (!(0, _shallowequal["default"])(nextProps.fileList, this.props.fileList)) {
|
|
88
279
|
this.setState({
|
|
89
|
-
fileList: this.prepareDefaultFileList(nextProps.
|
|
280
|
+
fileList: this.prepareDefaultFileList(nextProps.fileList),
|
|
281
|
+
fileCountLimted: nextProps.fileList.length >= nextProps.maxCount
|
|
90
282
|
});
|
|
91
283
|
}
|
|
92
284
|
}
|
|
@@ -124,7 +316,7 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
124
316
|
break;
|
|
125
317
|
|
|
126
318
|
case 'doc':
|
|
127
|
-
case '
|
|
319
|
+
case 'docx':
|
|
128
320
|
fileType = 'word';
|
|
129
321
|
break;
|
|
130
322
|
|
|
@@ -177,31 +369,31 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
177
369
|
var localeDatas = this.props.localeDatas;
|
|
178
370
|
|
|
179
371
|
if (this.state.visibleModal) {
|
|
180
|
-
return
|
|
372
|
+
return _react["default"].createElement(_modal["default"], {
|
|
181
373
|
title: localeDatas.upload.modalTitle,
|
|
182
374
|
style: {
|
|
183
375
|
width: '480px'
|
|
184
376
|
},
|
|
185
377
|
onCancel: this.cancelEvent,
|
|
186
|
-
|
|
187
|
-
|
|
378
|
+
visible: this.state.visibleModal,
|
|
379
|
+
footer: [_react["default"].createElement(_button["default"], {
|
|
188
380
|
type: "primary",
|
|
189
381
|
key: 0,
|
|
190
382
|
onClick: this.cancelEvent
|
|
191
383
|
}, localeDatas.upload.modalBtn)]
|
|
192
|
-
},
|
|
384
|
+
}, _react["default"].createElement("div", {
|
|
193
385
|
className: "hi-upload__modal-tips"
|
|
194
|
-
},
|
|
386
|
+
}, _react["default"].createElement(_icon["default"], {
|
|
195
387
|
name: "info-circle-o",
|
|
196
388
|
style: {
|
|
197
389
|
color: '#db9639',
|
|
198
390
|
fontSize: '48px'
|
|
199
391
|
}
|
|
200
|
-
}),
|
|
392
|
+
}), _react["default"].createElement("div", {
|
|
201
393
|
className: "hi-upload__error\u2014content"
|
|
202
|
-
},
|
|
394
|
+
}, _react["default"].createElement("div", {
|
|
203
395
|
className: "hi-upload__error-title"
|
|
204
|
-
}, localeDatas.upload.modalTiptitle),
|
|
396
|
+
}, localeDatas.upload.modalTiptitle), _react["default"].createElement("div", {
|
|
205
397
|
className: "hi-upload__error-info"
|
|
206
398
|
}, localeDatas.upload.modalTiptxt))));
|
|
207
399
|
}
|
|
@@ -211,11 +403,12 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
211
403
|
}, {
|
|
212
404
|
key: "uploadFiles",
|
|
213
405
|
value: function uploadFiles(files) {
|
|
214
|
-
var
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
406
|
+
var _this3 = this;
|
|
407
|
+
|
|
408
|
+
var _this$props2 = this.props,
|
|
409
|
+
beforeUpload = _this$props2.beforeUpload,
|
|
410
|
+
customUpload = _this$props2.customUpload,
|
|
411
|
+
maxSize = _this$props2.maxSize;
|
|
219
412
|
var _this$state = this.state,
|
|
220
413
|
fileList = _this$state.fileList,
|
|
221
414
|
fileCountLimted = _this$state.fileCountLimted;
|
|
@@ -230,43 +423,43 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
230
423
|
|
|
231
424
|
if (customUpload) {
|
|
232
425
|
customUpload(files);
|
|
426
|
+
_reactDom["default"].findDOMNode(this.uploadRef).value = '';
|
|
233
427
|
return;
|
|
234
428
|
}
|
|
235
429
|
|
|
236
430
|
if (files.length === 0) return;
|
|
237
431
|
|
|
238
|
-
|
|
239
|
-
this.setState({
|
|
240
|
-
visibleModal: true
|
|
241
|
-
});
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
432
|
+
var _fileList = (0, _toConsumableArray2["default"])(fileList);
|
|
244
433
|
|
|
245
|
-
|
|
246
|
-
if (!files.hasOwnProperty(key)) continue;
|
|
434
|
+
Object.keys(files).forEach(function (key) {
|
|
247
435
|
var file = files[key];
|
|
248
|
-
|
|
436
|
+
|
|
437
|
+
if (file.size > maxSize * 1024) {
|
|
438
|
+
_this3.setState({
|
|
439
|
+
visibleModal: true
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
file.fileId = _this3.getFileId();
|
|
249
446
|
file.uploadState = 'loading';
|
|
250
|
-
file.fileType =
|
|
251
|
-
fileList.unshift(file);
|
|
252
|
-
this.setState({
|
|
253
|
-
fileList: fileList
|
|
254
|
-
});
|
|
255
|
-
this.uploadFile(file);
|
|
256
|
-
}
|
|
447
|
+
file.fileType = _this3.getFileType(file);
|
|
257
448
|
|
|
258
|
-
|
|
259
|
-
this.setState({
|
|
260
|
-
fileCountLimted: true
|
|
261
|
-
});
|
|
262
|
-
}
|
|
449
|
+
_fileList.unshift(file);
|
|
263
450
|
|
|
451
|
+
_this3.setState({
|
|
452
|
+
fileList: _fileList
|
|
453
|
+
}, function () {
|
|
454
|
+
_this3.uploadFile(file);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
264
457
|
_reactDom["default"].findDOMNode(this.uploadRef).value = '';
|
|
265
458
|
}
|
|
266
459
|
}, {
|
|
267
460
|
key: "deleteFile",
|
|
268
461
|
value: function deleteFile(file, index) {
|
|
269
|
-
var
|
|
462
|
+
var _this4 = this;
|
|
270
463
|
|
|
271
464
|
var fileList = this.state.fileList;
|
|
272
465
|
var onRemove = this.props.onRemove;
|
|
@@ -274,13 +467,14 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
274
467
|
var doRemove = function doRemove() {
|
|
275
468
|
fileList.splice(index, 1);
|
|
276
469
|
|
|
277
|
-
|
|
470
|
+
_this4.setState({
|
|
278
471
|
fileList: fileList,
|
|
279
472
|
fileCountLimted: false
|
|
280
473
|
});
|
|
281
474
|
};
|
|
282
475
|
|
|
283
476
|
var ret = onRemove(file, fileList, index);
|
|
477
|
+
file.uploadState === 'loading' && file.xhr.abort();
|
|
284
478
|
|
|
285
479
|
if (ret === true) {
|
|
286
480
|
doRemove();
|
|
@@ -295,145 +489,46 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
295
489
|
}, {
|
|
296
490
|
key: "onUpload",
|
|
297
491
|
value: function onUpload(file, fileList, response) {
|
|
298
|
-
var
|
|
492
|
+
var _this5 = this;
|
|
299
493
|
|
|
300
|
-
var
|
|
494
|
+
var _this$props3 = this.props,
|
|
495
|
+
onChange = _this$props3.onChange,
|
|
496
|
+
maxCount = _this$props3.maxCount;
|
|
301
497
|
|
|
302
498
|
var onUploadError = function onUploadError() {
|
|
303
499
|
for (var index in fileList) {
|
|
304
500
|
if (fileList[index].fileId === file.fileId) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
_this4.setState({
|
|
308
|
-
fileList: fileList
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
};
|
|
501
|
+
var _fileList = (0, _toConsumableArray2["default"])(fileList);
|
|
315
502
|
|
|
316
|
-
|
|
317
|
-
if (ret === false) {
|
|
318
|
-
onUploadError();
|
|
319
|
-
} else if (ret && typeof ret.then === 'function') {
|
|
320
|
-
ret.then(function (res) {
|
|
321
|
-
if (res === false) {
|
|
322
|
-
onUploadError();
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
onChange(file, fileList, response, callback);
|
|
329
|
-
}
|
|
330
|
-
}, {
|
|
331
|
-
key: "uploadFile",
|
|
332
|
-
value: function uploadFile(file) {
|
|
333
|
-
var _this5 = this;
|
|
334
|
-
|
|
335
|
-
var dataUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
336
|
-
var FileReader = window.FileReader;
|
|
337
|
-
var XMLHttpRequest = window.XMLHttpRequest;
|
|
338
|
-
var FormData = window.FormData;
|
|
339
|
-
var fileList = this.state.fileList;
|
|
340
|
-
var _this$props2 = this.props,
|
|
341
|
-
name = _this$props2.name,
|
|
342
|
-
param = _this$props2.param,
|
|
343
|
-
headers = _this$props2.headers,
|
|
344
|
-
uploadAction = _this$props2.uploadAction;
|
|
345
|
-
|
|
346
|
-
var onerror = function onerror(err) {
|
|
347
|
-
var errRes = err !== undefined ? err : {
|
|
348
|
-
status: xhr.status,
|
|
349
|
-
statusText: xhr.statusText
|
|
350
|
-
};
|
|
351
|
-
file.uploadState = 'error';
|
|
352
|
-
|
|
353
|
-
_this5.setState({
|
|
354
|
-
fileList: fileList
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
_this5.onUpload(file, fileList, errRes);
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
if (file.fileType === 'img') {
|
|
361
|
-
// 用来图片预览
|
|
362
|
-
if (dataUrl) {
|
|
363
|
-
file.url = dataUrl;
|
|
364
|
-
} else if (dataUrl !== false) {
|
|
365
|
-
var fr = new FileReader();
|
|
366
|
-
|
|
367
|
-
fr.onload = function (e) {
|
|
368
|
-
var url = e.target.result;
|
|
369
|
-
file.url = url;
|
|
503
|
+
_fileList.splice(index, 1);
|
|
370
504
|
|
|
371
505
|
_this5.setState({
|
|
372
|
-
fileList:
|
|
506
|
+
fileList: _fileList,
|
|
507
|
+
fileCountLimted: _fileList.length >= _this5.props.maxCount
|
|
373
508
|
});
|
|
374
|
-
};
|
|
375
509
|
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
var xhr = new XMLHttpRequest();
|
|
381
|
-
var formFile = new FormData();
|
|
382
|
-
|
|
383
|
-
if (dataUrl) {
|
|
384
|
-
formFile.append(name, dataUrl);
|
|
385
|
-
} else {
|
|
386
|
-
formFile.append(name, file);
|
|
387
|
-
} // 设置除file外需要带入的参数
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
if (param) {
|
|
391
|
-
for (var i in param) {
|
|
392
|
-
formFile.append(i, param[i]);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
xhr.upload.onload = function () {
|
|
397
|
-
file.uploadState = 'success';
|
|
398
|
-
|
|
399
|
-
_this5.setState({
|
|
400
|
-
fileList: fileList
|
|
401
|
-
});
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
xhr.onreadystatechange = function () {
|
|
405
|
-
if (xhr.readyState === 4) {
|
|
406
|
-
if (xhr.status === 200) {
|
|
407
|
-
_this5.onUpload(file, fileList, JSON.parse(xhr.response));
|
|
408
|
-
} else {
|
|
409
|
-
onerror();
|
|
510
|
+
break;
|
|
410
511
|
}
|
|
411
512
|
}
|
|
412
513
|
};
|
|
413
514
|
|
|
414
|
-
|
|
415
|
-
onerror();
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
xhr.upload.onprogress = function (event) {
|
|
419
|
-
var e = event || window.event;
|
|
420
|
-
var percentComplete = Math.ceil(e.loaded / e.total * 100);
|
|
421
|
-
file.progressNumber = percentComplete;
|
|
515
|
+
var changeResult = onChange(file, fileList, response);
|
|
422
516
|
|
|
423
|
-
|
|
424
|
-
|
|
517
|
+
if (changeResult === false) {
|
|
518
|
+
onUploadError();
|
|
519
|
+
} else if (changeResult && typeof changeResult.then === 'function') {
|
|
520
|
+
changeResult.then(function (res) {
|
|
521
|
+
if (res === false) {
|
|
522
|
+
onUploadError();
|
|
523
|
+
}
|
|
425
524
|
});
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
for (var j in headers) {
|
|
432
|
-
xhr.setRequestHeader(j, headers[j]);
|
|
525
|
+
} else {
|
|
526
|
+
if (fileList.length >= maxCount) {
|
|
527
|
+
this.setState({
|
|
528
|
+
fileCountLimted: true
|
|
529
|
+
});
|
|
433
530
|
}
|
|
434
531
|
}
|
|
435
|
-
|
|
436
|
-
xhr.send(formFile);
|
|
437
532
|
}
|
|
438
533
|
}, {
|
|
439
534
|
key: "uploadStatusIcon",
|
|
@@ -450,7 +545,6 @@ var Upload = /*#__PURE__*/function (_Component) {
|
|
|
450
545
|
}
|
|
451
546
|
}
|
|
452
547
|
}]);
|
|
453
|
-
|
|
454
548
|
return Upload;
|
|
455
549
|
}(_react.Component);
|
|
456
550
|
|
|
@@ -460,7 +554,6 @@ Upload.propTypes = {
|
|
|
460
554
|
limit: _propTypes["default"].number,
|
|
461
555
|
buttonText: _propTypes["default"].string,
|
|
462
556
|
buttonIcon: _propTypes["default"].string,
|
|
463
|
-
uploadAction: _propTypes["default"].string,
|
|
464
557
|
param: _propTypes["default"].object,
|
|
465
558
|
name: _propTypes["default"].string,
|
|
466
559
|
disabled: _propTypes["default"].bool,
|
|
@@ -473,21 +566,21 @@ Upload.propTypes = {
|
|
|
473
566
|
defaultFileList: _propTypes["default"].array,
|
|
474
567
|
fileList: _propTypes["default"].array,
|
|
475
568
|
onRemove: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].bool]),
|
|
476
|
-
maxSize: _propTypes["default"].number
|
|
569
|
+
maxSize: _propTypes["default"].number,
|
|
570
|
+
withCredentials: _propTypes["default"].bool
|
|
477
571
|
};
|
|
478
572
|
Upload.defaultProps = {
|
|
479
573
|
defaultFileList: [],
|
|
480
|
-
// headers: {'Content-type': 'multipart/form-data'}, // headers 不可以设置Content-type https://stackoverflow.com/questions/17415084/multipart-data-post-using-python-requests-no-multipart-boundary-was-found/17438575
|
|
481
574
|
headers: {},
|
|
482
575
|
accept: '',
|
|
483
576
|
limit: null,
|
|
484
577
|
buttonIcon: 'upload',
|
|
485
|
-
uploadAction: '',
|
|
486
578
|
param: null,
|
|
487
579
|
name: 'file',
|
|
488
580
|
disabled: false,
|
|
489
581
|
showUploadList: true,
|
|
490
582
|
multiple: false,
|
|
583
|
+
withCredentials: false,
|
|
491
584
|
beforeUpload: function beforeUpload() {
|
|
492
585
|
return true;
|
|
493
586
|
},
|
|
@@ -496,8 +589,7 @@ Upload.defaultProps = {
|
|
|
496
589
|
},
|
|
497
590
|
onChange: function onChange() {
|
|
498
591
|
return true;
|
|
499
|
-
}
|
|
500
|
-
|
|
592
|
+
}
|
|
501
593
|
};
|
|
502
594
|
var _default = Upload;
|
|
503
595
|
exports["default"] = _default;
|