@cloud-app-dev/vidc 4.0.0 → 4.0.2
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/AppContext/index.js +20 -61
- package/es/AutoExit/index.js +5 -9
- package/es/Config/index.js +0 -5
- package/es/Config/utils.js +7 -27
- package/es/ConfigContext/index.d.ts +1 -1
- package/es/ConfigContext/index.js +1 -3
- package/es/CustomRenderSelect/index.js +19 -39
- package/es/DynamicGridList/index.js +16 -28
- package/es/FullScreen/index.js +10 -22
- package/es/GridList/hook.js +36 -67
- package/es/GridList/index.d.ts +1 -1
- package/es/GridList/index.js +1 -1
- package/es/ImageView/index.js +16 -31
- package/es/LabelValue/index.d.ts +0 -8
- package/es/LabelValue/index.js +11 -16
- package/es/List/index.js +5 -7
- package/es/ListWithSizeAnimate/demo.js +3 -15
- package/es/LoaderScript/utils.js +100 -153
- package/es/Map/InfoWindow/MakerLikeWindow.js +35 -29
- package/es/Map/InfoWindow/demo.js +17 -29
- package/es/Picture/component/Tools/index.js +5 -7
- package/es/Picture/demo.js +15 -19
- package/es/Picture/index.js +70 -104
- package/es/Picture/utils.js +14 -28
- package/es/Player/api/index.d.ts +4 -4
- package/es/Player/api/index.js +47 -92
- package/es/Player/contraller_bar/right_bar.js +12 -23
- package/es/Player/demo.js +47 -62
- package/es/Player/event/errorEvent.d.ts +1 -1
- package/es/Player/event/errorEvent.js +16 -41
- package/es/Player/fps_play.js +15 -33
- package/es/Player/frontend_timeline.js +28 -48
- package/es/Player/player.d.ts +3 -2
- package/es/Player/segment_timeline.js +45 -69
- package/es/Player/single_player.js +111 -117
- package/es/Player/util.d.ts +1 -1
- package/es/Player/util.js +9 -28
- package/es/Progress/index.js +5 -16
- package/es/ROI/index.d.ts +0 -6
- package/es/ROI/index.js +17 -26
- package/es/RefDrawer/Footer.js +3 -5
- package/es/RefDrawer/demo.js +0 -3
- package/es/RefDrawer/index.js +17 -27
- package/es/RefModal/demo.js +0 -3
- package/es/RefModal/index.js +27 -27
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +36 -70
- package/es/ScreenPlayer/LiveTools.js +20 -39
- package/es/ScreenPlayer/PlayerWithExt.js +48 -85
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +27 -53
- package/es/ScreenPlayer/SegmentTimeLine.js +8 -13
- package/es/ScreenPlayer/TimeSelect.js +9 -24
- package/es/ScreenPlayer/demo.js +3 -2
- package/es/ScreenPlayer/demo2.js +76 -108
- package/es/ScreenPlayer/useTimeSlider.js +63 -141
- package/es/Service/http.js +14 -34
- package/es/TableLayout/index.js +6 -10
- package/es/ThemeAntd/index.js +0 -1
- package/es/Timeout/index.js +16 -31
- package/es/VList/index.d.ts +1 -9
- package/es/VList/index.js +18 -30
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/typings.d.ts +1 -0
- package/es/useDrawROI/index.js +61 -115
- package/es/useInfiniteScroll/index.js +24 -45
- package/es/utils.js +18 -42
- package/package.json +5 -6
- package/es/LoaderApp/index.d.ts +0 -31
- package/es/LoaderApp/index.js +0 -138
- package/es/LoaderApp/index.less +0 -3
- package/es/LoaderApp/interface.d.ts +0 -9
- package/es/LoaderApp/loader.d.ts +0 -19
- package/es/LoaderApp/loader.js +0 -85
- package/es/LoaderApp/sandbox.back.d.ts +0 -18
- package/es/LoaderApp/sandbox.back.js +0 -368
- package/es/LoaderApp/sandbox.d.ts +0 -12
- package/es/LoaderApp/sandbox.js +0 -113
- package/es/LoaderApp/utils.d.ts +0 -19
- package/es/LoaderApp/utils.js +0 -275
- package/es/ROI/utils.d.ts +0 -1
- package/es/ROI/utils.js +0 -1
package/es/AppContext/index.js
CHANGED
|
@@ -1,150 +1,109 @@
|
|
|
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); }
|
|
1
2
|
import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
|
|
2
3
|
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
3
4
|
import _cache from "@cloud-app-dev/utils/es/cache";
|
|
4
|
-
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
|
|
7
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
11
|
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."); }
|
|
14
|
-
|
|
15
12
|
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); }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
13
|
+
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; }
|
|
14
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
21
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
16
|
import { isEmpty } from 'lodash-es';
|
|
24
17
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
25
|
-
import
|
|
18
|
+
import { _LOGIN_STATUS_EVENT_CHANGE_, _LOGIN_STATUS_SESSION_, _OPERATION_EVENT_CHANGE_, _OPERATION_SESSION_, _STORE_EVENT_CHANGE_, _STORE_SESSION_, _USER_EVENT_CHANGE_, _USER_SESSION_ } from "./static";
|
|
26
19
|
import Sync from "./Sync";
|
|
27
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
var _USER_SESSION_ = Static._USER_SESSION_,
|
|
30
|
-
_OPERATION_SESSION_ = Static._OPERATION_SESSION_,
|
|
31
|
-
_LOGIN_STATUS_SESSION_ = Static._LOGIN_STATUS_SESSION_,
|
|
32
|
-
_USER_EVENT_CHANGE_ = Static._USER_EVENT_CHANGE_,
|
|
33
|
-
_OPERATION_EVENT_CHANGE_ = Static._OPERATION_EVENT_CHANGE_,
|
|
34
|
-
_LOGIN_STATUS_EVENT_CHANGE_ = Static._LOGIN_STATUS_EVENT_CHANGE_,
|
|
35
|
-
_STORE_SESSION_ = Static._STORE_SESSION_,
|
|
36
|
-
_STORE_EVENT_CHANGE_ = Static._STORE_EVENT_CHANGE_;
|
|
37
22
|
var Context = /*#__PURE__*/React.createContext(null);
|
|
38
|
-
|
|
39
23
|
function Provider(_ref) {
|
|
40
24
|
var children = _ref.children;
|
|
41
|
-
|
|
42
25
|
var _useState = useState({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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];
|
|
52
34
|
function updateUser() {
|
|
53
35
|
var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
54
|
-
|
|
55
36
|
var newUser = _objectSpread(_objectSpread({}, state.user), user);
|
|
56
|
-
|
|
57
37
|
setState(function (old) {
|
|
58
38
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
59
39
|
user: newUser
|
|
60
40
|
});
|
|
61
41
|
});
|
|
62
|
-
|
|
63
42
|
_nextTick(function () {
|
|
64
43
|
_SocketEmitter.emit(_USER_EVENT_CHANGE_, newUser);
|
|
65
|
-
|
|
66
44
|
_cache.setCache(_USER_SESSION_, newUser, 'session');
|
|
67
|
-
|
|
68
45
|
console.info('AppContext updateUser is run !', user);
|
|
69
46
|
});
|
|
70
47
|
}
|
|
71
|
-
|
|
72
48
|
function updateOperation() {
|
|
73
49
|
var operation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
74
|
-
|
|
75
50
|
var newOperation = _objectSpread(_objectSpread({}, state.operation), operation);
|
|
76
|
-
|
|
77
51
|
setState(function (old) {
|
|
78
52
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
79
53
|
operation: newOperation
|
|
80
54
|
});
|
|
81
55
|
});
|
|
82
|
-
|
|
83
56
|
_nextTick(function () {
|
|
84
57
|
_SocketEmitter.emit(_OPERATION_EVENT_CHANGE_, newOperation);
|
|
85
|
-
|
|
86
58
|
_cache.setCache(_OPERATION_SESSION_, newOperation, 'session');
|
|
87
|
-
|
|
88
59
|
console.info('AppContext updateOperation is run !', operation);
|
|
89
60
|
});
|
|
90
61
|
}
|
|
91
|
-
|
|
92
62
|
function updateLoginStatus(status) {
|
|
93
63
|
if (typeof status !== 'boolean') {
|
|
94
64
|
throw new Error('status type is boolean !');
|
|
95
65
|
}
|
|
96
|
-
|
|
97
66
|
setState(function (old) {
|
|
98
67
|
return status !== old.loginStatus ? _objectSpread(_objectSpread({}, old), {}, {
|
|
99
68
|
loginStatus: status
|
|
100
69
|
}) : old;
|
|
101
70
|
});
|
|
102
|
-
|
|
103
71
|
_nextTick(function () {
|
|
104
72
|
_SocketEmitter.emit(_LOGIN_STATUS_EVENT_CHANGE_, status);
|
|
105
|
-
|
|
106
73
|
_cache.setCache(_LOGIN_STATUS_SESSION_, status, 'session');
|
|
107
|
-
|
|
108
74
|
console.info('AppContext updateLoginStatus is run !', status);
|
|
109
75
|
});
|
|
110
76
|
}
|
|
77
|
+
|
|
111
78
|
/**
|
|
112
79
|
* @desc 用于全局自定义状态存储,依赖sessionStorage持久化能力,不建议存储大数据量
|
|
113
80
|
* @param data
|
|
114
81
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
82
|
function updateStore() {
|
|
118
83
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
119
84
|
setState(function (old) {
|
|
120
|
-
var newData = {};
|
|
85
|
+
var newData = {};
|
|
121
86
|
|
|
87
|
+
//获取变更项
|
|
122
88
|
for (var _key in data) {
|
|
123
89
|
if (data[_key] !== old.store[_key]) {
|
|
124
90
|
newData[_key] = data[_key];
|
|
125
91
|
}
|
|
126
92
|
}
|
|
127
|
-
|
|
128
93
|
if (isEmpty(newData)) {
|
|
129
94
|
return old;
|
|
130
95
|
}
|
|
131
|
-
|
|
132
96
|
var newStore = _objectSpread(_objectSpread({}, old.store), newData);
|
|
133
|
-
|
|
134
97
|
_cache.setCache(_STORE_SESSION_, newStore, 'session');
|
|
135
|
-
|
|
136
98
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
137
99
|
store: newStore
|
|
138
100
|
});
|
|
139
101
|
});
|
|
140
|
-
|
|
141
102
|
_nextTick(function () {
|
|
142
103
|
_SocketEmitter.emit(_STORE_EVENT_CHANGE_, data);
|
|
143
|
-
|
|
144
104
|
console.info('AppContext updateStore is run !', data);
|
|
145
105
|
});
|
|
146
106
|
}
|
|
147
|
-
|
|
148
107
|
var stateChange = useCallback(function (options) {
|
|
149
108
|
return setState(function (old) {
|
|
150
109
|
return _objectSpread(_objectSpread({}, old), options);
|
|
@@ -168,7 +127,8 @@ function Provider(_ref) {
|
|
|
168
127
|
updateLoginStatus: updateLoginStatus,
|
|
169
128
|
updateStore: updateStore
|
|
170
129
|
};
|
|
171
|
-
},
|
|
130
|
+
},
|
|
131
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
172
132
|
[state.user, state.operation, state.loginStatus]);
|
|
173
133
|
return /*#__PURE__*/_jsxs(Context.Provider, {
|
|
174
134
|
value: providerValue,
|
|
@@ -178,7 +138,6 @@ function Provider(_ref) {
|
|
|
178
138
|
})]
|
|
179
139
|
});
|
|
180
140
|
}
|
|
181
|
-
|
|
182
141
|
export default {
|
|
183
142
|
Provider: Provider,
|
|
184
143
|
Context: Context
|
package/es/AutoExit/index.js
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
2
2
|
import React, { useContext, useEffect } from 'react';
|
|
3
|
-
import { useNavigate } from 'react-router-dom';
|
|
4
3
|
import AppContext from "../AppContext";
|
|
4
|
+
import useHistory from "../useHistory";
|
|
5
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
7
|
function AutoExit(_ref) {
|
|
9
8
|
var children = _ref.children;
|
|
10
|
-
|
|
11
9
|
var _useContext = useContext(AppContext.Context),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var navigate = useNavigate();
|
|
10
|
+
loginStatus = _useContext.loginStatus;
|
|
11
|
+
var history = useHistory();
|
|
15
12
|
useEffect(function () {
|
|
16
13
|
if (!loginStatus) {
|
|
17
14
|
_nextTick(function () {
|
|
18
|
-
return
|
|
15
|
+
return history.replace('/login');
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
|
-
}, [loginStatus
|
|
18
|
+
}, [loginStatus]);
|
|
22
19
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
23
20
|
children: loginStatus ? children : null
|
|
24
21
|
});
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
export default AutoExit;
|
package/es/Config/index.js
CHANGED
|
@@ -21,7 +21,6 @@ var Config = {
|
|
|
21
21
|
var index = draft.findIndex(function (v) {
|
|
22
22
|
return v === id;
|
|
23
23
|
});
|
|
24
|
-
|
|
25
24
|
if (index === -1) {
|
|
26
25
|
draft.push(id);
|
|
27
26
|
} else {
|
|
@@ -45,7 +44,6 @@ var Config = {
|
|
|
45
44
|
var index = draft.findIndex(function (v) {
|
|
46
45
|
return v.id === item.id;
|
|
47
46
|
});
|
|
48
|
-
|
|
49
47
|
if (index === -1) {
|
|
50
48
|
draft.push(item);
|
|
51
49
|
} else {
|
|
@@ -66,10 +64,8 @@ var Config = {
|
|
|
66
64
|
});
|
|
67
65
|
}
|
|
68
66
|
};
|
|
69
|
-
|
|
70
67
|
var LMConfig = function () {
|
|
71
68
|
var _global = window;
|
|
72
|
-
|
|
73
69
|
if (_global['_CONFIG_']) {
|
|
74
70
|
return _global['_CONFIG_'];
|
|
75
71
|
} else {
|
|
@@ -78,5 +74,4 @@ var LMConfig = function () {
|
|
|
78
74
|
return Config;
|
|
79
75
|
}
|
|
80
76
|
}();
|
|
81
|
-
|
|
82
77
|
export default LMConfig;
|
package/es/Config/utils.js
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
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
|
-
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; }
|
|
6
|
-
|
|
7
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
|
|
9
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
10
|
-
|
|
11
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
|
|
13
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); }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
7
|
var style = document.createElement('style');
|
|
22
8
|
var isInit = false;
|
|
23
9
|
export function insertThemeStyle(options) {
|
|
24
|
-
var _ref;
|
|
25
|
-
|
|
26
10
|
var tplStr = ':root{<content>}';
|
|
27
|
-
|
|
28
|
-
var attrArr = (_ref = []).concat.apply(_ref, _toConsumableArray(Object.values(options.vars)));
|
|
29
|
-
|
|
11
|
+
var attrArr = Object.values(options.vars).flat();
|
|
30
12
|
style.innerHTML = tplStr.replace('<content>', attrArr.reduce(function (a, b) {
|
|
31
13
|
var _b$split = b.split(':'),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
_b$split2 = _slicedToArray(_b$split, 2),
|
|
15
|
+
key = _b$split2[0],
|
|
16
|
+
value = _b$split2[1];
|
|
36
17
|
return a + "--".concat(key, ":").concat(value, ";\n");
|
|
37
18
|
}, ''));
|
|
38
|
-
|
|
39
19
|
if (!isInit) {
|
|
40
20
|
isInit = true;
|
|
41
21
|
document.head.appendChild(style);
|
|
@@ -6,7 +6,7 @@ export interface IConfigContextProps {
|
|
|
6
6
|
root: HTMLElement;
|
|
7
7
|
}
|
|
8
8
|
interface IProviderProps {
|
|
9
|
-
getContainer
|
|
9
|
+
getContainer: () => HTMLElement;
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
declare function Provider({ getContainer, children }: IProviderProps): JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
var Context = /*#__PURE__*/React.createContext(null);
|
|
4
|
-
|
|
5
4
|
function Provider(_ref) {
|
|
6
5
|
var getContainer = _ref.getContainer,
|
|
7
|
-
|
|
6
|
+
children = _ref.children;
|
|
8
7
|
var root = useMemo(function () {
|
|
9
8
|
return getContainer();
|
|
10
9
|
}, [getContainer]);
|
|
@@ -15,7 +14,6 @@ function Provider(_ref) {
|
|
|
15
14
|
children: children
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
Provider.defaultProps = {
|
|
20
18
|
getContainer: function getContainer() {
|
|
21
19
|
return document.body;
|
|
@@ -1,81 +1,63 @@
|
|
|
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); }
|
|
1
2
|
import _useClickAway from "ahooks/es/useClickAway";
|
|
2
3
|
import _useToggle3 from "ahooks/es/useToggle";
|
|
3
4
|
import _uuid from "@cloud-app-dev/utils/es/uuid";
|
|
4
5
|
var _excluded = ["children", "value", "customRender", "popupClassName", "getPopupContainer", "onChange", "selectAotoClose"];
|
|
5
|
-
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
-
|
|
8
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
12
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
-
|
|
14
12
|
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."); }
|
|
15
|
-
|
|
16
13
|
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); }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
14
|
+
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; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
22
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
|
|
24
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
-
|
|
26
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
-
|
|
28
19
|
import { Select } from 'antd';
|
|
29
20
|
import React, { useMemo, useRef } from 'react';
|
|
30
21
|
import "./index.less";
|
|
31
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
-
|
|
34
24
|
function CustomRenderSelect(_ref) {
|
|
35
25
|
var children = _ref.children,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
value = _ref.value,
|
|
27
|
+
customRender = _ref.customRender,
|
|
28
|
+
popupClassName = _ref.popupClassName,
|
|
29
|
+
getPopupContainer = _ref.getPopupContainer,
|
|
30
|
+
onChange = _ref.onChange,
|
|
31
|
+
_ref$selectAotoClose = _ref.selectAotoClose,
|
|
32
|
+
selectAotoClose = _ref$selectAotoClose === void 0 ? true : _ref$selectAotoClose,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
34
|
var classname = useMemo(function () {
|
|
46
35
|
return "custom-render-select-dropdown-".concat(_uuid());
|
|
47
36
|
}, []);
|
|
48
37
|
var domRef = useRef(null);
|
|
49
|
-
|
|
50
38
|
var _useToggle = _useToggle3(),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
39
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
40
|
+
open = _useToggle2[0],
|
|
41
|
+
_useToggle2$ = _useToggle2[1],
|
|
42
|
+
toggle = _useToggle2$.toggle,
|
|
43
|
+
set = _useToggle2$.set;
|
|
57
44
|
var getDoms = useMemo(function () {
|
|
58
45
|
return [function () {
|
|
59
46
|
var _domRef$current;
|
|
60
|
-
|
|
61
47
|
return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.querySelector('.custom-render-box');
|
|
62
48
|
}, function () {
|
|
63
49
|
return document.querySelector(".".concat(classname));
|
|
64
50
|
}];
|
|
65
51
|
}, [classname]);
|
|
66
|
-
|
|
67
52
|
_useClickAway(function () {
|
|
68
53
|
return set(false);
|
|
69
54
|
}, getDoms, ['click']);
|
|
70
|
-
|
|
71
55
|
var onSelectChange = function onSelectChange(v) {
|
|
72
56
|
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
73
|
-
|
|
74
57
|
if (selectAotoClose) {
|
|
75
58
|
set(false);
|
|
76
59
|
}
|
|
77
60
|
};
|
|
78
|
-
|
|
79
61
|
return /*#__PURE__*/_jsxs("div", {
|
|
80
62
|
className: "custom-render-select",
|
|
81
63
|
ref: domRef,
|
|
@@ -84,7 +66,6 @@ function CustomRenderSelect(_ref) {
|
|
|
84
66
|
popupClassName: "custom-render-select-dropdown ".concat(classname, " ").concat(popupClassName),
|
|
85
67
|
getPopupContainer: getPopupContainer ? getPopupContainer : function () {
|
|
86
68
|
var _domRef$current$paren, _domRef$current2, _domRef$current2$pare;
|
|
87
|
-
|
|
88
69
|
return (_domRef$current$paren = (_domRef$current2 = domRef.current) === null || _domRef$current2 === void 0 ? void 0 : (_domRef$current2$pare = _domRef$current2.parentElement) === null || _domRef$current2$pare === void 0 ? void 0 : _domRef$current2$pare.parentElement) !== null && _domRef$current$paren !== void 0 ? _domRef$current$paren : document.body;
|
|
89
70
|
},
|
|
90
71
|
open: open,
|
|
@@ -99,5 +80,4 @@ function CustomRenderSelect(_ref) {
|
|
|
99
80
|
})]
|
|
100
81
|
});
|
|
101
82
|
}
|
|
102
|
-
|
|
103
83
|
export default CustomRenderSelect;
|
|
@@ -1,44 +1,36 @@
|
|
|
1
1
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
2
|
var _excluded = ["renderItem", "itemHeight", "itemKey", "itemWidth", "reloadDeps", "getGridGap", "loadPage", "isNoMore", "threshold"];
|
|
3
|
-
|
|
4
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
|
-
|
|
6
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
|
-
|
|
8
5
|
import React, { useMemo, useRef } from 'react';
|
|
9
6
|
import GridList from "../GridList";
|
|
10
7
|
import useInfiniteScroll from "../useInfiniteScroll";
|
|
11
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
|
|
13
9
|
function DynamicGridList(_ref) {
|
|
14
10
|
var renderItem = _ref.renderItem,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
itemHeight = _ref.itemHeight,
|
|
12
|
+
itemKey = _ref.itemKey,
|
|
13
|
+
itemWidth = _ref.itemWidth,
|
|
14
|
+
reloadDeps = _ref.reloadDeps,
|
|
15
|
+
getGridGap = _ref.getGridGap,
|
|
16
|
+
loadPage = _ref.loadPage,
|
|
17
|
+
isNoMore = _ref.isNoMore,
|
|
18
|
+
threshold = _ref.threshold,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
20
|
var containerRef = useRef(null);
|
|
26
|
-
|
|
27
21
|
var _useInfiniteScroll = useInfiniteScroll(loadPage, {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
target: containerRef,
|
|
23
|
+
threshold: threshold,
|
|
24
|
+
isNoMore: isNoMore,
|
|
25
|
+
reloadDeps: reloadDeps
|
|
26
|
+
}),
|
|
27
|
+
data = _useInfiniteScroll.data,
|
|
28
|
+
noMore = _useInfiniteScroll.noMore;
|
|
36
29
|
_useUpdateEffect(function () {
|
|
37
30
|
if (noMore) {
|
|
38
31
|
console.warn('数据已全部加载完成');
|
|
39
32
|
}
|
|
40
33
|
}, [noMore]);
|
|
41
|
-
|
|
42
34
|
function getItemData(data) {
|
|
43
35
|
return {
|
|
44
36
|
key: data[itemKey],
|
|
@@ -46,15 +38,12 @@ function DynamicGridList(_ref) {
|
|
|
46
38
|
width: itemWidth
|
|
47
39
|
};
|
|
48
40
|
}
|
|
49
|
-
|
|
50
41
|
function getColumnCount(elementWidth, gridGap) {
|
|
51
42
|
return Math.floor((elementWidth + gridGap) / ((itemWidth !== null && itemWidth !== void 0 ? itemWidth : 0) + gridGap));
|
|
52
43
|
}
|
|
53
|
-
|
|
54
44
|
function getWindowMargin(windowHeight) {
|
|
55
45
|
return Math.round(windowHeight * 1.5);
|
|
56
46
|
}
|
|
57
|
-
|
|
58
47
|
var dataList = useMemo(function () {
|
|
59
48
|
return data ? data.list || [] : [];
|
|
60
49
|
}, [data]);
|
|
@@ -69,7 +58,6 @@ function DynamicGridList(_ref) {
|
|
|
69
58
|
getGridGap: getGridGap
|
|
70
59
|
});
|
|
71
60
|
}
|
|
72
|
-
|
|
73
61
|
DynamicGridList.defaultProps = {
|
|
74
62
|
reloadDeps: [],
|
|
75
63
|
className: '',
|
package/es/FullScreen/index.js
CHANGED
|
@@ -1,40 +1,29 @@
|
|
|
1
1
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
|
-
|
|
3
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
3
|
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."); }
|
|
6
|
-
|
|
7
4
|
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); }
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
5
|
+
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; }
|
|
6
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
8
|
import React from 'react';
|
|
16
9
|
import IconFont from "../IconFont";
|
|
17
10
|
import useFullscreen from "../useFullscreen";
|
|
18
11
|
import "./index.less";
|
|
19
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
|
|
22
14
|
function FullScreen(_ref) {
|
|
23
15
|
var className = _ref.className,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
getContainer = _ref.getContainer,
|
|
17
|
+
fullScreenChange = _ref.fullScreenChange,
|
|
18
|
+
hasText = _ref.hasText;
|
|
28
19
|
var _useFullscreen = useFullscreen(getContainer),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
21
|
+
isFullscreen = _useFullscreen2[0],
|
|
22
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
33
23
|
_useUpdateEffect(function () {
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
fullScreenChange === null || fullScreenChange === void 0 ? void 0 : fullScreenChange(isFullscreen);
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
26
|
}, [isFullscreen]);
|
|
37
|
-
|
|
38
27
|
return /*#__PURE__*/_jsxs("span", {
|
|
39
28
|
className: "tools-screen-layer ".concat(className !== null && className !== void 0 ? className : ''),
|
|
40
29
|
onClick: toggleFullscreen,
|
|
@@ -44,5 +33,4 @@ function FullScreen(_ref) {
|
|
|
44
33
|
}), hasText ? !isFullscreen ? '全屏' : '窗口' : undefined]
|
|
45
34
|
});
|
|
46
35
|
}
|
|
47
|
-
|
|
48
36
|
export default FullScreen;
|