@cloud-app-dev/vidc 3.1.15 → 3.1.17
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/Api/index.js +0 -23
- package/es/AppContext/Sync.js +1 -15
- package/es/AppContext/index.js +21 -52
- package/es/AppContext/static.js +0 -7
- package/es/Auth/index.js +2 -5
- package/es/AutoExit/index.js +1 -5
- package/es/Box/BetweenBox/index.js +6 -8
- package/es/Box/InfoBox/index.js +6 -8
- package/es/Box/TwoColumnBox/index.js +8 -18
- package/es/Box/deps/grid-factory.js +0 -12
- package/es/Box/index.js +4 -6
- package/es/CheckGroupFixed/index.js +19 -34
- package/es/Config/index.js +0 -4
- package/es/Config/utils.js +3 -18
- package/es/ConfigContext/index.js +1 -3
- package/es/CustomRenderSelect/index.js +13 -29
- package/es/DisableMark/index.js +2 -2
- package/es/DomMove/index.js +24 -37
- package/es/DomMove/utils.js +3 -8
- package/es/Drag/DragAndDropItem.js +19 -37
- package/es/Drag/DropItem.js +5 -15
- package/es/Drawer/Demo.js +3 -17
- package/es/Drawer/Footer.js +3 -5
- package/es/Drawer/index.js +28 -50
- package/es/ErrorFallback/index.js +1 -3
- package/es/FullScreen/index.js +8 -18
- package/es/HightLevel/index.js +1 -5
- package/es/IconFont/index.js +5 -11
- package/es/ImageView/index.js +8 -20
- package/es/Input/index.js +14 -27
- package/es/InstanceHistory/index.js +0 -2
- package/es/LabelValue/index.js +8 -10
- package/es/List/DynamicGridList/Demo.js +0 -11
- package/es/List/DynamicGridList/index.js +16 -25
- package/es/List/DynamicList/index.js +23 -38
- package/es/List/GridList/Demo.js +3 -16
- package/es/List/GridList/hook.js +34 -65
- package/es/List/GridList/utils.js +0 -1
- package/es/List/VList/index.js +10 -20
- package/es/List/VList/utils.js +2 -3
- package/es/List/index.js +5 -7
- package/es/LoaderApp/index.js +5 -22
- package/es/LoaderApp/loader.js +5 -13
- package/es/LoaderApp/sandbox.back.js +16 -81
- package/es/LoaderApp/sandbox.js +8 -22
- package/es/LoaderApp/utils.js +20 -49
- package/es/LoaderScript/index.js +8 -19
- package/es/LoaderScript/utils.js +0 -51
- package/es/Map/BasicMap/AMapInstance.js +0 -10
- package/es/Map/BasicMap/LeafletInstance.js +11 -20
- package/es/Map/BasicMap/index.js +6 -28
- package/es/Map/ClusterLayer/hook.js +10 -32
- package/es/Map/ClusterLayer/index.js +2 -6
- package/es/Map/Config/index.js +8 -21
- package/es/Map/Config/utils.js +0 -6
- package/es/Map/Context/index.js +2 -22
- package/es/Map/FindPio/index.js +0 -2
- package/es/Map/InfoWindow/MakerLikeWindow.js +9 -28
- package/es/Map/InfoWindow/demo.js +5 -22
- package/es/Map/InfoWindow/index.js +13 -29
- package/es/Map/LevelCenter/DragMarker/index.js +5 -9
- package/es/Map/LevelCenter/demo.js +6 -16
- package/es/Map/LevelCenter/index.js +8 -15
- package/es/Map/LoaderMap/index.js +10 -10
- package/es/Map/MapDrawSelect/demo.js +12 -23
- package/es/Map/MapDrawSelect/index.js +14 -21
- package/es/Map/MouseTool/index.js +16 -26
- package/es/Map/MouseTool/useMouseTools.js +6 -29
- package/es/Map/ResetTools/index.js +4 -8
- package/es/Map/SinglePoint/index.js +6 -13
- package/es/Map/hook/useMapEvent.js +3 -7
- package/es/Map/hook/useMapType.js +1 -2
- package/es/Map/useMarker/index.js +10 -24
- package/es/Map/withMap/index.js +0 -2
- package/es/Modal/index.d.ts +1 -1
- package/es/Modal/index.js +29 -50
- package/es/Picture/component/DefaultRects/RectInfo.js +11 -25
- package/es/Picture/component/DefaultRects/index.js +3 -5
- package/es/Picture/component/DrawRect/index.js +6 -8
- package/es/Picture/component/RectMenu/index.js +10 -16
- package/es/Picture/component/RectMenu/utils.js +3 -6
- package/es/Picture/component/Tools/index.js +6 -8
- package/es/Picture/component/WheelScale/index.js +3 -6
- package/es/Picture/dragBound.js +4 -17
- package/es/Picture/index.js +46 -87
- package/es/Picture/loadCaptureRectImage.js +10 -26
- package/es/Picture/useDraw.js +20 -39
- package/es/Picture/utils.js +2 -11
- package/es/Player/api/index.js +14 -78
- package/es/Player/context.js +1 -2
- package/es/Player/contraller_bar/bar.js +5 -9
- package/es/Player/contraller_bar/contraller_event.js +5 -23
- package/es/Player/contraller_bar/index.js +7 -9
- package/es/Player/contraller_bar/left_bar.js +15 -27
- package/es/Player/contraller_bar/right_bar.js +7 -18
- package/es/Player/contraller_bar/time.js +6 -16
- package/es/Player/contraller_bar/useBarStatus.js +5 -16
- package/es/Player/contraller_bar/volume.js +6 -26
- package/es/Player/demo.js +59 -75
- package/es/Player/event/errorEvent.js +14 -39
- package/es/Player/event/eventName.js +1 -1
- package/es/Player/event/index.js +19 -53
- package/es/Player/fps_play.js +10 -27
- package/es/Player/frontend_player.js +10 -19
- package/es/Player/frontend_timeline.js +25 -47
- package/es/Player/iconfont.js +2 -5
- package/es/Player/live_heart.js +2 -14
- package/es/Player/message.js +9 -29
- package/es/Player/segment_player.js +39 -77
- package/es/Player/segment_timeline.js +42 -68
- package/es/Player/single_player.js +64 -87
- package/es/Player/style/iconfont.js +10 -17
- package/es/Player/timeline.js +11 -28
- package/es/Player/util.js +0 -21
- package/es/PlayerExt/demo.js +11 -21
- package/es/PlayerExt/index.js +18 -43
- package/es/Progress/index.js +3 -15
- package/es/ROI/demo.js +0 -2
- package/es/ROI/index.js +15 -22
- package/es/ScreenPlayer/Live.js +35 -68
- package/es/ScreenPlayer/LiveTools.js +24 -37
- package/es/ScreenPlayer/PlayerWithExt.js +43 -78
- package/es/ScreenPlayer/RatePick.js +1 -3
- package/es/ScreenPlayer/Record.js +52 -123
- package/es/ScreenPlayer/RecordTools.js +32 -53
- package/es/ScreenPlayer/ScreenSelect.js +1 -3
- package/es/ScreenPlayer/SegmentTimeLine.js +8 -12
- package/es/ScreenPlayer/TimeMode.js +1 -3
- package/es/ScreenPlayer/TimeSelect.js +11 -26
- package/es/ScreenPlayer/demo.js +3 -1
- package/es/ScreenPlayer/demo2.js +10 -46
- package/es/ScreenPlayer/useRecordList.js +7 -72
- package/es/ScreenPlayer/useTimeSlider.js +40 -132
- package/es/ScreenPlayer/useVideoFit.js +5 -18
- package/es/ScreenPlayer/utils.js +0 -8
- package/es/Service/fetch-adapter.js +2 -37
- package/es/Service/http.js +8 -27
- package/es/TableLayout/index.js +3 -7
- package/es/ThemeAntd/demo.js +0 -2
- package/es/Timeout/index.js +10 -26
- package/es/Tree/demo.js +0 -2
- package/es/Tree/index.js +14 -21
- package/es/useDrawROI/index.js +51 -105
- package/es/useEventEmitterHandle/index.js +2 -6
- package/es/useFullscreen/demo.js +6 -16
- package/es/useFullscreen/index.js +5 -25
- package/es/useHistory/index.js +0 -2
- package/es/useInfiniteScroll/index.js +14 -39
- package/es/useRafInterval/index.js +2 -26
- package/es/useSimpleState/index.js +5 -16
- package/es/useVirtualList/index.js +19 -57
- package/es/utils.js +0 -28
- package/package.json +14 -14
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
|
|
3
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
-
|
|
5
3
|
/// <reference path="../../typings/global.d.ts"/>
|
|
6
4
|
import { __awaiter } from "tslib";
|
|
7
5
|
import { AxiosError } from 'axios';
|
|
@@ -16,29 +14,24 @@ export default function fetchAdapter(config) {
|
|
|
16
14
|
var signal = controller.signal;
|
|
17
15
|
var request = createRequest(config, signal);
|
|
18
16
|
var promises = [getResponse(request, config)];
|
|
19
|
-
|
|
20
17
|
if (config.timeout && config.timeout > 0) {
|
|
21
18
|
promises.push(timeoutHandle(request, controller, config));
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
if (config.cancelToken) {
|
|
25
21
|
// Handle cancellation
|
|
26
22
|
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
27
23
|
if (!request) {
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
reject(!cancel ? new CanceledError(null, config, request) : cancel);
|
|
32
27
|
controller.abort();
|
|
33
28
|
});
|
|
34
29
|
}
|
|
35
|
-
|
|
36
30
|
return Promise.race(promises).then(function (data) {
|
|
37
31
|
return settle(resolve, reject, data);
|
|
38
32
|
}).catch(reject);
|
|
39
33
|
});
|
|
40
34
|
}
|
|
41
|
-
|
|
42
35
|
function timeoutHandle(request, controller, config) {
|
|
43
36
|
return new Promise(function (resolve) {
|
|
44
37
|
setTimeout(function () {
|
|
@@ -48,7 +41,6 @@ function timeoutHandle(request, controller, config) {
|
|
|
48
41
|
}, config.timeout);
|
|
49
42
|
});
|
|
50
43
|
}
|
|
51
|
-
|
|
52
44
|
function getResponse(request, config) {
|
|
53
45
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
54
46
|
var stageOne, response;
|
|
@@ -59,17 +51,14 @@ function getResponse(request, config) {
|
|
|
59
51
|
_context.prev = 0;
|
|
60
52
|
_context.next = 3;
|
|
61
53
|
return fetch(request);
|
|
62
|
-
|
|
63
54
|
case 3:
|
|
64
55
|
stageOne = _context.sent;
|
|
65
56
|
_context.next = 9;
|
|
66
57
|
break;
|
|
67
|
-
|
|
68
58
|
case 6:
|
|
69
59
|
_context.prev = 6;
|
|
70
60
|
_context.t0 = _context["catch"](0);
|
|
71
61
|
return _context.abrupt("return", createError('Network Error', config, 'ERR_NETWORK', request));
|
|
72
|
-
|
|
73
62
|
case 9:
|
|
74
63
|
response = {
|
|
75
64
|
ok: stageOne.ok,
|
|
@@ -79,51 +68,39 @@ function getResponse(request, config) {
|
|
|
79
68
|
config: config,
|
|
80
69
|
request: request
|
|
81
70
|
};
|
|
82
|
-
|
|
83
71
|
if (!(stageOne.status >= 200 && stageOne.status !== 204)) {
|
|
84
72
|
_context.next = 30;
|
|
85
73
|
break;
|
|
86
74
|
}
|
|
87
|
-
|
|
88
75
|
_context.t1 = config.responseType;
|
|
89
76
|
_context.next = _context.t1 === 'arraybuffer' ? 14 : _context.t1 === 'blob' ? 18 : _context.t1 === 'json' ? 22 : 26;
|
|
90
77
|
break;
|
|
91
|
-
|
|
92
78
|
case 14:
|
|
93
79
|
_context.next = 16;
|
|
94
80
|
return stageOne.arrayBuffer();
|
|
95
|
-
|
|
96
81
|
case 16:
|
|
97
82
|
response.data = _context.sent;
|
|
98
83
|
return _context.abrupt("break", 30);
|
|
99
|
-
|
|
100
84
|
case 18:
|
|
101
85
|
_context.next = 20;
|
|
102
86
|
return stageOne.blob();
|
|
103
|
-
|
|
104
87
|
case 20:
|
|
105
88
|
response.data = _context.sent;
|
|
106
89
|
return _context.abrupt("break", 30);
|
|
107
|
-
|
|
108
90
|
case 22:
|
|
109
91
|
_context.next = 24;
|
|
110
92
|
return stageOne.json();
|
|
111
|
-
|
|
112
93
|
case 24:
|
|
113
94
|
response.data = _context.sent;
|
|
114
95
|
return _context.abrupt("break", 30);
|
|
115
|
-
|
|
116
96
|
case 26:
|
|
117
97
|
_context.next = 28;
|
|
118
98
|
return stageOne.text();
|
|
119
|
-
|
|
120
99
|
case 28:
|
|
121
100
|
response.data = _context.sent;
|
|
122
101
|
return _context.abrupt("break", 30);
|
|
123
|
-
|
|
124
102
|
case 30:
|
|
125
103
|
return _context.abrupt("return", response);
|
|
126
|
-
|
|
127
104
|
case 31:
|
|
128
105
|
case "end":
|
|
129
106
|
return _context.stop();
|
|
@@ -132,57 +109,45 @@ function getResponse(request, config) {
|
|
|
132
109
|
}, _callee, null, [[0, 6]]);
|
|
133
110
|
}));
|
|
134
111
|
}
|
|
135
|
-
|
|
136
112
|
function createRequest(config, signal) {
|
|
137
113
|
var headers = new Headers(config.headers);
|
|
138
|
-
|
|
139
114
|
if (config.auth) {
|
|
140
115
|
var username = config.auth.username || '';
|
|
141
116
|
var password = config.auth.password ? decodeURI(encodeURIComponent(config.auth.password)) : '';
|
|
142
117
|
headers.set('Authorization', "Basic ".concat(btoa(username + ':' + password)));
|
|
143
118
|
}
|
|
144
|
-
|
|
145
119
|
var method = config.method.toUpperCase();
|
|
146
120
|
var options = {
|
|
147
121
|
headers: headers,
|
|
148
122
|
method: method,
|
|
149
123
|
signal: signal
|
|
150
124
|
};
|
|
151
|
-
|
|
152
125
|
if (method !== 'GET' && method !== 'HEAD') {
|
|
153
126
|
options.body = config.data;
|
|
154
127
|
}
|
|
155
|
-
|
|
156
128
|
if (config.mode) {
|
|
157
129
|
options.mode = config.mode;
|
|
158
130
|
}
|
|
159
|
-
|
|
160
131
|
if (config.cache) {
|
|
161
132
|
options.cache = config.cache;
|
|
162
133
|
}
|
|
163
|
-
|
|
164
134
|
if (config.integrity) {
|
|
165
135
|
options.integrity = config.integrity;
|
|
166
136
|
}
|
|
167
|
-
|
|
168
137
|
if (config.redirect) {
|
|
169
138
|
options.redirect = config.redirect;
|
|
170
139
|
}
|
|
171
|
-
|
|
172
140
|
if (config.referrer) {
|
|
173
141
|
options.referrer = config.referrer;
|
|
174
142
|
}
|
|
175
|
-
|
|
176
143
|
if (!isUndefined(config.withCredentials)) {
|
|
177
144
|
options.credentials = config.withCredentials ? 'include' : 'omit';
|
|
178
145
|
}
|
|
179
|
-
|
|
180
146
|
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
181
|
-
var url = buildURL(fullPath, config.params, config.paramsSerializer);
|
|
182
|
-
|
|
147
|
+
var url = buildURL(fullPath, config.params, config.paramsSerializer);
|
|
148
|
+
// Expected browser to throw error if there is any wrong configuration value
|
|
183
149
|
return new Request(url, options);
|
|
184
150
|
}
|
|
185
|
-
|
|
186
151
|
function createError(message, config, code, request, response) {
|
|
187
152
|
return new AxiosError(message, AxiosError[code], config, request, response);
|
|
188
153
|
}
|
package/es/Service/http.js
CHANGED
|
@@ -17,7 +17,6 @@ var httpInstance = Axios.create(config);
|
|
|
17
17
|
/**
|
|
18
18
|
* 请求之前拦截动作
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
20
|
httpInstance.interceptors.request.use(function (response) {
|
|
22
21
|
return response;
|
|
23
22
|
}, function (error) {
|
|
@@ -26,7 +25,6 @@ httpInstance.interceptors.request.use(function (response) {
|
|
|
26
25
|
/**
|
|
27
26
|
* 请求之后拦截动作
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
28
|
httpInstance.interceptors.response.use(function (response) {
|
|
31
29
|
if (Middleware.responseMiddleware.length === 0) {
|
|
32
30
|
return response.data;
|
|
@@ -43,23 +41,18 @@ httpInstance.interceptors.response.use(function (response) {
|
|
|
43
41
|
});
|
|
44
42
|
return Promise.reject(error);
|
|
45
43
|
}
|
|
46
|
-
|
|
47
44
|
if (!error.response) {
|
|
48
45
|
console.error(error);
|
|
49
46
|
return Promise.reject(error);
|
|
50
47
|
}
|
|
51
|
-
|
|
52
48
|
return Promise.reject(error.response);
|
|
53
49
|
});
|
|
54
|
-
|
|
55
50
|
function http(_a) {
|
|
56
51
|
var cancelHttp = _a.cancelHttp,
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
newOptions = __rest(_a, ["cancelHttp"]);
|
|
59
53
|
var cancel;
|
|
60
54
|
var cancelToken = new CancelToken(function (c) {
|
|
61
55
|
cancel = c;
|
|
62
|
-
|
|
63
56
|
if (cancelHttp) {
|
|
64
57
|
cancelHttp(cancel);
|
|
65
58
|
}
|
|
@@ -68,7 +61,6 @@ function http(_a) {
|
|
|
68
61
|
cancelToken: cancelToken
|
|
69
62
|
}));
|
|
70
63
|
}
|
|
71
|
-
|
|
72
64
|
var httpMultiPartInstance = Axios.create({
|
|
73
65
|
timeout: 10 * 60 * 1000,
|
|
74
66
|
adapter: fetchAdapter,
|
|
@@ -81,55 +73,44 @@ httpMultiPartInstance.interceptors.response.use(function (response) {
|
|
|
81
73
|
}, function (error) {
|
|
82
74
|
return Promise.reject(error);
|
|
83
75
|
});
|
|
84
|
-
|
|
85
76
|
function httpXMLInstance(_ref) {
|
|
86
77
|
var url = _ref.url,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
_ref$method = _ref.method,
|
|
79
|
+
method = _ref$method === void 0 ? 'GET' : _ref$method,
|
|
80
|
+
data = _ref.data,
|
|
81
|
+
headers = _ref.headers,
|
|
82
|
+
cancelHttp = _ref.cancelHttp,
|
|
83
|
+
_ref$isAsync = _ref.isAsync,
|
|
84
|
+
isAsync = _ref$isAsync === void 0 ? false : _ref$isAsync;
|
|
94
85
|
return new Promise(function (resolve, reject) {
|
|
95
86
|
var xhr = new XMLHttpRequest();
|
|
96
|
-
|
|
97
87
|
var cancel = function cancel() {
|
|
98
88
|
return xhr.abort();
|
|
99
89
|
};
|
|
100
|
-
|
|
101
90
|
if (cancelHttp) {
|
|
102
91
|
cancelHttp(cancel);
|
|
103
92
|
}
|
|
104
|
-
|
|
105
93
|
xhr.open(method, url, !isAsync);
|
|
106
|
-
|
|
107
94
|
if (headers) {
|
|
108
95
|
Object.keys(headers).forEach(function (key) {
|
|
109
96
|
xhr.setRequestHeader(key, headers[key]);
|
|
110
97
|
});
|
|
111
98
|
}
|
|
112
|
-
|
|
113
99
|
xhr.onreadystatechange = function () {
|
|
114
100
|
if (xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 304)) {
|
|
115
101
|
var _data;
|
|
116
|
-
|
|
117
102
|
try {
|
|
118
103
|
_data = JSON.parse(xhr.response);
|
|
119
104
|
} catch (e) {
|
|
120
105
|
_data = xhr.response;
|
|
121
106
|
}
|
|
122
|
-
|
|
123
107
|
resolve(_data);
|
|
124
108
|
}
|
|
125
|
-
|
|
126
109
|
if (xhr.readyState === 4 && !(xhr.status === 200 || xhr.status === 304)) {
|
|
127
110
|
reject(xhr);
|
|
128
111
|
}
|
|
129
112
|
};
|
|
130
|
-
|
|
131
113
|
xhr.send(data ? JSON.stringify(data) : null);
|
|
132
114
|
});
|
|
133
115
|
}
|
|
134
|
-
|
|
135
116
|
export { http as default, http, httpMultiPartInstance, httpXMLInstance };
|
package/es/TableLayout/index.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import _useSize from "ahooks/es/useSize";
|
|
2
2
|
import React, { useMemo, useRef } from 'react';
|
|
3
3
|
import "./index.css";
|
|
4
|
-
|
|
5
4
|
function TableLayout(_ref) {
|
|
6
5
|
var className = _ref.className,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
children = _ref.children,
|
|
7
|
+
cutNum = _ref.cutNum,
|
|
8
|
+
x = _ref.x;
|
|
10
9
|
var domRef = useRef(null);
|
|
11
|
-
|
|
12
10
|
var size = _useSize(domRef);
|
|
13
|
-
|
|
14
11
|
var height = useMemo(function () {
|
|
15
12
|
return size.height - cutNum;
|
|
16
13
|
}, [size.height, cutNum]);
|
|
@@ -24,7 +21,6 @@ function TableLayout(_ref) {
|
|
|
24
21
|
}
|
|
25
22
|
}));
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
TableLayout.defaultProps = {
|
|
29
25
|
className: '',
|
|
30
26
|
cutNum: 0,
|
package/es/ThemeAntd/demo.js
CHANGED
|
@@ -21,7 +21,6 @@ import _ConfigProvider from "antd/lib/config-provider";
|
|
|
21
21
|
import React, { useRef } from 'react';
|
|
22
22
|
import ThemeAntd from '.';
|
|
23
23
|
import "./demo.css";
|
|
24
|
-
|
|
25
24
|
var App = function App() {
|
|
26
25
|
var ref = useRef();
|
|
27
26
|
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
@@ -98,5 +97,4 @@ var App = function App() {
|
|
|
98
97
|
}]
|
|
99
98
|
})))));
|
|
100
99
|
};
|
|
101
|
-
|
|
102
100
|
export default App;
|
package/es/Timeout/index.js
CHANGED
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
import _useEventListener from "ahooks/es/useEventListener";
|
|
2
2
|
import _useRafInterval from "ahooks/es/useRafInterval";
|
|
3
|
-
|
|
4
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
-
|
|
6
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
|
|
8
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
-
|
|
10
6
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
-
|
|
12
7
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
-
|
|
14
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
-
|
|
16
9
|
import React, { useEffect, useRef, useState } from 'react';
|
|
17
|
-
|
|
18
10
|
/**
|
|
19
11
|
* @desc 用户创建界面超时回调
|
|
20
12
|
*/
|
|
21
13
|
function Timeout(_ref) {
|
|
22
14
|
var contianer = _ref.contianer,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
time = _ref.time,
|
|
16
|
+
onTimeout = _ref.onTimeout,
|
|
17
|
+
ignore = _ref.ignore;
|
|
26
18
|
var cuurentTimeRef = useRef(Date.now());
|
|
27
19
|
var lockstatusRef = useRef(false);
|
|
28
|
-
|
|
29
20
|
var _useState = useState({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
timelock: Date.now()
|
|
22
|
+
}),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
state = _useState2[0],
|
|
25
|
+
setState = _useState2[1];
|
|
36
26
|
_useRafInterval(function () {
|
|
37
27
|
var now = Date.now();
|
|
38
28
|
setState(function (old) {
|
|
@@ -41,35 +31,29 @@ function Timeout(_ref) {
|
|
|
41
31
|
});
|
|
42
32
|
});
|
|
43
33
|
var isIgnore = ignore ? ignore() : false;
|
|
44
|
-
|
|
45
34
|
if (isIgnore) {
|
|
46
35
|
// 如果当前需要忽略,那么重置时间
|
|
47
36
|
cuurentTimeRef.current = now;
|
|
48
37
|
}
|
|
49
38
|
}, 1 * 1000);
|
|
50
|
-
|
|
51
39
|
useEffect(function () {
|
|
52
40
|
var isIgnore = ignore ? ignore() : false;
|
|
53
|
-
|
|
54
41
|
if (!lockstatusRef.current && state.timelock - cuurentTimeRef.current > time * 1000 && !isIgnore) {
|
|
55
42
|
lockstatusRef.current = true;
|
|
56
43
|
onTimeout && onTimeout();
|
|
57
44
|
setTimeout(function () {
|
|
58
45
|
return lockstatusRef.current = false;
|
|
59
46
|
}, 1000);
|
|
60
|
-
}
|
|
61
|
-
|
|
47
|
+
}
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
49
|
}, [state.timelock, time]);
|
|
63
|
-
|
|
64
50
|
_useEventListener('mousemove', function () {
|
|
65
51
|
return cuurentTimeRef.current = Date.now();
|
|
66
52
|
}, {
|
|
67
53
|
target: contianer
|
|
68
54
|
});
|
|
69
|
-
|
|
70
55
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
71
56
|
}
|
|
72
|
-
|
|
73
57
|
Timeout.defaultProps = {
|
|
74
58
|
time: 15 * 60,
|
|
75
59
|
contianer: document.body
|
package/es/Tree/demo.js
CHANGED
|
@@ -2,7 +2,6 @@ import "antd/lib/config-provider/style";
|
|
|
2
2
|
import _ConfigProvider from "antd/lib/config-provider";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import BsTree from './index';
|
|
5
|
-
|
|
6
5
|
function App() {
|
|
7
6
|
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
8
7
|
prefixCls: "cloudapp"
|
|
@@ -25,5 +24,4 @@ function App() {
|
|
|
25
24
|
}]
|
|
26
25
|
})));
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
export default App;
|
package/es/Tree/index.js
CHANGED
|
@@ -4,28 +4,25 @@ import { __rest } from "tslib";
|
|
|
4
4
|
/**
|
|
5
5
|
* tree 基础组件支持各种自定义其他tree可用过它来拓展
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import React, { useImperativeHandle, useMemo, useRef } from 'react';
|
|
9
8
|
import IconFont from '../IconFont';
|
|
10
9
|
import HightLevel from '../HightLevel';
|
|
11
10
|
import "./index.css";
|
|
12
|
-
|
|
13
11
|
function BaseTree(_a, ref) {
|
|
14
12
|
var treeData = _a.treeData,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
className = _a.className,
|
|
14
|
+
showIcon = _a.showIcon,
|
|
15
|
+
treeNodeProps = _a.treeNodeProps,
|
|
16
|
+
icon = _a.icon,
|
|
17
|
+
props = __rest(_a, ["treeData", "className", "showIcon", "treeNodeProps", "icon"]);
|
|
21
18
|
var prefix = treeNodeProps.prefix,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
suffix = treeNodeProps.suffix,
|
|
20
|
+
keyword = treeNodeProps.keyword,
|
|
21
|
+
_treeNodeProps$key = treeNodeProps.key,
|
|
22
|
+
key = _treeNodeProps$key === void 0 ? 'id' : _treeNodeProps$key,
|
|
23
|
+
_treeNodeProps$nameKe = treeNodeProps.nameKey,
|
|
24
|
+
nameKey = _treeNodeProps$nameKe === void 0 ? 'name' : _treeNodeProps$nameKe,
|
|
25
|
+
RenderTreeTitle = treeNodeProps.RenderTreeTitle;
|
|
29
26
|
var treeRef = useRef(null);
|
|
30
27
|
useImperativeHandle(ref, function () {
|
|
31
28
|
return {
|
|
@@ -33,12 +30,10 @@ function BaseTree(_a, ref) {
|
|
|
33
30
|
if (!props.checkable || !treeRef.current) {
|
|
34
31
|
return [];
|
|
35
32
|
}
|
|
36
|
-
|
|
37
33
|
return treeRef.current.tree.state.checkedKeys;
|
|
38
34
|
}
|
|
39
35
|
};
|
|
40
36
|
}, [props.checkable]);
|
|
41
|
-
|
|
42
37
|
function defaultRenderTitle(node) {
|
|
43
38
|
return /*#__PURE__*/React.createElement("span", {
|
|
44
39
|
title: node[nameKey],
|
|
@@ -47,9 +42,8 @@ function BaseTree(_a, ref) {
|
|
|
47
42
|
keyword: keyword,
|
|
48
43
|
name: node[nameKey]
|
|
49
44
|
})), suffix === null || suffix === void 0 ? void 0 : suffix(node));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
}
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
47
|
var titleRender = useMemo(function () {
|
|
54
48
|
return RenderTreeTitle !== null && RenderTreeTitle !== void 0 ? RenderTreeTitle : defaultRenderTitle;
|
|
55
49
|
}, []);
|
|
@@ -73,7 +67,6 @@ function BaseTree(_a, ref) {
|
|
|
73
67
|
titleRender: titleRender
|
|
74
68
|
}, props));
|
|
75
69
|
}
|
|
76
|
-
|
|
77
70
|
var BTree = /*#__PURE__*/React.forwardRef(BaseTree);
|
|
78
71
|
BTree.defaultProps = {
|
|
79
72
|
treeData: [],
|