@cloud-app-dev/vidc 3.1.16 → 3.1.18
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/ThemeAntd/index.css +15 -0
- package/es/ThemeAntd/style/select.css +15 -0
- 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
|
@@ -3,55 +3,43 @@ import _Badge from "antd/lib/badge";
|
|
|
3
3
|
import "antd/lib/checkbox/style";
|
|
4
4
|
import _Checkbox from "antd/lib/checkbox";
|
|
5
5
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
6
|
-
|
|
7
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
7
|
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."); }
|
|
10
|
-
|
|
11
8
|
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); }
|
|
12
|
-
|
|
13
9
|
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
|
-
|
|
15
10
|
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; }
|
|
16
|
-
|
|
17
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
12
|
import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
20
13
|
import "./index.css";
|
|
21
|
-
|
|
22
14
|
function CheckGroupFixed(_ref) {
|
|
23
15
|
var label = _ref.label,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
_ref$source = _ref.source,
|
|
17
|
+
source = _ref$source === void 0 ? [] : _ref$source,
|
|
18
|
+
_ref$checboxSize = _ref.checboxSize,
|
|
19
|
+
checboxSize = _ref$checboxSize === void 0 ? 120 : _ref$checboxSize,
|
|
20
|
+
_ref$cutRow = _ref.cutRow,
|
|
21
|
+
cutRow = _ref$cutRow === void 0 ? 1 : _ref$cutRow,
|
|
22
|
+
_ref$labelSize = _ref.labelSize,
|
|
23
|
+
labelSize = _ref$labelSize === void 0 ? 100 : _ref$labelSize,
|
|
24
|
+
value = _ref.value,
|
|
25
|
+
onChange = _ref.onChange;
|
|
35
26
|
var _useState = useState({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
visible: false,
|
|
28
|
+
sider: false,
|
|
29
|
+
pos: [0, 0],
|
|
30
|
+
w: 0,
|
|
31
|
+
selectKeys: value || []
|
|
32
|
+
}),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
state = _useState2[0],
|
|
35
|
+
setState = _useState2[1];
|
|
46
36
|
var domRef = useRef(null);
|
|
47
37
|
useLayoutEffect(function () {
|
|
48
38
|
var _a, _b;
|
|
49
|
-
|
|
50
39
|
var contentEle = (_a = domRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('.check-content-box');
|
|
51
40
|
var contentRect = (contentEle === null || contentEle === void 0 ? void 0 : contentEle.getBoundingClientRect()) || {
|
|
52
41
|
width: 0
|
|
53
42
|
};
|
|
54
|
-
|
|
55
43
|
if (contentRect.width < checboxSize * source.length) {
|
|
56
44
|
var lr = (_b = domRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
57
45
|
setState(function (old) {
|
|
@@ -74,11 +62,9 @@ function CheckGroupFixed(_ref) {
|
|
|
74
62
|
boxShadow: ' 0 0 10px rgba(0,0,0,0.1)'
|
|
75
63
|
} : {};
|
|
76
64
|
}, [state.sider, state.w, state.pos]);
|
|
77
|
-
|
|
78
65
|
_useUpdateEffect(function () {
|
|
79
66
|
return onChange === null || onChange === void 0 ? void 0 : onChange(state.selectKeys);
|
|
80
67
|
}, [state.selectKeys]);
|
|
81
|
-
|
|
82
68
|
useLayoutEffect(function () {
|
|
83
69
|
var dom = domRef.current.querySelector('.check-box-group-layout');
|
|
84
70
|
dom === null || dom === void 0 ? void 0 : dom.setAttribute('style', "grid-template-columns:repeat(auto-fill, minmax(".concat(checboxSize, "px, 1fr));"));
|
|
@@ -146,5 +132,4 @@ function CheckGroupFixed(_ref) {
|
|
|
146
132
|
}
|
|
147
133
|
}));
|
|
148
134
|
}
|
|
149
|
-
|
|
150
135
|
export default CheckGroupFixed;
|
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 {
|
|
@@ -67,7 +65,6 @@ var Config = {
|
|
|
67
65
|
return getComputedStyle(document.querySelector(':root')).getPropertyValue("--".concat(themeKey));
|
|
68
66
|
}
|
|
69
67
|
};
|
|
70
|
-
|
|
71
68
|
var LMConfig = function () {
|
|
72
69
|
if (window['_CONFIG_']) {
|
|
73
70
|
return window['_CONFIG_'];
|
|
@@ -77,5 +74,4 @@ var LMConfig = function () {
|
|
|
77
74
|
return Config;
|
|
78
75
|
}
|
|
79
76
|
}();
|
|
80
|
-
|
|
81
77
|
export default LMConfig;
|
package/es/Config/utils.js
CHANGED
|
@@ -1,41 +1,26 @@
|
|
|
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 _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
4
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
|
|
9
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
10
|
-
|
|
11
6
|
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
7
|
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
8
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
-
|
|
17
9
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
18
|
-
|
|
19
10
|
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
|
-
|
|
21
11
|
var style = document.createElement('style');
|
|
22
12
|
var isInit = false;
|
|
23
13
|
export function insertThemeStyle(options) {
|
|
24
14
|
var _ref;
|
|
25
|
-
|
|
26
15
|
var tplStr = ':root{<content>}';
|
|
27
|
-
|
|
28
16
|
var attrArr = (_ref = []).concat.apply(_ref, _toConsumableArray(Object.values(options.vars)));
|
|
29
|
-
|
|
30
17
|
style.innerHTML = tplStr.replace('<content>', attrArr.reduce(function (a, b) {
|
|
31
18
|
var _b$split = b.split(':'),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
_b$split2 = _slicedToArray(_b$split, 2),
|
|
20
|
+
key = _b$split2[0],
|
|
21
|
+
value = _b$split2[1];
|
|
36
22
|
return a + "--".concat(key, ":").concat(value, ";\n");
|
|
37
23
|
}, ''));
|
|
38
|
-
|
|
39
24
|
if (!isInit) {
|
|
40
25
|
isInit = true;
|
|
41
26
|
document.head.appendChild(style);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
var Context = /*#__PURE__*/React.createContext(null);
|
|
3
|
-
|
|
4
3
|
function Provider(_ref) {
|
|
5
4
|
var getContainer = _ref.getContainer,
|
|
6
|
-
|
|
5
|
+
children = _ref.children;
|
|
7
6
|
var root = useMemo(function () {
|
|
8
7
|
return getContainer();
|
|
9
8
|
}, [getContainer]);
|
|
@@ -13,7 +12,6 @@ function Provider(_ref) {
|
|
|
13
12
|
}
|
|
14
13
|
}, children);
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
Provider.defaultProps = {
|
|
18
16
|
getContainer: function getContainer() {
|
|
19
17
|
return document.body;
|
|
@@ -3,46 +3,35 @@ import _Select from "antd/lib/select";
|
|
|
3
3
|
import _useClickAway from "ahooks/es/useClickAway";
|
|
4
4
|
import _useToggle3 from "ahooks/es/useToggle";
|
|
5
5
|
import _uuid from "@cloud-app-dev/utils/es/uuid";
|
|
6
|
-
|
|
7
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
7
|
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."); }
|
|
10
|
-
|
|
11
8
|
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); }
|
|
12
|
-
|
|
13
9
|
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
|
-
|
|
15
10
|
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; }
|
|
16
|
-
|
|
17
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
12
|
import { __rest } from "tslib";
|
|
20
13
|
import React, { useMemo, useRef } from 'react';
|
|
21
14
|
import "./index.css";
|
|
22
|
-
|
|
23
15
|
function CustomRenderSelect(_a) {
|
|
24
16
|
var children = _a.children,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
value = _a.value,
|
|
18
|
+
customRender = _a.customRender,
|
|
19
|
+
popupClassName = _a.popupClassName,
|
|
20
|
+
getPopupContainer = _a.getPopupContainer,
|
|
21
|
+
onChange = _a.onChange,
|
|
22
|
+
_a$selectAotoClose = _a.selectAotoClose,
|
|
23
|
+
selectAotoClose = _a$selectAotoClose === void 0 ? true : _a$selectAotoClose,
|
|
24
|
+
props = __rest(_a, ["children", "value", "customRender", "popupClassName", "getPopupContainer", "onChange", "selectAotoClose"]);
|
|
34
25
|
var classname = useMemo(function () {
|
|
35
26
|
return "custom-render-select-dropdown-".concat(_uuid());
|
|
36
27
|
}, []);
|
|
37
28
|
var domRef = useRef(null);
|
|
38
|
-
|
|
39
29
|
var _useToggle = _useToggle3(),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
31
|
+
open = _useToggle2[0],
|
|
32
|
+
_useToggle2$ = _useToggle2[1],
|
|
33
|
+
toggle = _useToggle2$.toggle,
|
|
34
|
+
set = _useToggle2$.set;
|
|
46
35
|
var getDoms = useMemo(function () {
|
|
47
36
|
return [function () {
|
|
48
37
|
return domRef.current.querySelector('.custom-render-box');
|
|
@@ -50,19 +39,15 @@ function CustomRenderSelect(_a) {
|
|
|
50
39
|
return document.querySelector(".".concat(classname));
|
|
51
40
|
}];
|
|
52
41
|
}, []);
|
|
53
|
-
|
|
54
42
|
_useClickAway(function () {
|
|
55
43
|
return set(false);
|
|
56
44
|
}, getDoms, ['click']);
|
|
57
|
-
|
|
58
45
|
var onSelectChange = function onSelectChange(v) {
|
|
59
46
|
onChange && onChange(v);
|
|
60
|
-
|
|
61
47
|
if (selectAotoClose) {
|
|
62
48
|
set(false);
|
|
63
49
|
}
|
|
64
50
|
};
|
|
65
|
-
|
|
66
51
|
return /*#__PURE__*/React.createElement("div", {
|
|
67
52
|
className: "custom-render-select",
|
|
68
53
|
ref: domRef
|
|
@@ -81,5 +66,4 @@ function CustomRenderSelect(_a) {
|
|
|
81
66
|
className: "popup-container"
|
|
82
67
|
}));
|
|
83
68
|
}
|
|
84
|
-
|
|
85
69
|
export default CustomRenderSelect;
|
package/es/DisableMark/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import "./index.css";
|
|
3
3
|
export default function DisableMark(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
disabled = _ref.disabled,
|
|
6
|
+
width = _ref.width;
|
|
7
7
|
return /*#__PURE__*/React.createElement("div", {
|
|
8
8
|
style: {
|
|
9
9
|
width: '100%',
|
package/es/DomMove/index.js
CHANGED
|
@@ -3,16 +3,15 @@ import _useUpdate from "ahooks/es/useUpdate";
|
|
|
3
3
|
import _useSize from "ahooks/es/useSize";
|
|
4
4
|
import React, { useEffect, useImperativeHandle, useRef } from 'react';
|
|
5
5
|
import { getPosition, getMouseXY } from './utils';
|
|
6
|
-
|
|
7
6
|
function DomMove(_ref) {
|
|
8
7
|
var onDrag = _ref.onDrag,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
position = _ref.position,
|
|
9
|
+
className = _ref.className,
|
|
10
|
+
size = _ref.size,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
onDragChange = _ref.onDragChange,
|
|
13
|
+
onDragEnd = _ref.onDragEnd,
|
|
14
|
+
forwordRef = _ref.forwordRef;
|
|
16
15
|
var dragRef = useRef(null);
|
|
17
16
|
var ref = useRef({
|
|
18
17
|
position: {
|
|
@@ -32,12 +31,10 @@ function DomMove(_ref) {
|
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
33
|
var reSize = _useSize(dragRef) || {};
|
|
35
|
-
|
|
36
34
|
var update = _useUpdate();
|
|
37
|
-
|
|
38
35
|
var updatePosition = function updatePosition(_ref2) {
|
|
39
36
|
var x = _ref2.x,
|
|
40
|
-
|
|
37
|
+
y = _ref2.y;
|
|
41
38
|
ref.current.position = {
|
|
42
39
|
x: x,
|
|
43
40
|
y: y
|
|
@@ -48,7 +45,6 @@ function DomMove(_ref) {
|
|
|
48
45
|
y: y
|
|
49
46
|
});
|
|
50
47
|
};
|
|
51
|
-
|
|
52
48
|
useEffect(function () {
|
|
53
49
|
var offset = getPosition(dragRef === null || dragRef === void 0 ? void 0 : dragRef.current);
|
|
54
50
|
ref.current.deviation = {
|
|
@@ -57,31 +53,28 @@ function DomMove(_ref) {
|
|
|
57
53
|
width: reSize.width,
|
|
58
54
|
height: reSize.height
|
|
59
55
|
};
|
|
60
|
-
}, [reSize.width, reSize.height]);
|
|
61
|
-
|
|
56
|
+
}, [reSize.width, reSize.height]);
|
|
57
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
58
|
useImperativeHandle(forwordRef, function () {
|
|
63
59
|
return {
|
|
64
60
|
updatePosition: updatePosition
|
|
65
61
|
};
|
|
66
62
|
}, []);
|
|
67
|
-
|
|
68
63
|
_useEventListener('mousemove', function (event) {
|
|
69
64
|
if (ref.current.isDrag) {
|
|
70
65
|
// let maxX, maxY;
|
|
71
66
|
var moveX, moveY;
|
|
72
|
-
|
|
73
67
|
var _getMouseXY = getMouseXY(event),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
_x = _getMouseXY.x,
|
|
69
|
+
_y = _getMouseXY.y;
|
|
77
70
|
moveX = _x - ref.current.deviation.offsetX;
|
|
78
|
-
moveY = _y - ref.current.deviation.offsetY;
|
|
71
|
+
moveY = _y - ref.current.deviation.offsetY;
|
|
72
|
+
// 计算可移动位置的大小, 保证元素不会超过可移动范围
|
|
79
73
|
// maxX = document.documentElement.clientWidth - this.deviation.width;
|
|
80
74
|
// maxY = document.documentElement.clientHeight - this.deviation.height;
|
|
81
75
|
// min方法保证不会超过右边界,max保证不会超过左边界
|
|
82
76
|
// moveX = Math.min(Math.max(0, moveX), maxX);
|
|
83
77
|
// moveY = Math.min(Math.max(0, moveY), maxY);
|
|
84
|
-
|
|
85
78
|
var _position = {
|
|
86
79
|
x: moveX,
|
|
87
80
|
y: moveY
|
|
@@ -91,36 +84,31 @@ function DomMove(_ref) {
|
|
|
91
84
|
}, {
|
|
92
85
|
target: document.body
|
|
93
86
|
});
|
|
94
|
-
|
|
95
87
|
_useEventListener('mouseup', function (event) {
|
|
96
88
|
ref.current.isDrag = false;
|
|
97
89
|
onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event, ref.current.position);
|
|
98
90
|
}, {
|
|
99
91
|
target: document.body
|
|
100
92
|
});
|
|
101
|
-
|
|
102
93
|
_useEventListener('mousedown', function (event) {
|
|
103
94
|
var _getMouseXY2 = getMouseXY(event),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
x = _getMouseXY2.x,
|
|
96
|
+
y = _getMouseXY2.y;
|
|
107
97
|
ref.current.deviation.offsetX = x - ref.current.position.x;
|
|
108
98
|
ref.current.deviation.offsetY = y - ref.current.position.y;
|
|
109
99
|
ref.current.isDrag = true;
|
|
110
100
|
}, {
|
|
111
101
|
target: dragRef
|
|
112
102
|
});
|
|
113
|
-
|
|
114
103
|
var _ref3 = onDrag ? {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
104
|
+
x: position.x,
|
|
105
|
+
y: position.y
|
|
106
|
+
} : {
|
|
107
|
+
x: ref.current.position.x,
|
|
108
|
+
y: ref.current.position.y
|
|
109
|
+
},
|
|
110
|
+
x = _ref3.x,
|
|
111
|
+
y = _ref3.y;
|
|
124
112
|
return /*#__PURE__*/React.createElement("div", {
|
|
125
113
|
ref: dragRef,
|
|
126
114
|
className: "drag-move-Content ".concat(className),
|
|
@@ -131,7 +119,6 @@ function DomMove(_ref) {
|
|
|
131
119
|
}
|
|
132
120
|
}, children);
|
|
133
121
|
}
|
|
134
|
-
|
|
135
122
|
DomMove.defaultProps = {
|
|
136
123
|
className: '',
|
|
137
124
|
size: {
|
package/es/DomMove/utils.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
export function getPosition(obj) {
|
|
2
2
|
//获取某元素以浏览器左上角为原点的坐标
|
|
3
3
|
var t = obj.offsetTop; //获取该元素对应父容器的上边距
|
|
4
|
-
|
|
5
4
|
var l = obj.offsetLeft; //对应父容器的上边距
|
|
6
5
|
//判断是否有父容器,如果存在则累加其边距
|
|
7
|
-
|
|
8
6
|
while (obj = obj.offsetParent) {
|
|
9
7
|
//等效 obj = obj.offsetParent;while (obj != undefined)
|
|
10
8
|
t += obj.offsetTop; //叠加父容器的上边距
|
|
11
|
-
|
|
12
9
|
l += obj.offsetLeft; //叠加父容器的左边距
|
|
13
10
|
}
|
|
14
11
|
|
|
@@ -16,13 +13,12 @@ export function getPosition(obj) {
|
|
|
16
13
|
left: l,
|
|
17
14
|
top: t
|
|
18
15
|
};
|
|
19
|
-
}
|
|
20
|
-
|
|
16
|
+
}
|
|
17
|
+
// 函数用于获取鼠标的位置
|
|
21
18
|
export function getMouseXY(e) {
|
|
22
19
|
var x = 0,
|
|
23
|
-
|
|
20
|
+
y = 0;
|
|
24
21
|
e = e || window.event;
|
|
25
|
-
|
|
26
22
|
if (e.pageX) {
|
|
27
23
|
x = e.pageX;
|
|
28
24
|
y = e.pageY;
|
|
@@ -30,7 +26,6 @@ export function getMouseXY(e) {
|
|
|
30
26
|
x = e.clientX + document.body.scrollLeft - document.body.clientLeft;
|
|
31
27
|
y = e.clientY + document.body.scrollTop - document.body.clientTop;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
return {
|
|
35
30
|
x: x,
|
|
36
31
|
y: y
|
|
@@ -1,42 +1,31 @@
|
|
|
1
1
|
import _uuid from "@cloud-app-dev/utils/es/uuid";
|
|
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
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; }
|
|
10
|
-
|
|
11
6
|
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
|
-
|
|
13
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
8
|
import React, { useState, useCallback } from 'react';
|
|
16
9
|
import { useRef, useMemo } from 'react';
|
|
17
|
-
|
|
18
10
|
function DragAndDropItem(_ref) {
|
|
19
11
|
var children = _ref.children,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
dragData = _ref.dragData,
|
|
13
|
+
dragId = _ref.dragId,
|
|
14
|
+
style = _ref.style,
|
|
15
|
+
onDropEnd = _ref.onDropEnd,
|
|
16
|
+
_ref$disabledCopyElem = _ref.disabledCopyElement,
|
|
17
|
+
disabledCopyElement = _ref$disabledCopyElem === void 0 ? true : _ref$disabledCopyElem;
|
|
26
18
|
var id = useMemo(function () {
|
|
27
19
|
return dragId || "dragId-".concat(_uuid());
|
|
28
20
|
}, [dragId]);
|
|
29
|
-
|
|
30
21
|
var _useState = useState(['', '']),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
status = _useState2[0],
|
|
24
|
+
setStatus = _useState2[1];
|
|
35
25
|
var _useState3 = useState([0, 0]),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
offset = _useState4[0],
|
|
28
|
+
setOffset = _useState4[1];
|
|
40
29
|
var domRef = useRef(null);
|
|
41
30
|
var dragDomTemp = useRef(null);
|
|
42
31
|
var onDrop = useCallback(function (event) {
|
|
@@ -66,22 +55,19 @@ function DragAndDropItem(_ref) {
|
|
|
66
55
|
if (!domRef.current) {
|
|
67
56
|
return;
|
|
68
57
|
}
|
|
69
|
-
|
|
70
58
|
if (!disabledCopyElement) {
|
|
71
59
|
var pageX = event.pageX,
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
pageY = event.pageY;
|
|
74
61
|
var _domRef$current$getBo = domRef.current.getBoundingClientRect(),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
x = _domRef$current$getBo.x,
|
|
63
|
+
y = _domRef$current$getBo.y,
|
|
64
|
+
width = _domRef$current$getBo.width,
|
|
65
|
+
height = _domRef$current$getBo.height;
|
|
80
66
|
var offsetX = pageX - x;
|
|
81
67
|
var offsetY = pageY - y;
|
|
82
68
|
dragDomTemp.current = domRef.current.cloneNode(true);
|
|
83
|
-
domRef.current.after(dragDomTemp.current);
|
|
84
|
-
|
|
69
|
+
domRef.current.after(dragDomTemp.current);
|
|
70
|
+
//初始化缓存dom位置
|
|
85
71
|
dragDomTemp.current.style.position = 'fixed';
|
|
86
72
|
dragDomTemp.current.style.left = "".concat(event.pageX - offsetX, "px");
|
|
87
73
|
dragDomTemp.current.style.top = "".concat(event.pageY - offsetY, "px");
|
|
@@ -94,7 +80,6 @@ function DragAndDropItem(_ref) {
|
|
|
94
80
|
setOffset([offsetX, offsetY]);
|
|
95
81
|
event.dataTransfer.setDragImage(new Image(), 0, 0);
|
|
96
82
|
}
|
|
97
|
-
|
|
98
83
|
setStatus(function (old) {
|
|
99
84
|
return ['draging', old[1]];
|
|
100
85
|
});
|
|
@@ -115,11 +100,9 @@ function DragAndDropItem(_ref) {
|
|
|
115
100
|
if (e.pageX === 0 && e.pageY === 0) {
|
|
116
101
|
return;
|
|
117
102
|
}
|
|
118
|
-
|
|
119
103
|
if (e.pageX < offset[2] || e.pageY < offset[3]) {
|
|
120
104
|
return;
|
|
121
105
|
}
|
|
122
|
-
|
|
123
106
|
dragDomTemp.current.style.position = 'fixed';
|
|
124
107
|
dragDomTemp.current.style.left = "".concat(e.pageX - offset[0], "px");
|
|
125
108
|
dragDomTemp.current.style.top = "".concat(e.pageY - offset[1], "px");
|
|
@@ -141,5 +124,4 @@ function DragAndDropItem(_ref) {
|
|
|
141
124
|
})
|
|
142
125
|
});
|
|
143
126
|
}
|
|
144
|
-
|
|
145
127
|
export default DragAndDropItem;
|
package/es/Drag/DropItem.js
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
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, useCallback } from 'react';
|
|
14
8
|
import { useRef } from 'react';
|
|
15
|
-
|
|
16
9
|
function DropItem(_ref) {
|
|
17
10
|
var children = _ref.children,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
style = _ref.style,
|
|
12
|
+
onDropEnd = _ref.onDropEnd;
|
|
21
13
|
var _useState = useState(''),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
status = _useState2[0],
|
|
16
|
+
setStatus = _useState2[1];
|
|
26
17
|
var domRef = useRef(null);
|
|
27
18
|
var onDrop = useCallback(function (event) {
|
|
28
19
|
event.stopPropagation();
|
|
@@ -50,5 +41,4 @@ function DropItem(_ref) {
|
|
|
50
41
|
style: status === 'dragenter' ? Object.assign({}, style) : undefined
|
|
51
42
|
});
|
|
52
43
|
}
|
|
53
|
-
|
|
54
44
|
export default DropItem;
|