bk-magic-vue 2.4.3 → 2.4.6
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/dist/bk-magic-vue.css +19 -23
- package/dist/bk-magic-vue.js +708 -19
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/lib/affix.js +5 -2
- package/lib/big-tree.js +9 -1
- package/lib/card.js +2 -0
- package/lib/cascade.js +7 -0
- package/lib/image-viewer.js +2 -2
- package/lib/image.js +2 -2
- package/lib/input.js +2 -0
- package/lib/loading.js +5 -2
- package/lib/pagination.js +10 -3
- package/lib/select.js +10 -3
- package/lib/slider.js +2 -0
- package/lib/table.js +17 -4
- package/lib/tag-input.js +5 -2
- package/lib/transfer.js +2 -0
- package/lib/ui/bk-magic-vue.css +19 -23
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/divider.css +0 -17
- package/lib/ui/divider.min.css +1 -1
- package/lib/ui/divider.min.css.map +1 -1
- package/lib/ui/image-viewer.css +14 -8
- package/lib/ui/image-viewer.min.css +1 -1
- package/lib/ui/image-viewer.min.css.map +1 -1
- package/lib/ui/pagination.css +1 -0
- package/lib/ui/pagination.min.css +1 -1
- package/lib/ui/pagination.min.css.map +1 -1
- package/lib/ui/table.css +6 -0
- package/lib/ui/table.min.css +1 -1
- package/lib/ui/table.min.css.map +1 -1
- package/lib/ui/zoom-image.css +1 -0
- package/lib/ui/zoom-image.min.css +1 -1
- package/lib/ui/zoom-image.min.css.map +1 -1
- package/lib/upload.js +1308 -20
- package/lib/version-detail.js +5 -2
- package/package.json +5 -4
package/lib/upload.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale'], factory) :
|
|
4
|
-
(global = global || self, factory(global.library = {}, global.locale));
|
|
5
|
-
}(this, function (exports, locale) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('bk-magic-vue/lib/locale'), require('spark-md5')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'bk-magic-vue/lib/locale', 'spark-md5'], factory) :
|
|
4
|
+
(global = global || self, factory(global.library = {}, global.locale, global.SparkMD5));
|
|
5
|
+
}(this, function (exports, locale, SparkMD5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var locale__default = 'default' in locale ? locale['default'] : locale;
|
|
8
|
+
SparkMD5 = SparkMD5 && SparkMD5.hasOwnProperty('default') ? SparkMD5['default'] : SparkMD5;
|
|
8
9
|
|
|
9
10
|
var ceil = Math.ceil;
|
|
10
11
|
var floor = Math.floor;
|
|
@@ -31,6 +32,8 @@
|
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
|
|
35
|
+
var _library = true;
|
|
36
|
+
|
|
34
37
|
function createCommonjsModule(fn, module) {
|
|
35
38
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
36
39
|
}
|
|
@@ -537,6 +540,42 @@
|
|
|
537
540
|
}, _typeof(obj);
|
|
538
541
|
}
|
|
539
542
|
|
|
543
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
544
|
+
try {
|
|
545
|
+
var info = gen[key](arg);
|
|
546
|
+
var value = info.value;
|
|
547
|
+
} catch (error) {
|
|
548
|
+
reject(error);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
if (info.done) {
|
|
553
|
+
resolve(value);
|
|
554
|
+
} else {
|
|
555
|
+
Promise.resolve(value).then(_next, _throw);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function _asyncToGenerator(fn) {
|
|
560
|
+
return function () {
|
|
561
|
+
var self = this,
|
|
562
|
+
args = arguments;
|
|
563
|
+
return new Promise(function (resolve, reject) {
|
|
564
|
+
var gen = fn.apply(self, args);
|
|
565
|
+
|
|
566
|
+
function _next(value) {
|
|
567
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function _throw(err) {
|
|
571
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
_next(undefined);
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
|
|
540
579
|
function _classCallCheck(instance, Constructor) {
|
|
541
580
|
if (!(instance instanceof Constructor)) {
|
|
542
581
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -614,6 +653,1054 @@
|
|
|
614
653
|
return target;
|
|
615
654
|
}
|
|
616
655
|
|
|
656
|
+
var runtime_1 = createCommonjsModule(function (module) {
|
|
657
|
+
var runtime = (function (exports) {
|
|
658
|
+
var Op = Object.prototype;
|
|
659
|
+
var hasOwn = Op.hasOwnProperty;
|
|
660
|
+
var undefined$1;
|
|
661
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
662
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
663
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
664
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
665
|
+
function define(obj, key, value) {
|
|
666
|
+
Object.defineProperty(obj, key, {
|
|
667
|
+
value: value,
|
|
668
|
+
enumerable: true,
|
|
669
|
+
configurable: true,
|
|
670
|
+
writable: true
|
|
671
|
+
});
|
|
672
|
+
return obj[key];
|
|
673
|
+
}
|
|
674
|
+
try {
|
|
675
|
+
define({}, "");
|
|
676
|
+
} catch (err) {
|
|
677
|
+
define = function(obj, key, value) {
|
|
678
|
+
return obj[key] = value;
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
682
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
683
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
684
|
+
var context = new Context(tryLocsList || []);
|
|
685
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
686
|
+
return generator;
|
|
687
|
+
}
|
|
688
|
+
exports.wrap = wrap;
|
|
689
|
+
function tryCatch(fn, obj, arg) {
|
|
690
|
+
try {
|
|
691
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
|
692
|
+
} catch (err) {
|
|
693
|
+
return { type: "throw", arg: err };
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
697
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
698
|
+
var GenStateExecuting = "executing";
|
|
699
|
+
var GenStateCompleted = "completed";
|
|
700
|
+
var ContinueSentinel = {};
|
|
701
|
+
function Generator() {}
|
|
702
|
+
function GeneratorFunction() {}
|
|
703
|
+
function GeneratorFunctionPrototype() {}
|
|
704
|
+
var IteratorPrototype = {};
|
|
705
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
706
|
+
return this;
|
|
707
|
+
});
|
|
708
|
+
var getProto = Object.getPrototypeOf;
|
|
709
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
710
|
+
if (NativeIteratorPrototype &&
|
|
711
|
+
NativeIteratorPrototype !== Op &&
|
|
712
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
713
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
714
|
+
}
|
|
715
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
|
716
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
|
717
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
718
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
719
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
720
|
+
GeneratorFunction.displayName = define(
|
|
721
|
+
GeneratorFunctionPrototype,
|
|
722
|
+
toStringTagSymbol,
|
|
723
|
+
"GeneratorFunction"
|
|
724
|
+
);
|
|
725
|
+
function defineIteratorMethods(prototype) {
|
|
726
|
+
["next", "throw", "return"].forEach(function(method) {
|
|
727
|
+
define(prototype, method, function(arg) {
|
|
728
|
+
return this._invoke(method, arg);
|
|
729
|
+
});
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
exports.isGeneratorFunction = function(genFun) {
|
|
733
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
734
|
+
return ctor
|
|
735
|
+
? ctor === GeneratorFunction ||
|
|
736
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
737
|
+
: false;
|
|
738
|
+
};
|
|
739
|
+
exports.mark = function(genFun) {
|
|
740
|
+
if (Object.setPrototypeOf) {
|
|
741
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
742
|
+
} else {
|
|
743
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
744
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
745
|
+
}
|
|
746
|
+
genFun.prototype = Object.create(Gp);
|
|
747
|
+
return genFun;
|
|
748
|
+
};
|
|
749
|
+
exports.awrap = function(arg) {
|
|
750
|
+
return { __await: arg };
|
|
751
|
+
};
|
|
752
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
753
|
+
function invoke(method, arg, resolve, reject) {
|
|
754
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
755
|
+
if (record.type === "throw") {
|
|
756
|
+
reject(record.arg);
|
|
757
|
+
} else {
|
|
758
|
+
var result = record.arg;
|
|
759
|
+
var value = result.value;
|
|
760
|
+
if (value &&
|
|
761
|
+
typeof value === "object" &&
|
|
762
|
+
hasOwn.call(value, "__await")) {
|
|
763
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
764
|
+
invoke("next", value, resolve, reject);
|
|
765
|
+
}, function(err) {
|
|
766
|
+
invoke("throw", err, resolve, reject);
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
770
|
+
result.value = unwrapped;
|
|
771
|
+
resolve(result);
|
|
772
|
+
}, function(error) {
|
|
773
|
+
return invoke("throw", error, resolve, reject);
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
var previousPromise;
|
|
778
|
+
function enqueue(method, arg) {
|
|
779
|
+
function callInvokeWithMethodAndArg() {
|
|
780
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
781
|
+
invoke(method, arg, resolve, reject);
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
return previousPromise =
|
|
785
|
+
previousPromise ? previousPromise.then(
|
|
786
|
+
callInvokeWithMethodAndArg,
|
|
787
|
+
callInvokeWithMethodAndArg
|
|
788
|
+
) : callInvokeWithMethodAndArg();
|
|
789
|
+
}
|
|
790
|
+
this._invoke = enqueue;
|
|
791
|
+
}
|
|
792
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
793
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
794
|
+
return this;
|
|
795
|
+
});
|
|
796
|
+
exports.AsyncIterator = AsyncIterator;
|
|
797
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
798
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
799
|
+
var iter = new AsyncIterator(
|
|
800
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
|
801
|
+
PromiseImpl
|
|
802
|
+
);
|
|
803
|
+
return exports.isGeneratorFunction(outerFn)
|
|
804
|
+
? iter
|
|
805
|
+
: iter.next().then(function(result) {
|
|
806
|
+
return result.done ? result.value : iter.next();
|
|
807
|
+
});
|
|
808
|
+
};
|
|
809
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
810
|
+
var state = GenStateSuspendedStart;
|
|
811
|
+
return function invoke(method, arg) {
|
|
812
|
+
if (state === GenStateExecuting) {
|
|
813
|
+
throw new Error("Generator is already running");
|
|
814
|
+
}
|
|
815
|
+
if (state === GenStateCompleted) {
|
|
816
|
+
if (method === "throw") {
|
|
817
|
+
throw arg;
|
|
818
|
+
}
|
|
819
|
+
return doneResult();
|
|
820
|
+
}
|
|
821
|
+
context.method = method;
|
|
822
|
+
context.arg = arg;
|
|
823
|
+
while (true) {
|
|
824
|
+
var delegate = context.delegate;
|
|
825
|
+
if (delegate) {
|
|
826
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
827
|
+
if (delegateResult) {
|
|
828
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
829
|
+
return delegateResult;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
if (context.method === "next") {
|
|
833
|
+
context.sent = context._sent = context.arg;
|
|
834
|
+
} else if (context.method === "throw") {
|
|
835
|
+
if (state === GenStateSuspendedStart) {
|
|
836
|
+
state = GenStateCompleted;
|
|
837
|
+
throw context.arg;
|
|
838
|
+
}
|
|
839
|
+
context.dispatchException(context.arg);
|
|
840
|
+
} else if (context.method === "return") {
|
|
841
|
+
context.abrupt("return", context.arg);
|
|
842
|
+
}
|
|
843
|
+
state = GenStateExecuting;
|
|
844
|
+
var record = tryCatch(innerFn, self, context);
|
|
845
|
+
if (record.type === "normal") {
|
|
846
|
+
state = context.done
|
|
847
|
+
? GenStateCompleted
|
|
848
|
+
: GenStateSuspendedYield;
|
|
849
|
+
if (record.arg === ContinueSentinel) {
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
return {
|
|
853
|
+
value: record.arg,
|
|
854
|
+
done: context.done
|
|
855
|
+
};
|
|
856
|
+
} else if (record.type === "throw") {
|
|
857
|
+
state = GenStateCompleted;
|
|
858
|
+
context.method = "throw";
|
|
859
|
+
context.arg = record.arg;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
865
|
+
var method = delegate.iterator[context.method];
|
|
866
|
+
if (method === undefined$1) {
|
|
867
|
+
context.delegate = null;
|
|
868
|
+
if (context.method === "throw") {
|
|
869
|
+
if (delegate.iterator["return"]) {
|
|
870
|
+
context.method = "return";
|
|
871
|
+
context.arg = undefined$1;
|
|
872
|
+
maybeInvokeDelegate(delegate, context);
|
|
873
|
+
if (context.method === "throw") {
|
|
874
|
+
return ContinueSentinel;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
context.method = "throw";
|
|
878
|
+
context.arg = new TypeError(
|
|
879
|
+
"The iterator does not provide a 'throw' method");
|
|
880
|
+
}
|
|
881
|
+
return ContinueSentinel;
|
|
882
|
+
}
|
|
883
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
884
|
+
if (record.type === "throw") {
|
|
885
|
+
context.method = "throw";
|
|
886
|
+
context.arg = record.arg;
|
|
887
|
+
context.delegate = null;
|
|
888
|
+
return ContinueSentinel;
|
|
889
|
+
}
|
|
890
|
+
var info = record.arg;
|
|
891
|
+
if (! info) {
|
|
892
|
+
context.method = "throw";
|
|
893
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
894
|
+
context.delegate = null;
|
|
895
|
+
return ContinueSentinel;
|
|
896
|
+
}
|
|
897
|
+
if (info.done) {
|
|
898
|
+
context[delegate.resultName] = info.value;
|
|
899
|
+
context.next = delegate.nextLoc;
|
|
900
|
+
if (context.method !== "return") {
|
|
901
|
+
context.method = "next";
|
|
902
|
+
context.arg = undefined$1;
|
|
903
|
+
}
|
|
904
|
+
} else {
|
|
905
|
+
return info;
|
|
906
|
+
}
|
|
907
|
+
context.delegate = null;
|
|
908
|
+
return ContinueSentinel;
|
|
909
|
+
}
|
|
910
|
+
defineIteratorMethods(Gp);
|
|
911
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
912
|
+
define(Gp, iteratorSymbol, function() {
|
|
913
|
+
return this;
|
|
914
|
+
});
|
|
915
|
+
define(Gp, "toString", function() {
|
|
916
|
+
return "[object Generator]";
|
|
917
|
+
});
|
|
918
|
+
function pushTryEntry(locs) {
|
|
919
|
+
var entry = { tryLoc: locs[0] };
|
|
920
|
+
if (1 in locs) {
|
|
921
|
+
entry.catchLoc = locs[1];
|
|
922
|
+
}
|
|
923
|
+
if (2 in locs) {
|
|
924
|
+
entry.finallyLoc = locs[2];
|
|
925
|
+
entry.afterLoc = locs[3];
|
|
926
|
+
}
|
|
927
|
+
this.tryEntries.push(entry);
|
|
928
|
+
}
|
|
929
|
+
function resetTryEntry(entry) {
|
|
930
|
+
var record = entry.completion || {};
|
|
931
|
+
record.type = "normal";
|
|
932
|
+
delete record.arg;
|
|
933
|
+
entry.completion = record;
|
|
934
|
+
}
|
|
935
|
+
function Context(tryLocsList) {
|
|
936
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
|
937
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
938
|
+
this.reset(true);
|
|
939
|
+
}
|
|
940
|
+
exports.keys = function(object) {
|
|
941
|
+
var keys = [];
|
|
942
|
+
for (var key in object) {
|
|
943
|
+
keys.push(key);
|
|
944
|
+
}
|
|
945
|
+
keys.reverse();
|
|
946
|
+
return function next() {
|
|
947
|
+
while (keys.length) {
|
|
948
|
+
var key = keys.pop();
|
|
949
|
+
if (key in object) {
|
|
950
|
+
next.value = key;
|
|
951
|
+
next.done = false;
|
|
952
|
+
return next;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
next.done = true;
|
|
956
|
+
return next;
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
function values(iterable) {
|
|
960
|
+
if (iterable) {
|
|
961
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
962
|
+
if (iteratorMethod) {
|
|
963
|
+
return iteratorMethod.call(iterable);
|
|
964
|
+
}
|
|
965
|
+
if (typeof iterable.next === "function") {
|
|
966
|
+
return iterable;
|
|
967
|
+
}
|
|
968
|
+
if (!isNaN(iterable.length)) {
|
|
969
|
+
var i = -1, next = function next() {
|
|
970
|
+
while (++i < iterable.length) {
|
|
971
|
+
if (hasOwn.call(iterable, i)) {
|
|
972
|
+
next.value = iterable[i];
|
|
973
|
+
next.done = false;
|
|
974
|
+
return next;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
next.value = undefined$1;
|
|
978
|
+
next.done = true;
|
|
979
|
+
return next;
|
|
980
|
+
};
|
|
981
|
+
return next.next = next;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return { next: doneResult };
|
|
985
|
+
}
|
|
986
|
+
exports.values = values;
|
|
987
|
+
function doneResult() {
|
|
988
|
+
return { value: undefined$1, done: true };
|
|
989
|
+
}
|
|
990
|
+
Context.prototype = {
|
|
991
|
+
constructor: Context,
|
|
992
|
+
reset: function(skipTempReset) {
|
|
993
|
+
this.prev = 0;
|
|
994
|
+
this.next = 0;
|
|
995
|
+
this.sent = this._sent = undefined$1;
|
|
996
|
+
this.done = false;
|
|
997
|
+
this.delegate = null;
|
|
998
|
+
this.method = "next";
|
|
999
|
+
this.arg = undefined$1;
|
|
1000
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
1001
|
+
if (!skipTempReset) {
|
|
1002
|
+
for (var name in this) {
|
|
1003
|
+
if (name.charAt(0) === "t" &&
|
|
1004
|
+
hasOwn.call(this, name) &&
|
|
1005
|
+
!isNaN(+name.slice(1))) {
|
|
1006
|
+
this[name] = undefined$1;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
stop: function() {
|
|
1012
|
+
this.done = true;
|
|
1013
|
+
var rootEntry = this.tryEntries[0];
|
|
1014
|
+
var rootRecord = rootEntry.completion;
|
|
1015
|
+
if (rootRecord.type === "throw") {
|
|
1016
|
+
throw rootRecord.arg;
|
|
1017
|
+
}
|
|
1018
|
+
return this.rval;
|
|
1019
|
+
},
|
|
1020
|
+
dispatchException: function(exception) {
|
|
1021
|
+
if (this.done) {
|
|
1022
|
+
throw exception;
|
|
1023
|
+
}
|
|
1024
|
+
var context = this;
|
|
1025
|
+
function handle(loc, caught) {
|
|
1026
|
+
record.type = "throw";
|
|
1027
|
+
record.arg = exception;
|
|
1028
|
+
context.next = loc;
|
|
1029
|
+
if (caught) {
|
|
1030
|
+
context.method = "next";
|
|
1031
|
+
context.arg = undefined$1;
|
|
1032
|
+
}
|
|
1033
|
+
return !! caught;
|
|
1034
|
+
}
|
|
1035
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1036
|
+
var entry = this.tryEntries[i];
|
|
1037
|
+
var record = entry.completion;
|
|
1038
|
+
if (entry.tryLoc === "root") {
|
|
1039
|
+
return handle("end");
|
|
1040
|
+
}
|
|
1041
|
+
if (entry.tryLoc <= this.prev) {
|
|
1042
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
1043
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1044
|
+
if (hasCatch && hasFinally) {
|
|
1045
|
+
if (this.prev < entry.catchLoc) {
|
|
1046
|
+
return handle(entry.catchLoc, true);
|
|
1047
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
1048
|
+
return handle(entry.finallyLoc);
|
|
1049
|
+
}
|
|
1050
|
+
} else if (hasCatch) {
|
|
1051
|
+
if (this.prev < entry.catchLoc) {
|
|
1052
|
+
return handle(entry.catchLoc, true);
|
|
1053
|
+
}
|
|
1054
|
+
} else if (hasFinally) {
|
|
1055
|
+
if (this.prev < entry.finallyLoc) {
|
|
1056
|
+
return handle(entry.finallyLoc);
|
|
1057
|
+
}
|
|
1058
|
+
} else {
|
|
1059
|
+
throw new Error("try statement without catch or finally");
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
abrupt: function(type, arg) {
|
|
1065
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1066
|
+
var entry = this.tryEntries[i];
|
|
1067
|
+
if (entry.tryLoc <= this.prev &&
|
|
1068
|
+
hasOwn.call(entry, "finallyLoc") &&
|
|
1069
|
+
this.prev < entry.finallyLoc) {
|
|
1070
|
+
var finallyEntry = entry;
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
if (finallyEntry &&
|
|
1075
|
+
(type === "break" ||
|
|
1076
|
+
type === "continue") &&
|
|
1077
|
+
finallyEntry.tryLoc <= arg &&
|
|
1078
|
+
arg <= finallyEntry.finallyLoc) {
|
|
1079
|
+
finallyEntry = null;
|
|
1080
|
+
}
|
|
1081
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
1082
|
+
record.type = type;
|
|
1083
|
+
record.arg = arg;
|
|
1084
|
+
if (finallyEntry) {
|
|
1085
|
+
this.method = "next";
|
|
1086
|
+
this.next = finallyEntry.finallyLoc;
|
|
1087
|
+
return ContinueSentinel;
|
|
1088
|
+
}
|
|
1089
|
+
return this.complete(record);
|
|
1090
|
+
},
|
|
1091
|
+
complete: function(record, afterLoc) {
|
|
1092
|
+
if (record.type === "throw") {
|
|
1093
|
+
throw record.arg;
|
|
1094
|
+
}
|
|
1095
|
+
if (record.type === "break" ||
|
|
1096
|
+
record.type === "continue") {
|
|
1097
|
+
this.next = record.arg;
|
|
1098
|
+
} else if (record.type === "return") {
|
|
1099
|
+
this.rval = this.arg = record.arg;
|
|
1100
|
+
this.method = "return";
|
|
1101
|
+
this.next = "end";
|
|
1102
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
1103
|
+
this.next = afterLoc;
|
|
1104
|
+
}
|
|
1105
|
+
return ContinueSentinel;
|
|
1106
|
+
},
|
|
1107
|
+
finish: function(finallyLoc) {
|
|
1108
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1109
|
+
var entry = this.tryEntries[i];
|
|
1110
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
1111
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
1112
|
+
resetTryEntry(entry);
|
|
1113
|
+
return ContinueSentinel;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
"catch": function(tryLoc) {
|
|
1118
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1119
|
+
var entry = this.tryEntries[i];
|
|
1120
|
+
if (entry.tryLoc === tryLoc) {
|
|
1121
|
+
var record = entry.completion;
|
|
1122
|
+
if (record.type === "throw") {
|
|
1123
|
+
var thrown = record.arg;
|
|
1124
|
+
resetTryEntry(entry);
|
|
1125
|
+
}
|
|
1126
|
+
return thrown;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
throw new Error("illegal catch attempt");
|
|
1130
|
+
},
|
|
1131
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
|
1132
|
+
this.delegate = {
|
|
1133
|
+
iterator: values(iterable),
|
|
1134
|
+
resultName: resultName,
|
|
1135
|
+
nextLoc: nextLoc
|
|
1136
|
+
};
|
|
1137
|
+
if (this.method === "next") {
|
|
1138
|
+
this.arg = undefined$1;
|
|
1139
|
+
}
|
|
1140
|
+
return ContinueSentinel;
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
return exports;
|
|
1144
|
+
}(
|
|
1145
|
+
module.exports
|
|
1146
|
+
));
|
|
1147
|
+
try {
|
|
1148
|
+
regeneratorRuntime = runtime;
|
|
1149
|
+
} catch (accidentalStrictMode) {
|
|
1150
|
+
if (typeof globalThis === "object") {
|
|
1151
|
+
globalThis.regeneratorRuntime = runtime;
|
|
1152
|
+
} else {
|
|
1153
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
});
|
|
1157
|
+
|
|
1158
|
+
var regenerator = runtime_1;
|
|
1159
|
+
|
|
1160
|
+
var $JSON = _core.JSON || (_core.JSON = { stringify: JSON.stringify });
|
|
1161
|
+
var stringify = function stringify(it) {
|
|
1162
|
+
return $JSON.stringify.apply($JSON, arguments);
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
var stringify$1 = stringify;
|
|
1166
|
+
|
|
1167
|
+
var _iterStep = function (done, value) {
|
|
1168
|
+
return { value: value, done: !!done };
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
|
|
1172
|
+
this._t = _toIobject(iterated);
|
|
1173
|
+
this._i = 0;
|
|
1174
|
+
this._k = kind;
|
|
1175
|
+
}, function () {
|
|
1176
|
+
var O = this._t;
|
|
1177
|
+
var kind = this._k;
|
|
1178
|
+
var index = this._i++;
|
|
1179
|
+
if (!O || index >= O.length) {
|
|
1180
|
+
this._t = undefined;
|
|
1181
|
+
return _iterStep(1);
|
|
1182
|
+
}
|
|
1183
|
+
if (kind == 'keys') return _iterStep(0, index);
|
|
1184
|
+
if (kind == 'values') return _iterStep(0, O[index]);
|
|
1185
|
+
return _iterStep(0, [index, O[index]]);
|
|
1186
|
+
}, 'values');
|
|
1187
|
+
_iterators.Arguments = _iterators.Array;
|
|
1188
|
+
|
|
1189
|
+
var TO_STRING_TAG = _wks('toStringTag');
|
|
1190
|
+
var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
|
|
1191
|
+
'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
|
|
1192
|
+
'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
|
|
1193
|
+
'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
|
|
1194
|
+
'TextTrackList,TouchList').split(',');
|
|
1195
|
+
for (var i = 0; i < DOMIterables.length; i++) {
|
|
1196
|
+
var NAME = DOMIterables[i];
|
|
1197
|
+
var Collection = _global[NAME];
|
|
1198
|
+
var proto = Collection && Collection.prototype;
|
|
1199
|
+
if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);
|
|
1200
|
+
_iterators[NAME] = _iterators.Array;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
var _anInstance = function (it, Constructor, name, forbiddenField) {
|
|
1204
|
+
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
|
|
1205
|
+
throw TypeError(name + ': incorrect invocation!');
|
|
1206
|
+
} return it;
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
var _forOf = createCommonjsModule(function (module) {
|
|
1210
|
+
var BREAK = {};
|
|
1211
|
+
var RETURN = {};
|
|
1212
|
+
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
|
|
1213
|
+
var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable);
|
|
1214
|
+
var f = _ctx(fn, that, entries ? 2 : 1);
|
|
1215
|
+
var index = 0;
|
|
1216
|
+
var length, step, iterator, result;
|
|
1217
|
+
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
|
|
1218
|
+
if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
|
|
1219
|
+
result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
|
|
1220
|
+
if (result === BREAK || result === RETURN) return result;
|
|
1221
|
+
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
|
|
1222
|
+
result = _iterCall(iterator, f, step.value, entries);
|
|
1223
|
+
if (result === BREAK || result === RETURN) return result;
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
exports.BREAK = BREAK;
|
|
1227
|
+
exports.RETURN = RETURN;
|
|
1228
|
+
});
|
|
1229
|
+
|
|
1230
|
+
var SPECIES = _wks('species');
|
|
1231
|
+
var _speciesConstructor = function (O, D) {
|
|
1232
|
+
var C = _anObject(O).constructor;
|
|
1233
|
+
var S;
|
|
1234
|
+
return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S);
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
var _invoke = function (fn, args, that) {
|
|
1238
|
+
var un = that === undefined;
|
|
1239
|
+
switch (args.length) {
|
|
1240
|
+
case 0: return un ? fn()
|
|
1241
|
+
: fn.call(that);
|
|
1242
|
+
case 1: return un ? fn(args[0])
|
|
1243
|
+
: fn.call(that, args[0]);
|
|
1244
|
+
case 2: return un ? fn(args[0], args[1])
|
|
1245
|
+
: fn.call(that, args[0], args[1]);
|
|
1246
|
+
case 3: return un ? fn(args[0], args[1], args[2])
|
|
1247
|
+
: fn.call(that, args[0], args[1], args[2]);
|
|
1248
|
+
case 4: return un ? fn(args[0], args[1], args[2], args[3])
|
|
1249
|
+
: fn.call(that, args[0], args[1], args[2], args[3]);
|
|
1250
|
+
} return fn.apply(that, args);
|
|
1251
|
+
};
|
|
1252
|
+
|
|
1253
|
+
var process = _global.process;
|
|
1254
|
+
var setTask = _global.setImmediate;
|
|
1255
|
+
var clearTask = _global.clearImmediate;
|
|
1256
|
+
var MessageChannel = _global.MessageChannel;
|
|
1257
|
+
var Dispatch = _global.Dispatch;
|
|
1258
|
+
var counter = 0;
|
|
1259
|
+
var queue = {};
|
|
1260
|
+
var ONREADYSTATECHANGE = 'onreadystatechange';
|
|
1261
|
+
var defer, channel, port;
|
|
1262
|
+
var run = function () {
|
|
1263
|
+
var id = +this;
|
|
1264
|
+
if (queue.hasOwnProperty(id)) {
|
|
1265
|
+
var fn = queue[id];
|
|
1266
|
+
delete queue[id];
|
|
1267
|
+
fn();
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
var listener = function (event) {
|
|
1271
|
+
run.call(event.data);
|
|
1272
|
+
};
|
|
1273
|
+
if (!setTask || !clearTask) {
|
|
1274
|
+
setTask = function setImmediate(fn) {
|
|
1275
|
+
var args = [];
|
|
1276
|
+
var i = 1;
|
|
1277
|
+
while (arguments.length > i) args.push(arguments[i++]);
|
|
1278
|
+
queue[++counter] = function () {
|
|
1279
|
+
_invoke(typeof fn == 'function' ? fn : Function(fn), args);
|
|
1280
|
+
};
|
|
1281
|
+
defer(counter);
|
|
1282
|
+
return counter;
|
|
1283
|
+
};
|
|
1284
|
+
clearTask = function clearImmediate(id) {
|
|
1285
|
+
delete queue[id];
|
|
1286
|
+
};
|
|
1287
|
+
if (_cof(process) == 'process') {
|
|
1288
|
+
defer = function (id) {
|
|
1289
|
+
process.nextTick(_ctx(run, id, 1));
|
|
1290
|
+
};
|
|
1291
|
+
} else if (Dispatch && Dispatch.now) {
|
|
1292
|
+
defer = function (id) {
|
|
1293
|
+
Dispatch.now(_ctx(run, id, 1));
|
|
1294
|
+
};
|
|
1295
|
+
} else if (MessageChannel) {
|
|
1296
|
+
channel = new MessageChannel();
|
|
1297
|
+
port = channel.port2;
|
|
1298
|
+
channel.port1.onmessage = listener;
|
|
1299
|
+
defer = _ctx(port.postMessage, port, 1);
|
|
1300
|
+
} else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) {
|
|
1301
|
+
defer = function (id) {
|
|
1302
|
+
_global.postMessage(id + '', '*');
|
|
1303
|
+
};
|
|
1304
|
+
_global.addEventListener('message', listener, false);
|
|
1305
|
+
} else if (ONREADYSTATECHANGE in _domCreate('script')) {
|
|
1306
|
+
defer = function (id) {
|
|
1307
|
+
_html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () {
|
|
1308
|
+
_html.removeChild(this);
|
|
1309
|
+
run.call(id);
|
|
1310
|
+
};
|
|
1311
|
+
};
|
|
1312
|
+
} else {
|
|
1313
|
+
defer = function (id) {
|
|
1314
|
+
setTimeout(_ctx(run, id, 1), 0);
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
var _task = {
|
|
1319
|
+
set: setTask,
|
|
1320
|
+
clear: clearTask
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
var macrotask = _task.set;
|
|
1324
|
+
var Observer = _global.MutationObserver || _global.WebKitMutationObserver;
|
|
1325
|
+
var process$1 = _global.process;
|
|
1326
|
+
var Promise$1 = _global.Promise;
|
|
1327
|
+
var isNode = _cof(process$1) == 'process';
|
|
1328
|
+
var _microtask = function () {
|
|
1329
|
+
var head, last, notify;
|
|
1330
|
+
var flush = function () {
|
|
1331
|
+
var parent, fn;
|
|
1332
|
+
if (isNode && (parent = process$1.domain)) parent.exit();
|
|
1333
|
+
while (head) {
|
|
1334
|
+
fn = head.fn;
|
|
1335
|
+
head = head.next;
|
|
1336
|
+
try {
|
|
1337
|
+
fn();
|
|
1338
|
+
} catch (e) {
|
|
1339
|
+
if (head) notify();
|
|
1340
|
+
else last = undefined;
|
|
1341
|
+
throw e;
|
|
1342
|
+
}
|
|
1343
|
+
} last = undefined;
|
|
1344
|
+
if (parent) parent.enter();
|
|
1345
|
+
};
|
|
1346
|
+
if (isNode) {
|
|
1347
|
+
notify = function () {
|
|
1348
|
+
process$1.nextTick(flush);
|
|
1349
|
+
};
|
|
1350
|
+
} else if (Observer && !(_global.navigator && _global.navigator.standalone)) {
|
|
1351
|
+
var toggle = true;
|
|
1352
|
+
var node = document.createTextNode('');
|
|
1353
|
+
new Observer(flush).observe(node, { characterData: true });
|
|
1354
|
+
notify = function () {
|
|
1355
|
+
node.data = toggle = !toggle;
|
|
1356
|
+
};
|
|
1357
|
+
} else if (Promise$1 && Promise$1.resolve) {
|
|
1358
|
+
var promise = Promise$1.resolve(undefined);
|
|
1359
|
+
notify = function () {
|
|
1360
|
+
promise.then(flush);
|
|
1361
|
+
};
|
|
1362
|
+
} else {
|
|
1363
|
+
notify = function () {
|
|
1364
|
+
macrotask.call(_global, flush);
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
return function (fn) {
|
|
1368
|
+
var task = { fn: fn, next: undefined };
|
|
1369
|
+
if (last) last.next = task;
|
|
1370
|
+
if (!head) {
|
|
1371
|
+
head = task;
|
|
1372
|
+
notify();
|
|
1373
|
+
} last = task;
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1377
|
+
function PromiseCapability(C) {
|
|
1378
|
+
var resolve, reject;
|
|
1379
|
+
this.promise = new C(function ($$resolve, $$reject) {
|
|
1380
|
+
if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
|
1381
|
+
resolve = $$resolve;
|
|
1382
|
+
reject = $$reject;
|
|
1383
|
+
});
|
|
1384
|
+
this.resolve = _aFunction(resolve);
|
|
1385
|
+
this.reject = _aFunction(reject);
|
|
1386
|
+
}
|
|
1387
|
+
var f$1 = function (C) {
|
|
1388
|
+
return new PromiseCapability(C);
|
|
1389
|
+
};
|
|
1390
|
+
var _newPromiseCapability = {
|
|
1391
|
+
f: f$1
|
|
1392
|
+
};
|
|
1393
|
+
|
|
1394
|
+
var _perform = function (exec) {
|
|
1395
|
+
try {
|
|
1396
|
+
return { e: false, v: exec() };
|
|
1397
|
+
} catch (e) {
|
|
1398
|
+
return { e: true, v: e };
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
var navigator$1 = _global.navigator;
|
|
1403
|
+
var _userAgent = navigator$1 && navigator$1.userAgent || '';
|
|
1404
|
+
|
|
1405
|
+
var _promiseResolve = function (C, x) {
|
|
1406
|
+
_anObject(C);
|
|
1407
|
+
if (_isObject(x) && x.constructor === C) return x;
|
|
1408
|
+
var promiseCapability = _newPromiseCapability.f(C);
|
|
1409
|
+
var resolve = promiseCapability.resolve;
|
|
1410
|
+
resolve(x);
|
|
1411
|
+
return promiseCapability.promise;
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
var _redefineAll = function (target, src, safe) {
|
|
1415
|
+
for (var key in src) {
|
|
1416
|
+
if (safe && target[key]) target[key] = src[key];
|
|
1417
|
+
else _hide(target, key, src[key]);
|
|
1418
|
+
} return target;
|
|
1419
|
+
};
|
|
1420
|
+
|
|
1421
|
+
var SPECIES$1 = _wks('species');
|
|
1422
|
+
var _setSpecies = function (KEY) {
|
|
1423
|
+
var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY];
|
|
1424
|
+
if (_descriptors && C && !C[SPECIES$1]) _objectDp.f(C, SPECIES$1, {
|
|
1425
|
+
configurable: true,
|
|
1426
|
+
get: function () { return this; }
|
|
1427
|
+
});
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
var task = _task.set;
|
|
1431
|
+
var microtask = _microtask();
|
|
1432
|
+
var PROMISE = 'Promise';
|
|
1433
|
+
var TypeError$1 = _global.TypeError;
|
|
1434
|
+
var process$2 = _global.process;
|
|
1435
|
+
var versions = process$2 && process$2.versions;
|
|
1436
|
+
var v8 = versions && versions.v8 || '';
|
|
1437
|
+
var $Promise = _global[PROMISE];
|
|
1438
|
+
var isNode$1 = _classof(process$2) == 'process';
|
|
1439
|
+
var empty = function () { };
|
|
1440
|
+
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
|
|
1441
|
+
var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f;
|
|
1442
|
+
var USE_NATIVE = !!function () {
|
|
1443
|
+
try {
|
|
1444
|
+
var promise = $Promise.resolve(1);
|
|
1445
|
+
var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) {
|
|
1446
|
+
exec(empty, empty);
|
|
1447
|
+
};
|
|
1448
|
+
return (isNode$1 || typeof PromiseRejectionEvent == 'function')
|
|
1449
|
+
&& promise.then(empty) instanceof FakePromise
|
|
1450
|
+
&& v8.indexOf('6.6') !== 0
|
|
1451
|
+
&& _userAgent.indexOf('Chrome/66') === -1;
|
|
1452
|
+
} catch (e) { }
|
|
1453
|
+
}();
|
|
1454
|
+
var isThenable = function (it) {
|
|
1455
|
+
var then;
|
|
1456
|
+
return _isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
|
1457
|
+
};
|
|
1458
|
+
var notify = function (promise, isReject) {
|
|
1459
|
+
if (promise._n) return;
|
|
1460
|
+
promise._n = true;
|
|
1461
|
+
var chain = promise._c;
|
|
1462
|
+
microtask(function () {
|
|
1463
|
+
var value = promise._v;
|
|
1464
|
+
var ok = promise._s == 1;
|
|
1465
|
+
var i = 0;
|
|
1466
|
+
var run = function (reaction) {
|
|
1467
|
+
var handler = ok ? reaction.ok : reaction.fail;
|
|
1468
|
+
var resolve = reaction.resolve;
|
|
1469
|
+
var reject = reaction.reject;
|
|
1470
|
+
var domain = reaction.domain;
|
|
1471
|
+
var result, then, exited;
|
|
1472
|
+
try {
|
|
1473
|
+
if (handler) {
|
|
1474
|
+
if (!ok) {
|
|
1475
|
+
if (promise._h == 2) onHandleUnhandled(promise);
|
|
1476
|
+
promise._h = 1;
|
|
1477
|
+
}
|
|
1478
|
+
if (handler === true) result = value;
|
|
1479
|
+
else {
|
|
1480
|
+
if (domain) domain.enter();
|
|
1481
|
+
result = handler(value);
|
|
1482
|
+
if (domain) {
|
|
1483
|
+
domain.exit();
|
|
1484
|
+
exited = true;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
if (result === reaction.promise) {
|
|
1488
|
+
reject(TypeError$1('Promise-chain cycle'));
|
|
1489
|
+
} else if (then = isThenable(result)) {
|
|
1490
|
+
then.call(result, resolve, reject);
|
|
1491
|
+
} else resolve(result);
|
|
1492
|
+
} else reject(value);
|
|
1493
|
+
} catch (e) {
|
|
1494
|
+
if (domain && !exited) domain.exit();
|
|
1495
|
+
reject(e);
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
while (chain.length > i) run(chain[i++]);
|
|
1499
|
+
promise._c = [];
|
|
1500
|
+
promise._n = false;
|
|
1501
|
+
if (isReject && !promise._h) onUnhandled(promise);
|
|
1502
|
+
});
|
|
1503
|
+
};
|
|
1504
|
+
var onUnhandled = function (promise) {
|
|
1505
|
+
task.call(_global, function () {
|
|
1506
|
+
var value = promise._v;
|
|
1507
|
+
var unhandled = isUnhandled(promise);
|
|
1508
|
+
var result, handler, console;
|
|
1509
|
+
if (unhandled) {
|
|
1510
|
+
result = _perform(function () {
|
|
1511
|
+
if (isNode$1) {
|
|
1512
|
+
process$2.emit('unhandledRejection', value, promise);
|
|
1513
|
+
} else if (handler = _global.onunhandledrejection) {
|
|
1514
|
+
handler({ promise: promise, reason: value });
|
|
1515
|
+
} else if ((console = _global.console) && console.error) {
|
|
1516
|
+
console.error('Unhandled promise rejection', value);
|
|
1517
|
+
}
|
|
1518
|
+
});
|
|
1519
|
+
promise._h = isNode$1 || isUnhandled(promise) ? 2 : 1;
|
|
1520
|
+
} promise._a = undefined;
|
|
1521
|
+
if (unhandled && result.e) throw result.v;
|
|
1522
|
+
});
|
|
1523
|
+
};
|
|
1524
|
+
var isUnhandled = function (promise) {
|
|
1525
|
+
return promise._h !== 1 && (promise._a || promise._c).length === 0;
|
|
1526
|
+
};
|
|
1527
|
+
var onHandleUnhandled = function (promise) {
|
|
1528
|
+
task.call(_global, function () {
|
|
1529
|
+
var handler;
|
|
1530
|
+
if (isNode$1) {
|
|
1531
|
+
process$2.emit('rejectionHandled', promise);
|
|
1532
|
+
} else if (handler = _global.onrejectionhandled) {
|
|
1533
|
+
handler({ promise: promise, reason: promise._v });
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
};
|
|
1537
|
+
var $reject = function (value) {
|
|
1538
|
+
var promise = this;
|
|
1539
|
+
if (promise._d) return;
|
|
1540
|
+
promise._d = true;
|
|
1541
|
+
promise = promise._w || promise;
|
|
1542
|
+
promise._v = value;
|
|
1543
|
+
promise._s = 2;
|
|
1544
|
+
if (!promise._a) promise._a = promise._c.slice();
|
|
1545
|
+
notify(promise, true);
|
|
1546
|
+
};
|
|
1547
|
+
var $resolve = function (value) {
|
|
1548
|
+
var promise = this;
|
|
1549
|
+
var then;
|
|
1550
|
+
if (promise._d) return;
|
|
1551
|
+
promise._d = true;
|
|
1552
|
+
promise = promise._w || promise;
|
|
1553
|
+
try {
|
|
1554
|
+
if (promise === value) throw TypeError$1("Promise can't be resolved itself");
|
|
1555
|
+
if (then = isThenable(value)) {
|
|
1556
|
+
microtask(function () {
|
|
1557
|
+
var wrapper = { _w: promise, _d: false };
|
|
1558
|
+
try {
|
|
1559
|
+
then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1));
|
|
1560
|
+
} catch (e) {
|
|
1561
|
+
$reject.call(wrapper, e);
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
} else {
|
|
1565
|
+
promise._v = value;
|
|
1566
|
+
promise._s = 1;
|
|
1567
|
+
notify(promise, false);
|
|
1568
|
+
}
|
|
1569
|
+
} catch (e) {
|
|
1570
|
+
$reject.call({ _w: promise, _d: false }, e);
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
if (!USE_NATIVE) {
|
|
1574
|
+
$Promise = function Promise(executor) {
|
|
1575
|
+
_anInstance(this, $Promise, PROMISE, '_h');
|
|
1576
|
+
_aFunction(executor);
|
|
1577
|
+
Internal.call(this);
|
|
1578
|
+
try {
|
|
1579
|
+
executor(_ctx($resolve, this, 1), _ctx($reject, this, 1));
|
|
1580
|
+
} catch (err) {
|
|
1581
|
+
$reject.call(this, err);
|
|
1582
|
+
}
|
|
1583
|
+
};
|
|
1584
|
+
Internal = function Promise(executor) {
|
|
1585
|
+
this._c = [];
|
|
1586
|
+
this._a = undefined;
|
|
1587
|
+
this._s = 0;
|
|
1588
|
+
this._d = false;
|
|
1589
|
+
this._v = undefined;
|
|
1590
|
+
this._h = 0;
|
|
1591
|
+
this._n = false;
|
|
1592
|
+
};
|
|
1593
|
+
Internal.prototype = _redefineAll($Promise.prototype, {
|
|
1594
|
+
then: function then(onFulfilled, onRejected) {
|
|
1595
|
+
var reaction = newPromiseCapability(_speciesConstructor(this, $Promise));
|
|
1596
|
+
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
|
1597
|
+
reaction.fail = typeof onRejected == 'function' && onRejected;
|
|
1598
|
+
reaction.domain = isNode$1 ? process$2.domain : undefined;
|
|
1599
|
+
this._c.push(reaction);
|
|
1600
|
+
if (this._a) this._a.push(reaction);
|
|
1601
|
+
if (this._s) notify(this, false);
|
|
1602
|
+
return reaction.promise;
|
|
1603
|
+
},
|
|
1604
|
+
'catch': function (onRejected) {
|
|
1605
|
+
return this.then(undefined, onRejected);
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
OwnPromiseCapability = function () {
|
|
1609
|
+
var promise = new Internal();
|
|
1610
|
+
this.promise = promise;
|
|
1611
|
+
this.resolve = _ctx($resolve, promise, 1);
|
|
1612
|
+
this.reject = _ctx($reject, promise, 1);
|
|
1613
|
+
};
|
|
1614
|
+
_newPromiseCapability.f = newPromiseCapability = function (C) {
|
|
1615
|
+
return C === $Promise || C === Wrapper
|
|
1616
|
+
? new OwnPromiseCapability(C)
|
|
1617
|
+
: newGenericPromiseCapability(C);
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
_export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise });
|
|
1621
|
+
_setToStringTag($Promise, PROMISE);
|
|
1622
|
+
_setSpecies(PROMISE);
|
|
1623
|
+
Wrapper = _core[PROMISE];
|
|
1624
|
+
_export(_export.S + _export.F * !USE_NATIVE, PROMISE, {
|
|
1625
|
+
reject: function reject(r) {
|
|
1626
|
+
var capability = newPromiseCapability(this);
|
|
1627
|
+
var $$reject = capability.reject;
|
|
1628
|
+
$$reject(r);
|
|
1629
|
+
return capability.promise;
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1632
|
+
_export(_export.S + _export.F * (_library ), PROMISE, {
|
|
1633
|
+
resolve: function resolve(x) {
|
|
1634
|
+
return _promiseResolve( this === Wrapper ? $Promise : this, x);
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
_export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) {
|
|
1638
|
+
$Promise.all(iter)['catch'](empty);
|
|
1639
|
+
})), PROMISE, {
|
|
1640
|
+
all: function all(iterable) {
|
|
1641
|
+
var C = this;
|
|
1642
|
+
var capability = newPromiseCapability(C);
|
|
1643
|
+
var resolve = capability.resolve;
|
|
1644
|
+
var reject = capability.reject;
|
|
1645
|
+
var result = _perform(function () {
|
|
1646
|
+
var values = [];
|
|
1647
|
+
var index = 0;
|
|
1648
|
+
var remaining = 1;
|
|
1649
|
+
_forOf(iterable, false, function (promise) {
|
|
1650
|
+
var $index = index++;
|
|
1651
|
+
var alreadyCalled = false;
|
|
1652
|
+
values.push(undefined);
|
|
1653
|
+
remaining++;
|
|
1654
|
+
C.resolve(promise).then(function (value) {
|
|
1655
|
+
if (alreadyCalled) return;
|
|
1656
|
+
alreadyCalled = true;
|
|
1657
|
+
values[$index] = value;
|
|
1658
|
+
--remaining || resolve(values);
|
|
1659
|
+
}, reject);
|
|
1660
|
+
});
|
|
1661
|
+
--remaining || resolve(values);
|
|
1662
|
+
});
|
|
1663
|
+
if (result.e) reject(result.v);
|
|
1664
|
+
return capability.promise;
|
|
1665
|
+
},
|
|
1666
|
+
race: function race(iterable) {
|
|
1667
|
+
var C = this;
|
|
1668
|
+
var capability = newPromiseCapability(C);
|
|
1669
|
+
var reject = capability.reject;
|
|
1670
|
+
var result = _perform(function () {
|
|
1671
|
+
_forOf(iterable, false, function (promise) {
|
|
1672
|
+
C.resolve(promise).then(capability.resolve, reject);
|
|
1673
|
+
});
|
|
1674
|
+
});
|
|
1675
|
+
if (result.e) reject(result.v);
|
|
1676
|
+
return capability.promise;
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
|
|
1680
|
+
_export(_export.P + _export.R, 'Promise', { 'finally': function (onFinally) {
|
|
1681
|
+
var C = _speciesConstructor(this, _core.Promise || _global.Promise);
|
|
1682
|
+
var isFunction = typeof onFinally == 'function';
|
|
1683
|
+
return this.then(
|
|
1684
|
+
isFunction ? function (x) {
|
|
1685
|
+
return _promiseResolve(C, onFinally()).then(function () { return x; });
|
|
1686
|
+
} : onFinally,
|
|
1687
|
+
isFunction ? function (e) {
|
|
1688
|
+
return _promiseResolve(C, onFinally()).then(function () { throw e; });
|
|
1689
|
+
} : onFinally
|
|
1690
|
+
);
|
|
1691
|
+
} });
|
|
1692
|
+
|
|
1693
|
+
_export(_export.S, 'Promise', { 'try': function (callbackfn) {
|
|
1694
|
+
var promiseCapability = _newPromiseCapability.f(this);
|
|
1695
|
+
var result = _perform(callbackfn);
|
|
1696
|
+
(result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
|
|
1697
|
+
return promiseCapability.promise;
|
|
1698
|
+
} });
|
|
1699
|
+
|
|
1700
|
+
var promise = _core.Promise;
|
|
1701
|
+
|
|
1702
|
+
var promise$1 = promise;
|
|
1703
|
+
|
|
617
1704
|
var _isArray = Array.isArray || function isArray(arg) {
|
|
618
1705
|
return _cof(arg) == 'Array';
|
|
619
1706
|
};
|
|
@@ -624,6 +1711,7 @@
|
|
|
624
1711
|
|
|
625
1712
|
var isArray$1 = isArray;
|
|
626
1713
|
|
|
1714
|
+
var _this = undefined;
|
|
627
1715
|
var parseResponse = function parseResponse(response) {
|
|
628
1716
|
if (!response) {
|
|
629
1717
|
return response || {};
|
|
@@ -634,7 +1722,7 @@
|
|
|
634
1722
|
return response || {};
|
|
635
1723
|
}
|
|
636
1724
|
};
|
|
637
|
-
function
|
|
1725
|
+
var defaultRequest = function defaultRequest(options) {
|
|
638
1726
|
var xhr = new XMLHttpRequest();
|
|
639
1727
|
options.fileObj.xhr = xhr;
|
|
640
1728
|
var formData = new FormData();
|
|
@@ -677,7 +1765,166 @@
|
|
|
677
1765
|
xhr.abort();
|
|
678
1766
|
}
|
|
679
1767
|
};
|
|
680
|
-
}
|
|
1768
|
+
};
|
|
1769
|
+
var blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
|
|
1770
|
+
var sliceRequest = function () {
|
|
1771
|
+
var _ref = _asyncToGenerator( regenerator.mark(function _callee(options) {
|
|
1772
|
+
var chunkSize, file, blockCount, hash, progressList;
|
|
1773
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1774
|
+
while (1) {
|
|
1775
|
+
switch (_context.prev = _context.next) {
|
|
1776
|
+
case 0:
|
|
1777
|
+
chunkSize = options.chunkSize * 1024 * 1024;
|
|
1778
|
+
file = options.fileObj.origin;
|
|
1779
|
+
if (file) {
|
|
1780
|
+
_context.next = 5;
|
|
1781
|
+
break;
|
|
1782
|
+
}
|
|
1783
|
+
_this.$bkMessage({
|
|
1784
|
+
theme: 'warning',
|
|
1785
|
+
message: '没有获取到文件',
|
|
1786
|
+
offsetY: 80
|
|
1787
|
+
});
|
|
1788
|
+
return _context.abrupt("return");
|
|
1789
|
+
case 5:
|
|
1790
|
+
blockCount = Math.ceil(file.size / chunkSize);
|
|
1791
|
+
_context.next = 8;
|
|
1792
|
+
return hashFile(file, chunkSize);
|
|
1793
|
+
case 8:
|
|
1794
|
+
hash = _context.sent;
|
|
1795
|
+
progressList = [];
|
|
1796
|
+
sliceUpload(options, file, blockCount, hash, progressList, chunkSize);
|
|
1797
|
+
_context.next = 13;
|
|
1798
|
+
return promise$1.all(progressList).then(function () {
|
|
1799
|
+
var data = {
|
|
1800
|
+
size: file.size,
|
|
1801
|
+
name: file.name,
|
|
1802
|
+
total: blockCount,
|
|
1803
|
+
hash: hash
|
|
1804
|
+
};
|
|
1805
|
+
var req = new XMLHttpRequest();
|
|
1806
|
+
req.open(options.method, options.mergeUrl, true);
|
|
1807
|
+
req.onreadystatechange = function () {
|
|
1808
|
+
if (req.readyState === 4) {
|
|
1809
|
+
var reponseText = parseResponse(req.responseText || req.response);
|
|
1810
|
+
if (req.status < 200 || req.status >= 300) {
|
|
1811
|
+
options.fileObj.progress = 100 + '%';
|
|
1812
|
+
options.fileObj.errorMsg = reponseText.message || locale.t('bk.uploadFile.uploadFailed');
|
|
1813
|
+
options.onError(options.fileObj, options.fileList, req.response);
|
|
1814
|
+
} else {
|
|
1815
|
+
options.onSuccess(reponseText, options.fileObj);
|
|
1816
|
+
}
|
|
1817
|
+
options.onDone(options.fileObj);
|
|
1818
|
+
}
|
|
1819
|
+
};
|
|
1820
|
+
req.setRequestHeader('Content-type', 'application/JSON');
|
|
1821
|
+
req.send(stringify$1(data));
|
|
1822
|
+
});
|
|
1823
|
+
case 13:
|
|
1824
|
+
case "end":
|
|
1825
|
+
return _context.stop();
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
}, _callee);
|
|
1829
|
+
}));
|
|
1830
|
+
return function sliceRequest(_x) {
|
|
1831
|
+
return _ref.apply(this, arguments);
|
|
1832
|
+
};
|
|
1833
|
+
}();
|
|
1834
|
+
var sliceUpload = function sliceUpload(options, file, blockCount, hash, progressList, chunkSize) {
|
|
1835
|
+
var _loop = function _loop(i) {
|
|
1836
|
+
var pooltask = new promise$1(function (resolve, reject) {
|
|
1837
|
+
var start = i * chunkSize;
|
|
1838
|
+
var end = Math.min(file.size, start + chunkSize);
|
|
1839
|
+
var formData = new FormData();
|
|
1840
|
+
options.data.forEach(function (item) {
|
|
1841
|
+
formData.append(item.name, item.value);
|
|
1842
|
+
});
|
|
1843
|
+
formData.append('file', blobSlice.call(file, start, end));
|
|
1844
|
+
formData.append('name', file.name);
|
|
1845
|
+
formData.append('total', blockCount);
|
|
1846
|
+
formData.append('index', i);
|
|
1847
|
+
formData.append('size', file.size);
|
|
1848
|
+
formData.append('hash', hash);
|
|
1849
|
+
var xhr = new XMLHttpRequest();
|
|
1850
|
+
options.fileObj.xhr = xhr;
|
|
1851
|
+
xhr.onreadystatechange = function () {
|
|
1852
|
+
if (xhr.readyState === 4) {
|
|
1853
|
+
var reponseText = parseResponse(xhr.responseText || xhr.response);
|
|
1854
|
+
if (xhr.status < 200 || xhr.status >= 300) {
|
|
1855
|
+
reject(xhr.response);
|
|
1856
|
+
options.fileObj.progress = 100 + '%';
|
|
1857
|
+
options.fileObj.errorMsg = reponseText.message || locale.t('bk.uploadFile.uploadFailed');
|
|
1858
|
+
options.onError(options.fileObj, options.fileList, xhr.response);
|
|
1859
|
+
} else {
|
|
1860
|
+
resolve('reponseText');
|
|
1861
|
+
}
|
|
1862
|
+
options.onDone(options.fileObj);
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
xhr.upload.addEventListener('progress', function (e) {
|
|
1866
|
+
return options.onProgress(e, i);
|
|
1867
|
+
}, false);
|
|
1868
|
+
xhr.withCredentials = options.withCredentials;
|
|
1869
|
+
xhr.open(options.method, options.sliceUrl, true);
|
|
1870
|
+
if (options.header) {
|
|
1871
|
+
if (isArray$1(options.header)) {
|
|
1872
|
+
options.header.forEach(function (head) {
|
|
1873
|
+
var headerKey = head.name;
|
|
1874
|
+
var headerVal = head.value;
|
|
1875
|
+
xhr.setRequestHeader(headerKey, headerVal);
|
|
1876
|
+
});
|
|
1877
|
+
} else {
|
|
1878
|
+
var headerKey = options.header.name;
|
|
1879
|
+
var headerVal = options.header.value;
|
|
1880
|
+
xhr.setRequestHeader(headerKey, headerVal);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
xhr.send(formData);
|
|
1884
|
+
});
|
|
1885
|
+
progressList.push(pooltask);
|
|
1886
|
+
};
|
|
1887
|
+
for (var i = 0; i < blockCount; i++) {
|
|
1888
|
+
_loop(i);
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
var hashFile = function hashFile(file, chunkSize) {
|
|
1892
|
+
return new promise$1(function (resolve, reject) {
|
|
1893
|
+
var chunks = Math.ceil(file.size / chunkSize);
|
|
1894
|
+
var currentChunk = 0;
|
|
1895
|
+
var spark = new SparkMD5.ArrayBuffer();
|
|
1896
|
+
var fileReader = new FileReader();
|
|
1897
|
+
function loadNext() {
|
|
1898
|
+
var start = currentChunk * chunkSize;
|
|
1899
|
+
var end = start + chunkSize >= file.size ? file.size : start + chunkSize;
|
|
1900
|
+
fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
|
|
1901
|
+
}
|
|
1902
|
+
fileReader.onload = function (e) {
|
|
1903
|
+
spark.append(e.target.result);
|
|
1904
|
+
currentChunk += 1;
|
|
1905
|
+
if (currentChunk < chunks) {
|
|
1906
|
+
loadNext();
|
|
1907
|
+
} else {
|
|
1908
|
+
var result = spark.end();
|
|
1909
|
+
var sparkMd5 = new SparkMD5();
|
|
1910
|
+
sparkMd5.append(result);
|
|
1911
|
+
sparkMd5.append(file.name);
|
|
1912
|
+
var hexHash = sparkMd5.end();
|
|
1913
|
+
resolve(hexHash);
|
|
1914
|
+
}
|
|
1915
|
+
};
|
|
1916
|
+
fileReader.onerror = function () {
|
|
1917
|
+
_this.$bkMessage({
|
|
1918
|
+
theme: 'warning',
|
|
1919
|
+
message: '文件分片失败',
|
|
1920
|
+
offsetY: 80
|
|
1921
|
+
});
|
|
1922
|
+
};
|
|
1923
|
+
loadNext();
|
|
1924
|
+
}).catch(function (err) {
|
|
1925
|
+
console.log(err);
|
|
1926
|
+
});
|
|
1927
|
+
};
|
|
681
1928
|
|
|
682
1929
|
var _stringWs = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
|
|
683
1930
|
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
@@ -791,14 +2038,14 @@
|
|
|
791
2038
|
|
|
792
2039
|
var keys$1 = keys;
|
|
793
2040
|
|
|
794
|
-
var f$
|
|
2041
|
+
var f$2 = Object.getOwnPropertySymbols;
|
|
795
2042
|
var _objectGops = {
|
|
796
|
-
f: f$
|
|
2043
|
+
f: f$2
|
|
797
2044
|
};
|
|
798
2045
|
|
|
799
|
-
var f$
|
|
2046
|
+
var f$3 = {}.propertyIsEnumerable;
|
|
800
2047
|
var _objectPie = {
|
|
801
|
-
f: f$
|
|
2048
|
+
f: f$3
|
|
802
2049
|
};
|
|
803
2050
|
|
|
804
2051
|
var $assign = Object.assign;
|
|
@@ -838,8 +2085,8 @@
|
|
|
838
2085
|
var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
839
2086
|
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
|
|
840
2087
|
var timeoutDuration = 0;
|
|
841
|
-
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
|
842
|
-
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
|
2088
|
+
for (var i$1 = 0; i$1 < longerTimeoutBrowsers.length; i$1 += 1) {
|
|
2089
|
+
if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i$1]) >= 0) {
|
|
843
2090
|
timeoutDuration = 1;
|
|
844
2091
|
break;
|
|
845
2092
|
}
|
|
@@ -3405,7 +4652,7 @@
|
|
|
3405
4652
|
default: 0
|
|
3406
4653
|
},
|
|
3407
4654
|
url: {
|
|
3408
|
-
required:
|
|
4655
|
+
required: false,
|
|
3409
4656
|
type: String
|
|
3410
4657
|
},
|
|
3411
4658
|
size: {
|
|
@@ -3449,7 +4696,23 @@
|
|
|
3449
4696
|
type: String,
|
|
3450
4697
|
default: ''
|
|
3451
4698
|
},
|
|
3452
|
-
customRequest: Function
|
|
4699
|
+
customRequest: Function,
|
|
4700
|
+
sliceUpload: {
|
|
4701
|
+
type: Boolean,
|
|
4702
|
+
default: false
|
|
4703
|
+
},
|
|
4704
|
+
sliceUrl: {
|
|
4705
|
+
type: String,
|
|
4706
|
+
default: ''
|
|
4707
|
+
},
|
|
4708
|
+
mergeUrl: {
|
|
4709
|
+
type: String,
|
|
4710
|
+
default: ''
|
|
4711
|
+
},
|
|
4712
|
+
chunkSize: {
|
|
4713
|
+
type: Number,
|
|
4714
|
+
default: 10
|
|
4715
|
+
}
|
|
3453
4716
|
},
|
|
3454
4717
|
data: function data() {
|
|
3455
4718
|
return {
|
|
@@ -3596,6 +4859,9 @@
|
|
|
3596
4859
|
fileHeader: '',
|
|
3597
4860
|
origin: file,
|
|
3598
4861
|
url: '',
|
|
4862
|
+
sliceUrl: '',
|
|
4863
|
+
mergeUrl: '',
|
|
4864
|
+
chunkSize: 10,
|
|
3599
4865
|
base64: '',
|
|
3600
4866
|
status: '',
|
|
3601
4867
|
done: false,
|
|
@@ -3662,9 +4928,10 @@
|
|
|
3662
4928
|
this.$emit('on-error', fileObj, this.fileList);
|
|
3663
4929
|
return;
|
|
3664
4930
|
}
|
|
3665
|
-
var
|
|
3666
|
-
|
|
3667
|
-
|
|
4931
|
+
var progressList = [];
|
|
4932
|
+
var uploadProgress = function uploadProgress(e, val) {
|
|
4933
|
+
if (e.lengthComputable && !_this5.sliceUpload) {
|
|
4934
|
+
var percentComplete = val || Math.round(e.loaded * 100 / e.total);
|
|
3668
4935
|
var kb = Math.round(e.loaded / 1000);
|
|
3669
4936
|
fileObj.progress = percentComplete + '%';
|
|
3670
4937
|
_this5.speed = kb - _this5.total;
|
|
@@ -3676,6 +4943,24 @@
|
|
|
3676
4943
|
}
|
|
3677
4944
|
_this5.$emit('on-progress', e, fileObj, _this5.fileList);
|
|
3678
4945
|
}
|
|
4946
|
+
if (e.lengthComputable && _this5.sliceUpload) {
|
|
4947
|
+
progressList[val] = e.loaded;
|
|
4948
|
+
var complete = progressList.reduce(function (p, c) {
|
|
4949
|
+
return p + c;
|
|
4950
|
+
});
|
|
4951
|
+
var _kb = Math.round(complete / 1000);
|
|
4952
|
+
_this5.speed = _kb - _this5.total;
|
|
4953
|
+
_this5.total = _kb;
|
|
4954
|
+
_this5.unit = 'kb/s';
|
|
4955
|
+
if (_this5.speed > 1000) {
|
|
4956
|
+
_this5.speed = Math.round(_this5.speed / 1000);
|
|
4957
|
+
_this5.unit = 'mb/s';
|
|
4958
|
+
}
|
|
4959
|
+
fileObj.progress = Math.round(complete * 100 / fileObj.origin.size) + '%';
|
|
4960
|
+
if (fileObj.progress === 100 + '%') {
|
|
4961
|
+
_this5.$emit('on-progress', e, fileObj, _this5.fileList);
|
|
4962
|
+
}
|
|
4963
|
+
}
|
|
3679
4964
|
fileObj.status = 'running';
|
|
3680
4965
|
};
|
|
3681
4966
|
var options = {
|
|
@@ -3687,8 +4972,11 @@
|
|
|
3687
4972
|
method: 'POST',
|
|
3688
4973
|
header: this.header,
|
|
3689
4974
|
url: this.url,
|
|
3690
|
-
|
|
3691
|
-
|
|
4975
|
+
sliceUrl: this.sliceUrl,
|
|
4976
|
+
mergeUrl: this.mergeUrl,
|
|
4977
|
+
chunkSize: this.chunkSize,
|
|
4978
|
+
onProgress: function onProgress(event, val) {
|
|
4979
|
+
uploadProgress(event, val);
|
|
3692
4980
|
},
|
|
3693
4981
|
onSuccess: function onSuccess(reponseText, fileObj) {
|
|
3694
4982
|
_this5.handleSuccess(reponseText, fileObj);
|
|
@@ -3701,7 +4989,7 @@
|
|
|
3701
4989
|
}
|
|
3702
4990
|
};
|
|
3703
4991
|
this.isdrag = false;
|
|
3704
|
-
var request = this.customRequest
|
|
4992
|
+
var request = this.customRequest ? this.customRequest : this.sliceUpload ? sliceRequest : defaultRequest;
|
|
3705
4993
|
request(options);
|
|
3706
4994
|
},
|
|
3707
4995
|
handleSuccess: function handleSuccess(response, file) {
|