@cloud-app-dev/vidc 3.1.16 → 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 +34 -67
- package/es/ScreenPlayer/LiveTools.js +21 -38
- package/es/ScreenPlayer/PlayerWithExt.js +43 -78
- package/es/ScreenPlayer/RatePick.js +1 -3
- package/es/ScreenPlayer/Record.js +50 -121
- package/es/ScreenPlayer/RecordTools.js +32 -54
- 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 +9 -24
- 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 +1 -1
package/es/Api/index.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
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
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
8
|
-
|
|
9
5
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
-
|
|
11
6
|
import { __awaiter } from "tslib";
|
|
12
7
|
import Service from '../Service';
|
|
13
8
|
import { getHeader } from '../utils';
|
|
14
|
-
|
|
15
9
|
var Api = /*#__PURE__*/function () {
|
|
16
10
|
function Api() {
|
|
17
11
|
_classCallCheck(this, Api);
|
|
18
12
|
}
|
|
19
|
-
|
|
20
13
|
_createClass(Api, [{
|
|
21
14
|
key: "getOrgs",
|
|
22
15
|
value: function getOrgs() {
|
|
@@ -36,11 +29,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
36
29
|
},
|
|
37
30
|
headers: getHeader()
|
|
38
31
|
});
|
|
39
|
-
|
|
40
32
|
case 2:
|
|
41
33
|
res = _context.sent;
|
|
42
34
|
return _context.abrupt("return", res.data);
|
|
43
|
-
|
|
44
35
|
case 4:
|
|
45
36
|
case "end":
|
|
46
37
|
return _context.stop();
|
|
@@ -54,9 +45,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
54
45
|
value: function getUsers(organizationId) {
|
|
55
46
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
56
47
|
var filterUserIds = arguments.length > 2 ? arguments[2] : undefined;
|
|
57
|
-
|
|
58
48
|
var _a, _b;
|
|
59
|
-
|
|
60
49
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
61
50
|
var res;
|
|
62
51
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -77,13 +66,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
77
66
|
postId: ''
|
|
78
67
|
}, params)
|
|
79
68
|
});
|
|
80
|
-
|
|
81
69
|
case 2:
|
|
82
70
|
res = _context2.sent;
|
|
83
71
|
return _context2.abrupt("return", !filterUserIds ? (_a = res.data) === null || _a === void 0 ? void 0 : _a.list : (((_b = res.data) === null || _b === void 0 ? void 0 : _b.list) || []).filter(function (v) {
|
|
84
72
|
return !filterUserIds.includes(v.id);
|
|
85
73
|
}));
|
|
86
|
-
|
|
87
74
|
case 4:
|
|
88
75
|
case "end":
|
|
89
76
|
return _context2.stop();
|
|
@@ -109,11 +96,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
109
96
|
headers: getHeader(),
|
|
110
97
|
data: {}
|
|
111
98
|
});
|
|
112
|
-
|
|
113
99
|
case 2:
|
|
114
100
|
res = _context3.sent;
|
|
115
101
|
return _context3.abrupt("return", res.data);
|
|
116
|
-
|
|
117
102
|
case 4:
|
|
118
103
|
case "end":
|
|
119
104
|
return _context3.stop();
|
|
@@ -139,11 +124,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
139
124
|
data: {},
|
|
140
125
|
headers: getHeader()
|
|
141
126
|
});
|
|
142
|
-
|
|
143
127
|
case 2:
|
|
144
128
|
res = _context4.sent;
|
|
145
129
|
return _context4.abrupt("return", res.data);
|
|
146
|
-
|
|
147
130
|
case 4:
|
|
148
131
|
case "end":
|
|
149
132
|
return _context4.stop();
|
|
@@ -169,11 +152,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
169
152
|
data: {},
|
|
170
153
|
headers: getHeader()
|
|
171
154
|
});
|
|
172
|
-
|
|
173
155
|
case 2:
|
|
174
156
|
res = _context5.sent;
|
|
175
157
|
return _context5.abrupt("return", res.data);
|
|
176
|
-
|
|
177
158
|
case 4:
|
|
178
159
|
case "end":
|
|
179
160
|
return _context5.stop();
|
|
@@ -199,11 +180,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
199
180
|
data: {},
|
|
200
181
|
headers: getHeader()
|
|
201
182
|
});
|
|
202
|
-
|
|
203
183
|
case 2:
|
|
204
184
|
res = _context6.sent;
|
|
205
185
|
return _context6.abrupt("return", res.data);
|
|
206
|
-
|
|
207
186
|
case 4:
|
|
208
187
|
case "end":
|
|
209
188
|
return _context6.stop();
|
|
@@ -213,8 +192,6 @@ var Api = /*#__PURE__*/function () {
|
|
|
213
192
|
}));
|
|
214
193
|
}
|
|
215
194
|
}]);
|
|
216
|
-
|
|
217
195
|
return Api;
|
|
218
196
|
}();
|
|
219
|
-
|
|
220
197
|
export default new Api();
|
package/es/AppContext/Sync.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import { _LOGIN_STATUS_EVENT_CHANGE_, _OPERATION_EVENT_CHANGE_, _USER_EVENT_CHANGE_, _STORE_EVENT_CHANGE_ } from './static';
|
|
4
|
-
|
|
5
4
|
function Sync(_ref) {
|
|
6
5
|
var stateChange = _ref.stateChange,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
storeChange = _ref.storeChange;
|
|
9
7
|
/**
|
|
10
8
|
* @description 用户微应用之间的状态同步
|
|
11
9
|
*/
|
|
@@ -15,42 +13,30 @@ function Sync(_ref) {
|
|
|
15
13
|
user: user
|
|
16
14
|
});
|
|
17
15
|
};
|
|
18
|
-
|
|
19
16
|
var operationFn = function operationFn(operation) {
|
|
20
17
|
return stateChange({
|
|
21
18
|
operation: operation
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
|
-
|
|
25
21
|
var statusFn = function statusFn(status) {
|
|
26
22
|
return stateChange({
|
|
27
23
|
loginStatus: status
|
|
28
24
|
});
|
|
29
25
|
};
|
|
30
|
-
|
|
31
26
|
var storeFn = function storeFn(store) {
|
|
32
27
|
return storeChange(store);
|
|
33
28
|
};
|
|
34
|
-
|
|
35
29
|
_SocketEmitter.on(_USER_EVENT_CHANGE_, userFn);
|
|
36
|
-
|
|
37
30
|
_SocketEmitter.on(_OPERATION_EVENT_CHANGE_, operationFn);
|
|
38
|
-
|
|
39
31
|
_SocketEmitter.on(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
|
|
40
|
-
|
|
41
32
|
_SocketEmitter.on(_STORE_EVENT_CHANGE_, storeFn);
|
|
42
|
-
|
|
43
33
|
return function () {
|
|
44
34
|
_SocketEmitter.off(_USER_EVENT_CHANGE_, userFn);
|
|
45
|
-
|
|
46
35
|
_SocketEmitter.off(_OPERATION_EVENT_CHANGE_, operationFn);
|
|
47
|
-
|
|
48
36
|
_SocketEmitter.off(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
|
|
49
|
-
|
|
50
37
|
_SocketEmitter.off(_STORE_EVENT_CHANGE_, storeFn);
|
|
51
38
|
};
|
|
52
39
|
}, []);
|
|
53
40
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
54
41
|
}
|
|
55
|
-
|
|
56
42
|
export default Sync;
|
package/es/AppContext/index.js
CHANGED
|
@@ -1,46 +1,36 @@
|
|
|
1
1
|
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
2
|
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
3
3
|
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
4
|
-
|
|
5
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
|
|
7
5
|
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."); }
|
|
8
|
-
|
|
9
6
|
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); }
|
|
10
|
-
|
|
11
7
|
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; }
|
|
12
|
-
|
|
13
8
|
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; }
|
|
14
|
-
|
|
15
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
|
|
17
10
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
18
11
|
import Sync from './Sync';
|
|
19
12
|
import * as Static from './static';
|
|
20
13
|
import { isEmpty } from 'lodash-es';
|
|
21
14
|
var _USER_SESSION_ = Static._USER_SESSION_,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
_OPERATION_SESSION_ = Static._OPERATION_SESSION_,
|
|
16
|
+
_LOGIN_STATUS_SESSION_ = Static._LOGIN_STATUS_SESSION_,
|
|
17
|
+
_USER_EVENT_CHANGE_ = Static._USER_EVENT_CHANGE_,
|
|
18
|
+
_OPERATION_EVENT_CHANGE_ = Static._OPERATION_EVENT_CHANGE_,
|
|
19
|
+
_LOGIN_STATUS_EVENT_CHANGE_ = Static._LOGIN_STATUS_EVENT_CHANGE_,
|
|
20
|
+
_STORE_SESSION_ = Static._STORE_SESSION_,
|
|
21
|
+
_STORE_EVENT_CHANGE_ = Static._STORE_EVENT_CHANGE_;
|
|
29
22
|
var Context = /*#__PURE__*/React.createContext(null);
|
|
30
|
-
|
|
31
23
|
function Provider(_ref) {
|
|
32
24
|
var children = _ref.children;
|
|
33
|
-
|
|
34
25
|
var _useState = useState({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
26
|
+
user: _cache.getCache(_USER_SESSION_, 'session') || {},
|
|
27
|
+
operation: _cache.getCache(_OPERATION_SESSION_, 'session') || {},
|
|
28
|
+
loginStatus: _cache.getCache(_LOGIN_STATUS_SESSION_, 'session') || false,
|
|
29
|
+
store: _cache.getCache(_STORE_SESSION_, 'session') || {}
|
|
30
|
+
}),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
state = _useState2[0],
|
|
33
|
+
setState = _useState2[1];
|
|
44
34
|
function updateUser() {
|
|
45
35
|
var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
36
|
var newUser = Object.assign(Object.assign({}, state.user), user);
|
|
@@ -49,16 +39,12 @@ function Provider(_ref) {
|
|
|
49
39
|
user: newUser
|
|
50
40
|
});
|
|
51
41
|
});
|
|
52
|
-
|
|
53
42
|
_nextTick(function () {
|
|
54
43
|
_SocketEmitter.emit(_USER_EVENT_CHANGE_, newUser);
|
|
55
|
-
|
|
56
44
|
_cache.setCache(_USER_SESSION_, newUser, 'session');
|
|
57
|
-
|
|
58
45
|
console.info('AppContext updateUser is run !', user);
|
|
59
46
|
});
|
|
60
47
|
}
|
|
61
|
-
|
|
62
48
|
function updateOperation() {
|
|
63
49
|
var operation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
64
50
|
var newOperation = Object.assign(Object.assign({}, state.operation), operation);
|
|
@@ -67,32 +53,24 @@ function Provider(_ref) {
|
|
|
67
53
|
operation: newOperation
|
|
68
54
|
});
|
|
69
55
|
});
|
|
70
|
-
|
|
71
56
|
_nextTick(function () {
|
|
72
57
|
_SocketEmitter.emit(_OPERATION_EVENT_CHANGE_, newOperation);
|
|
73
|
-
|
|
74
58
|
_cache.setCache(_OPERATION_SESSION_, newOperation, 'session');
|
|
75
|
-
|
|
76
59
|
console.info('AppContext updateOperation is run !', operation);
|
|
77
60
|
});
|
|
78
61
|
}
|
|
79
|
-
|
|
80
62
|
function updateLoginStatus(status) {
|
|
81
63
|
if (typeof status !== 'boolean') {
|
|
82
64
|
throw new Error('status type is boolean !');
|
|
83
65
|
}
|
|
84
|
-
|
|
85
66
|
setState(function (old) {
|
|
86
67
|
return status !== old.loginStatus ? Object.assign(Object.assign({}, old), {
|
|
87
68
|
loginStatus: status
|
|
88
69
|
}) : old;
|
|
89
70
|
});
|
|
90
|
-
|
|
91
71
|
_nextTick(function () {
|
|
92
72
|
_SocketEmitter.emit(_LOGIN_STATUS_EVENT_CHANGE_, status);
|
|
93
|
-
|
|
94
73
|
_cache.setCache(_LOGIN_STATUS_SESSION_, status, 'session');
|
|
95
|
-
|
|
96
74
|
console.info('AppContext updateLoginStatus is run !', status);
|
|
97
75
|
});
|
|
98
76
|
}
|
|
@@ -100,39 +78,30 @@ function Provider(_ref) {
|
|
|
100
78
|
* @desc 用于全局自定义状态存储,依赖sessionStorage持久化能力,不建议存储大数据量
|
|
101
79
|
* @param data
|
|
102
80
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
81
|
function updateStore() {
|
|
106
82
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
107
83
|
setState(function (old) {
|
|
108
|
-
var newData = {};
|
|
109
|
-
|
|
84
|
+
var newData = {};
|
|
85
|
+
//获取变更项
|
|
110
86
|
for (var key in data) {
|
|
111
87
|
if (data[key] !== old.store[key]) {
|
|
112
88
|
newData[key] = data[key];
|
|
113
89
|
}
|
|
114
90
|
}
|
|
115
|
-
|
|
116
91
|
if (isEmpty(newData)) {
|
|
117
92
|
return old;
|
|
118
93
|
}
|
|
119
|
-
|
|
120
94
|
var newStore = Object.assign(Object.assign({}, old.store), newData);
|
|
121
|
-
|
|
122
95
|
_cache.setCache(_STORE_SESSION_, newStore, 'session');
|
|
123
|
-
|
|
124
96
|
return Object.assign(Object.assign({}, old), {
|
|
125
97
|
store: newStore
|
|
126
98
|
});
|
|
127
99
|
});
|
|
128
|
-
|
|
129
100
|
_nextTick(function () {
|
|
130
101
|
_SocketEmitter.emit(_STORE_EVENT_CHANGE_, data);
|
|
131
|
-
|
|
132
102
|
console.info('AppContext updateStore is run !', data);
|
|
133
103
|
});
|
|
134
104
|
}
|
|
135
|
-
|
|
136
105
|
var stateChange = useCallback(function (options) {
|
|
137
106
|
return setState(function (old) {
|
|
138
107
|
return Object.assign(Object.assign({}, old), options);
|
|
@@ -156,7 +125,8 @@ function Provider(_ref) {
|
|
|
156
125
|
updateLoginStatus: updateLoginStatus,
|
|
157
126
|
updateStore: updateStore
|
|
158
127
|
};
|
|
159
|
-
},
|
|
128
|
+
},
|
|
129
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
130
|
[state.user, state.operation, state.loginStatus]);
|
|
161
131
|
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
162
132
|
value: providerValue
|
|
@@ -164,9 +134,8 @@ function Provider(_ref) {
|
|
|
164
134
|
stateChange: stateChange,
|
|
165
135
|
storeChange: storeChange
|
|
166
136
|
}));
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
137
|
+
}
|
|
138
|
+
// eslint-disable-next-line import/no-anonymous-default-export
|
|
170
139
|
export default {
|
|
171
140
|
Provider: Provider,
|
|
172
141
|
Context: Context
|
package/es/AppContext/static.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
export var _USER_EVENT_CHANGE_ = '_USER_EVENT_CHANGE_'; //用户信息变化
|
|
2
|
-
|
|
3
2
|
export var _OPERATION_EVENT_CHANGE_ = '_OPERATION_EVENT_CHANGE_'; //应用系统信息变化
|
|
4
|
-
|
|
5
3
|
export var _LOGIN_STATUS_EVENT_CHANGE_ = '_LOGIN_STATUS_EVENT_CHANGE_'; //登录状态变化
|
|
6
|
-
|
|
7
4
|
export var _STORE_EVENT_CHANGE_ = '_STORE_EVENT_CHANGE_'; //登录状态变化
|
|
8
|
-
|
|
9
5
|
export var _USER_SESSION_ = '_USER_SESSION_'; //用户信息 缓存key
|
|
10
|
-
|
|
11
6
|
export var _OPERATION_SESSION_ = '_OPERATION_SESSION_'; //应用系统信息 缓存key
|
|
12
|
-
|
|
13
7
|
export var _LOGIN_STATUS_SESSION_ = '_LOGIN_STATUS_SESSION_'; //登录状态 缓存key
|
|
14
|
-
|
|
15
8
|
export var _STORE_SESSION_ = '_STORE_SESSION_'; //登录状态 缓存key
|
package/es/Auth/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import Config from '../Config';
|
|
3
|
-
|
|
4
3
|
function Auth(_ref) {
|
|
5
4
|
var featureId = _ref.featureId,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
noAuthContent = _ref.noAuthContent,
|
|
6
|
+
children = _ref.children;
|
|
8
7
|
var action = useMemo(function () {
|
|
9
8
|
return !!Config.feature.find(function (v) {
|
|
10
9
|
return v === featureId;
|
|
11
10
|
});
|
|
12
11
|
}, [featureId]); //获取按钮权限
|
|
13
|
-
|
|
14
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !action ? noAuthContent ? noAuthContent : null : children);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
export default Auth;
|
package/es/AutoExit/index.js
CHANGED
|
@@ -2,13 +2,10 @@ import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
|
2
2
|
import React, { useContext, useEffect } from 'react';
|
|
3
3
|
import { useNavigate } from 'react-router-dom';
|
|
4
4
|
import AppContext from '../AppContext';
|
|
5
|
-
|
|
6
5
|
function AutoExit(_ref) {
|
|
7
6
|
var children = _ref.children;
|
|
8
|
-
|
|
9
7
|
var _useContext = useContext(AppContext.Context),
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
loginStatus = _useContext.loginStatus;
|
|
12
9
|
var navigate = useNavigate();
|
|
13
10
|
useEffect(function () {
|
|
14
11
|
if (!loginStatus) {
|
|
@@ -19,5 +16,4 @@ function AutoExit(_ref) {
|
|
|
19
16
|
}, [loginStatus, navigate]);
|
|
20
17
|
return /*#__PURE__*/React.createElement(React.Fragment, null, loginStatus ? children : null);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
export default AutoExit;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import "./index.css";
|
|
3
|
-
|
|
4
3
|
function BetweenBox(_ref) {
|
|
5
4
|
var _ref$className = _ref.className,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
6
|
+
left = _ref.left,
|
|
7
|
+
right = _ref.right,
|
|
8
|
+
style = _ref.style,
|
|
9
|
+
children = _ref.children,
|
|
10
|
+
extNode = _ref.extNode;
|
|
12
11
|
var title = useMemo(function () {
|
|
13
12
|
return left || children;
|
|
14
13
|
}, [left, children]);
|
|
@@ -20,5 +19,4 @@ function BetweenBox(_ref) {
|
|
|
20
19
|
style: style
|
|
21
20
|
}, title && /*#__PURE__*/React.createElement("div", null, title), other && /*#__PURE__*/React.createElement("div", null, other));
|
|
22
21
|
}
|
|
23
|
-
|
|
24
22
|
export default BetweenBox;
|
package/es/Box/InfoBox/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import BetweenBox from '../BetweenBox';
|
|
3
3
|
import "./index.css";
|
|
4
|
-
|
|
5
4
|
function InfoBox(_ref) {
|
|
6
5
|
var title = _ref.title,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
titleExt = _ref.titleExt,
|
|
7
|
+
children = _ref.children,
|
|
8
|
+
_ref$className = _ref.className,
|
|
9
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
10
|
+
style = _ref.style,
|
|
11
|
+
contentStyle = _ref.contentStyle;
|
|
13
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
13
|
className: "info-box-layout ".concat(className),
|
|
15
14
|
style: style
|
|
@@ -22,5 +21,4 @@ function InfoBox(_ref) {
|
|
|
22
21
|
style: contentStyle
|
|
23
22
|
}, children));
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
export default InfoBox;
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
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."); }
|
|
4
|
-
|
|
5
3
|
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); }
|
|
6
|
-
|
|
7
4
|
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; }
|
|
8
|
-
|
|
9
5
|
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; }
|
|
10
|
-
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
7
|
import React, { useState } from 'react';
|
|
14
8
|
import "./index.css";
|
|
15
|
-
|
|
16
9
|
function TwoColumnBox(_ref) {
|
|
17
10
|
var _ref$className = _ref.className,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
12
|
+
_ref$collapsible = _ref.collapsible,
|
|
13
|
+
collapsible = _ref$collapsible === void 0 ? true : _ref$collapsible,
|
|
14
|
+
leftContent = _ref.leftContent,
|
|
15
|
+
children = _ref.children;
|
|
24
16
|
var _useState = useState(false),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
collapsed = _useState2[0],
|
|
19
|
+
setCollapsed = _useState2[1];
|
|
29
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
21
|
className: "two-column-layout-container ".concat(className)
|
|
31
22
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -43,5 +34,4 @@ function TwoColumnBox(_ref) {
|
|
|
43
34
|
className: "two-column-content"
|
|
44
35
|
}, children));
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
export default TwoColumnBox;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export function getGridClassName(grid) {
|
|
2
2
|
var classNames = [];
|
|
3
|
-
|
|
4
3
|
for (var k in grid) {
|
|
5
4
|
classNames.push("cloudapp-col-".concat(k, "-").concat(grid[k]));
|
|
6
5
|
}
|
|
7
|
-
|
|
8
6
|
return [].concat('cloudapp-col', classNames);
|
|
9
7
|
}
|
|
10
8
|
export function computedGrid(grid) {
|
|
@@ -16,7 +14,6 @@ export function computedGrid(grid) {
|
|
|
16
14
|
sm: 0,
|
|
17
15
|
xs: 0
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
if (Array.isArray(grid)) {
|
|
21
18
|
grid.forEach(function (item) {
|
|
22
19
|
for (var k in item) {
|
|
@@ -32,41 +29,32 @@ export function computedGrid(grid) {
|
|
|
32
29
|
contentGrid[k] = 24 - grid[k];
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
for (var _k in contentGrid) {
|
|
37
33
|
if (contentGrid[_k] <= 0) {
|
|
38
34
|
contentGrid[_k] = 24;
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
|
-
|
|
42
37
|
return contentGrid;
|
|
43
38
|
}
|
|
44
39
|
export function computedCuurentGrid() {
|
|
45
40
|
var width = document.body.clientWidth;
|
|
46
|
-
|
|
47
41
|
if (width >= 1600) {
|
|
48
42
|
return 'xxl';
|
|
49
43
|
}
|
|
50
|
-
|
|
51
44
|
if (width >= 1200 && width < 1600) {
|
|
52
45
|
return 'xl';
|
|
53
46
|
}
|
|
54
|
-
|
|
55
47
|
if (width >= 992 && width < 1200) {
|
|
56
48
|
return 'lg';
|
|
57
49
|
}
|
|
58
|
-
|
|
59
50
|
if (width >= 768 && width < 992) {
|
|
60
51
|
return 'md';
|
|
61
52
|
}
|
|
62
|
-
|
|
63
53
|
if (width >= 576 && width < 768) {
|
|
64
54
|
return 'sm';
|
|
65
55
|
}
|
|
66
|
-
|
|
67
56
|
if (width < 576) {
|
|
68
57
|
return 'xs';
|
|
69
58
|
}
|
|
70
|
-
|
|
71
59
|
return undefined;
|
|
72
60
|
}
|
package/es/Box/index.js
CHANGED
|
@@ -8,20 +8,18 @@ import InfoBox from './InfoBox';
|
|
|
8
8
|
import defaultContentGrid from './deps/content-grid';
|
|
9
9
|
import BetweenBox from './BetweenBox';
|
|
10
10
|
import "./index.css";
|
|
11
|
-
|
|
12
11
|
function Box(_ref) {
|
|
13
12
|
var _ref$className = _ref.className,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
14
|
+
_ref$contentGrid = _ref.contentGrid,
|
|
15
|
+
contentGrid = _ref$contentGrid === void 0 ? defaultContentGrid : _ref$contentGrid,
|
|
16
|
+
children = _ref.children;
|
|
18
17
|
return /*#__PURE__*/React.createElement(_Row, {
|
|
19
18
|
className: "single-column-layout-container ".concat(className)
|
|
20
19
|
}, /*#__PURE__*/React.createElement(_Col, Object.assign({
|
|
21
20
|
className: "single-column-content"
|
|
22
21
|
}, contentGrid), children));
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
Box.TwoColumnBox = TwoColumnBox;
|
|
26
24
|
Box.InfoBox = InfoBox;
|
|
27
25
|
Box.BetweenBox = BetweenBox;
|