shineout 3.6.5-beta.5 → 3.6.5-beta.7
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/cjs/index.js +1 -1
- package/dist/shineout.js +59 -37
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +5 -5
package/cjs/index.js
CHANGED
|
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
514
514
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
515
515
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
516
516
|
var _default = exports.default = {
|
|
517
|
-
version: '3.6.5-beta.
|
|
517
|
+
version: '3.6.5-beta.7'
|
|
518
518
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12217,7 +12217,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12217
12217
|
};
|
|
12218
12218
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12219
12219
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12220
|
-
/* harmony default export */ var version = ('3.6.5-beta.
|
|
12220
|
+
/* harmony default export */ var version = ('3.6.5-beta.7');
|
|
12221
12221
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12222
12222
|
|
|
12223
12223
|
|
|
@@ -34961,11 +34961,11 @@ function useInputAble(props) {
|
|
|
34961
34961
|
context.delayChange = function () {
|
|
34962
34962
|
context.timer = null;
|
|
34963
34963
|
context.delayChange = null;
|
|
34964
|
-
onChange.apply(void 0, [
|
|
34964
|
+
onChange.apply(void 0, [vv].concat(other));
|
|
34965
34965
|
render();
|
|
34966
34966
|
};
|
|
34967
34967
|
if (!delay) {
|
|
34968
|
-
onChange.apply(void 0, [
|
|
34968
|
+
onChange.apply(void 0, [vv].concat(other));
|
|
34969
34969
|
} else {
|
|
34970
34970
|
if (context.timer) clearTimeout(context.timer);
|
|
34971
34971
|
context.timer = setTimeout(context.delayChange, delay);
|
|
@@ -66490,6 +66490,7 @@ function attrAccept(file, acceptedFiles) {
|
|
|
66490
66490
|
|
|
66491
66491
|
|
|
66492
66492
|
|
|
66493
|
+
|
|
66493
66494
|
var VALIDATORITEMS = [{
|
|
66494
66495
|
key: 'size',
|
|
66495
66496
|
param: function param(blob) {
|
|
@@ -66648,21 +66649,22 @@ var useUpload = function useUpload(props) {
|
|
|
66648
66649
|
responseType: props.responseType,
|
|
66649
66650
|
onStart: props.onStart,
|
|
66650
66651
|
onProgress: function onProgress(e, msg) {
|
|
66651
|
-
|
|
66652
|
+
var percent = typeof e.percent === 'number' ? e.percent : e.loaded / e.total * 100;
|
|
66653
|
+
if (throttle && percent !== 100) return;
|
|
66652
66654
|
throttle = true;
|
|
66653
66655
|
setTimeout(function () {
|
|
66654
66656
|
throttle = false;
|
|
66655
66657
|
}, 16);
|
|
66656
|
-
|
|
66657
|
-
|
|
66658
|
-
|
|
66659
|
-
|
|
66660
|
-
|
|
66661
|
-
|
|
66662
|
-
|
|
66663
|
-
|
|
66664
|
-
|
|
66665
|
-
}
|
|
66658
|
+
setFiles(function (files) {
|
|
66659
|
+
return utils_immer_produce(files, function (draft) {
|
|
66660
|
+
if (!draft[id]) return draft;
|
|
66661
|
+
draft[id].process = percent;
|
|
66662
|
+
if (msg) draft[id].message = msg;
|
|
66663
|
+
if (typeof props.onProgress === 'function') {
|
|
66664
|
+
props.onProgress(draft[id]);
|
|
66665
|
+
}
|
|
66666
|
+
});
|
|
66667
|
+
});
|
|
66666
66668
|
},
|
|
66667
66669
|
onLoad: function onLoad(xhr) {
|
|
66668
66670
|
if (!/^2|1223/.test("".concat(xhr.status))) {
|
|
@@ -66690,10 +66692,17 @@ var useUpload = function useUpload(props) {
|
|
|
66690
66692
|
delete draft[id];
|
|
66691
66693
|
});
|
|
66692
66694
|
});
|
|
66693
|
-
|
|
66694
|
-
|
|
66695
|
-
|
|
66696
|
-
|
|
66695
|
+
if (props.functionalOnChange) {
|
|
66696
|
+
// 回调型 setState不会丢值
|
|
66697
|
+
props.onChange(function (prev) {
|
|
66698
|
+
return [].concat(toConsumableArray_default()(prev || []), [result]);
|
|
66699
|
+
});
|
|
66700
|
+
} else {
|
|
66701
|
+
var latestValue = latestState.value;
|
|
66702
|
+
var newValue = toConsumableArray_default()(latestValue);
|
|
66703
|
+
newValue.push(result);
|
|
66704
|
+
props.onChange(newValue);
|
|
66705
|
+
}
|
|
66697
66706
|
}
|
|
66698
66707
|
},
|
|
66699
66708
|
onError: function onError(xhr) {
|
|
@@ -66811,48 +66820,60 @@ var useUpload = function useUpload(props) {
|
|
|
66811
66820
|
error = _context2.sent;
|
|
66812
66821
|
case 21:
|
|
66813
66822
|
if (!(error instanceof Error)) {
|
|
66814
|
-
_context2.next =
|
|
66823
|
+
_context2.next = 29;
|
|
66815
66824
|
break;
|
|
66816
66825
|
}
|
|
66817
66826
|
if (validatorHandle(error, blob)) {
|
|
66818
|
-
_context2.next =
|
|
66827
|
+
_context2.next = 25;
|
|
66819
66828
|
break;
|
|
66820
66829
|
}
|
|
66821
|
-
|
|
66822
|
-
|
|
66830
|
+
setFiles(function (prev) {
|
|
66831
|
+
return utils_immer_produce(prev, function (draft) {
|
|
66832
|
+
delete draft[id];
|
|
66833
|
+
});
|
|
66834
|
+
});
|
|
66823
66835
|
return _context2.abrupt("return", 0);
|
|
66824
|
-
case
|
|
66836
|
+
case 25:
|
|
66825
66837
|
fileRecord.message = error.message;
|
|
66826
66838
|
fileRecord.status = 3;
|
|
66827
|
-
setFiles(
|
|
66839
|
+
setFiles(function (prev) {
|
|
66840
|
+
return objectSpread2_default()(objectSpread2_default()({}, prev), {}, defineProperty_default()({}, id, fileRecord));
|
|
66841
|
+
});
|
|
66828
66842
|
return _context2.abrupt("return", 0);
|
|
66829
|
-
case
|
|
66843
|
+
case 29:
|
|
66830
66844
|
if (!props.beforeUpload) {
|
|
66831
|
-
_context2.next =
|
|
66845
|
+
_context2.next = 36;
|
|
66832
66846
|
break;
|
|
66833
66847
|
}
|
|
66834
66848
|
beforeUploadResult = props.beforeUpload(blob); // @ts-ignoreq
|
|
66835
66849
|
if (!(beforeUploadResult && beforeUploadResult.then)) {
|
|
66836
|
-
_context2.next =
|
|
66850
|
+
_context2.next = 34;
|
|
66837
66851
|
break;
|
|
66838
66852
|
}
|
|
66839
66853
|
props.beforeUpload(blob).then(function (args) {
|
|
66840
66854
|
if (args.status !== 'error') {
|
|
66841
66855
|
newFiles[id].xhr = uploadFile(id, blob, fileRecord.src);
|
|
66842
|
-
setFiles(
|
|
66856
|
+
setFiles(function (prev) {
|
|
66857
|
+
return objectSpread2_default()(objectSpread2_default()({}, prev), {}, defineProperty_default()({}, id, fileRecord));
|
|
66858
|
+
});
|
|
66843
66859
|
}
|
|
66844
66860
|
}).catch(function () {
|
|
66845
|
-
|
|
66846
|
-
|
|
66861
|
+
setFiles(function (prev) {
|
|
66862
|
+
return utils_immer_produce(prev, function (draft) {
|
|
66863
|
+
delete draft[id];
|
|
66864
|
+
});
|
|
66865
|
+
});
|
|
66847
66866
|
});
|
|
66848
66867
|
return _context2.abrupt("return", 0);
|
|
66849
|
-
case
|
|
66850
|
-
_context2.next =
|
|
66868
|
+
case 34:
|
|
66869
|
+
_context2.next = 38;
|
|
66851
66870
|
break;
|
|
66852
|
-
case
|
|
66871
|
+
case 36:
|
|
66853
66872
|
fileRecord.xhr = uploadFile(id, blob, fileRecord.src);
|
|
66854
|
-
setFiles(
|
|
66855
|
-
|
|
66873
|
+
setFiles(function (prev) {
|
|
66874
|
+
return objectSpread2_default()(objectSpread2_default()({}, prev), {}, defineProperty_default()({}, id, fileRecord));
|
|
66875
|
+
});
|
|
66876
|
+
case 38:
|
|
66856
66877
|
case "end":
|
|
66857
66878
|
return _context2.stop();
|
|
66858
66879
|
}
|
|
@@ -67250,7 +67271,8 @@ var Upload = function Upload(props0) {
|
|
|
67250
67271
|
invalidImage: getLocale(locale, 'invalidImage')
|
|
67251
67272
|
},
|
|
67252
67273
|
value: value,
|
|
67253
|
-
onChange: onChange
|
|
67274
|
+
onChange: onChange,
|
|
67275
|
+
functionalOnChange: props.functionalOnChange
|
|
67254
67276
|
})),
|
|
67255
67277
|
func = _useUpload.func,
|
|
67256
67278
|
files = _useUpload.files,
|
|
@@ -70034,7 +70056,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
70034
70056
|
|
|
70035
70057
|
|
|
70036
70058
|
/* harmony default export */ var src_0 = ({
|
|
70037
|
-
version: '3.6.5-beta.
|
|
70059
|
+
version: '3.6.5-beta.7'
|
|
70038
70060
|
});
|
|
70039
70061
|
}();
|
|
70040
70062
|
/******/ return __webpack_exports__;
|