@cloud-app-dev/vidc 4.0.8 → 4.0.10

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.
Files changed (116) hide show
  1. package/.dumirc.ts +0 -10
  2. package/.fatherrc.ts +1 -4
  3. package/es/AppContext/Sync.js +10 -24
  4. package/es/AppContext/index.js +19 -19
  5. package/es/AppContext/static.js +0 -6
  6. package/es/Auth/index.js +2 -5
  7. package/es/AutoExit/index.js +2 -2
  8. package/es/CheckGroupFixed/demo.js +0 -2
  9. package/es/CheckGroupFixed/index.js +25 -42
  10. package/es/CustomRenderSelect/index.js +2 -2
  11. package/es/DisableMark/index.js +2 -2
  12. package/es/DomMove/index.js +31 -42
  13. package/es/DomMove/utils.js +3 -8
  14. package/es/Drag/DragAndDropItem.js +28 -45
  15. package/es/Drag/DropItem.js +11 -21
  16. package/es/DynamicGridList/Demo.js +1 -13
  17. package/es/DynamicList/demo.js +1 -10
  18. package/es/DynamicList/index.js +27 -41
  19. package/es/ErrorFallback/index.js +1 -3
  20. package/es/EventTools/index.d.ts +3 -0
  21. package/es/EventTools/index.js +12 -0
  22. package/es/GridList/Demo.js +5 -18
  23. package/es/GridList/utils.js +0 -1
  24. package/es/HightLevel/index.js +1 -5
  25. package/es/IconFont/index.js +9 -18
  26. package/es/InstanceHistory/index.js +0 -2
  27. package/es/ListWithSizeAnimate/index.js +15 -31
  28. package/es/LoaderScript/index.js +10 -21
  29. package/es/LoaderScript/utils.js +2 -2
  30. package/es/Map/BasicMap/AMapInstance.js +6 -16
  31. package/es/Map/BasicMap/LeafletInstance.js +16 -26
  32. package/es/Map/ClusterLayer/hook.js +16 -38
  33. package/es/Map/ClusterLayer/index.js +2 -6
  34. package/es/Map/Context/index.js +6 -30
  35. package/es/Map/FindPio/index.js +0 -2
  36. package/es/Map/LevelCenter/DragMarker/index.js +6 -9
  37. package/es/Map/LevelCenter/demo.js +12 -21
  38. package/es/Map/LevelCenter/index.js +8 -14
  39. package/es/Map/LoaderMap/index.js +14 -17
  40. package/es/Map/MapDrawSelect/demo.js +14 -25
  41. package/es/Map/MapDrawSelect/index.js +14 -20
  42. package/es/Map/MouseTool/index.js +17 -27
  43. package/es/Map/MouseTool/useMouseTools.js +12 -35
  44. package/es/Map/ResetTools/index.js +4 -8
  45. package/es/Map/SinglePoint/index.js +6 -13
  46. package/es/Map/hook/useMapEvent.js +3 -7
  47. package/es/Map/hook/useMapType.js +1 -2
  48. package/es/Map/useMarker/index.js +17 -30
  49. package/es/Map/withMap/index.js +4 -6
  50. package/es/Picture/component/DefaultRects/RectInfo.js +13 -27
  51. package/es/Picture/component/DefaultRects/index.js +7 -10
  52. package/es/Picture/component/DrawRect/index.js +10 -13
  53. package/es/Picture/component/RectMenu/index.js +10 -15
  54. package/es/Picture/component/RectMenu/utils.js +3 -6
  55. package/es/Picture/component/WheelScale/index.js +3 -5
  56. package/es/Picture/loadCaptureRectImage.js +42 -61
  57. package/es/Picture/useDraw.js +23 -39
  58. package/es/Player/api/index.js +2 -2
  59. package/es/Player/context.js +5 -9
  60. package/es/Player/contraller_bar/bar.js +9 -16
  61. package/es/Player/contraller_bar/contraller_event.js +7 -25
  62. package/es/Player/contraller_bar/index.js +7 -9
  63. package/es/Player/contraller_bar/left_bar.js +17 -29
  64. package/es/Player/contraller_bar/time.js +5 -14
  65. package/es/Player/contraller_bar/useBarStatus.js +12 -24
  66. package/es/Player/contraller_bar/volume.js +9 -29
  67. package/es/Player/event/eventName.js +1 -1
  68. package/es/Player/event/index.js +28 -63
  69. package/es/Player/frontend_player.js +16 -27
  70. package/es/Player/iconfont.js +6 -12
  71. package/es/Player/live_heart.js +2 -18
  72. package/es/Player/message.js +15 -35
  73. package/es/Player/segment_player.js +48 -86
  74. package/es/Player/timeline.js +19 -41
  75. package/es/PlayerExt/demo.js +15 -25
  76. package/es/PlayerExt/index.js +29 -51
  77. package/es/ROI/demo.js +0 -2
  78. package/es/ScreenPlayer/Record.js +1 -1
  79. package/es/ScreenPlayer/TimeMode.js +1 -3
  80. package/es/ScreenPlayer/useTimeSlider.js +3 -3
  81. package/es/SocketEmitter/eventEmitter.d.ts +27 -0
  82. package/es/SocketEmitter/eventEmitter.js +87 -0
  83. package/es/SocketEmitter/index.d.ts +24 -0
  84. package/es/SocketEmitter/index.js +125 -0
  85. package/es/SocketEmitter/interface.d.ts +4 -0
  86. package/es/ThemeAntd/demo.js +0 -2
  87. package/es/VList/utils.js +2 -3
  88. package/es/bigNumberTransformCN/index.d.ts +5 -0
  89. package/es/bigNumberTransformCN/index.js +60 -0
  90. package/es/cache/index.d.ts +34 -0
  91. package/es/cache/index.js +94 -0
  92. package/es/copy/index.d.ts +1 -0
  93. package/es/copy/index.js +9 -0
  94. package/es/getThemeStyle/index.d.ts +2 -0
  95. package/es/getThemeStyle/index.js +5 -0
  96. package/es/index.d.ts +11 -0
  97. package/es/index.js +12 -1
  98. package/es/logger/index.d.ts +7 -0
  99. package/es/logger/index.js +30 -0
  100. package/es/nextTick/index.d.ts +1 -0
  101. package/es/nextTick/index.js +7 -0
  102. package/es/submidstr/index.d.ts +5 -0
  103. package/es/submidstr/index.js +14 -0
  104. package/es/treeHelper/index.d.ts +11 -0
  105. package/es/treeHelper/index.js +173 -0
  106. package/es/useEventEmitterHandle/index.js +5 -9
  107. package/es/useFullscreen/demo.js +8 -18
  108. package/es/useFullscreen/index.js +7 -28
  109. package/es/useHistory/index.js +0 -2
  110. package/es/useRafInterval/index.js +3 -27
  111. package/es/useSimpleState/index.js +11 -22
  112. package/es/useVirtualList/index.js +21 -57
  113. package/es/utils.js +2 -2
  114. package/es/uuid/index.d.ts +4 -0
  115. package/es/uuid/index.js +15 -0
  116. package/package.json +6 -3
package/.dumirc.ts CHANGED
@@ -15,16 +15,6 @@ export default defineConfig({
15
15
  entryFile: './src/index.ts',
16
16
  },
17
17
  extraBabelPlugins: [
18
- [
19
- 'import',
20
- {
21
- libraryName: '@cloud-app-dev/utils',
22
- style: false,
23
- camel2DashComponentName: false,
24
- libraryDirectory: 'es',
25
- },
26
- 'utils',
27
- ],
28
18
  [
29
19
  'import',
30
20
  {
package/.fatherrc.ts CHANGED
@@ -11,8 +11,5 @@ export default defineConfig({
11
11
  esm: {
12
12
  output: 'es',
13
13
  },
14
- extraBabelPlugins: [
15
- ['import', { libraryName: '@cloud-app-dev/utils', ...importProps }, 'utils'],
16
- ['import', { libraryName: 'ahooks', ...importProps }, 'ahooks'],
17
- ],
14
+ extraBabelPlugins: [['import', { libraryName: 'ahooks', ...importProps }, 'ahooks']],
18
15
  });
@@ -1,13 +1,11 @@
1
- import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
2
1
  import React, { useEffect } from 'react';
3
2
  import { _LOGIN_STATUS_EVENT_CHANGE_, _OPERATION_EVENT_CHANGE_, _USER_EVENT_CHANGE_, _STORE_EVENT_CHANGE_ } from "./static";
3
+ import SocketEmitter from "../SocketEmitter";
4
4
  import { Fragment as _Fragment } from "react/jsx-runtime";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
-
7
6
  function Sync(_ref) {
8
7
  var stateChange = _ref.stateChange,
9
- storeChange = _ref.storeChange;
10
-
8
+ storeChange = _ref.storeChange;
11
9
  /**
12
10
  * @description 用户微应用之间的状态同步
13
11
  */
@@ -17,42 +15,30 @@ function Sync(_ref) {
17
15
  user: user
18
16
  });
19
17
  };
20
-
21
18
  var operationFn = function operationFn(operation) {
22
19
  return stateChange({
23
20
  operation: operation
24
21
  });
25
22
  };
26
-
27
23
  var statusFn = function statusFn(status) {
28
24
  return stateChange({
29
25
  loginStatus: status
30
26
  });
31
27
  };
32
-
33
28
  var storeFn = function storeFn(store) {
34
29
  return storeChange(store);
35
30
  };
36
-
37
- _SocketEmitter.on(_USER_EVENT_CHANGE_, userFn);
38
-
39
- _SocketEmitter.on(_OPERATION_EVENT_CHANGE_, operationFn);
40
-
41
- _SocketEmitter.on(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
42
-
43
- _SocketEmitter.on(_STORE_EVENT_CHANGE_, storeFn);
44
-
31
+ SocketEmitter.on(_USER_EVENT_CHANGE_, userFn);
32
+ SocketEmitter.on(_OPERATION_EVENT_CHANGE_, operationFn);
33
+ SocketEmitter.on(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
34
+ SocketEmitter.on(_STORE_EVENT_CHANGE_, storeFn);
45
35
  return function () {
46
- _SocketEmitter.off(_USER_EVENT_CHANGE_, userFn);
47
-
48
- _SocketEmitter.off(_OPERATION_EVENT_CHANGE_, operationFn);
49
-
50
- _SocketEmitter.off(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
51
-
52
- _SocketEmitter.off(_STORE_EVENT_CHANGE_, storeFn);
36
+ SocketEmitter.off(_USER_EVENT_CHANGE_, userFn);
37
+ SocketEmitter.off(_OPERATION_EVENT_CHANGE_, operationFn);
38
+ SocketEmitter.off(_LOGIN_STATUS_EVENT_CHANGE_, statusFn);
39
+ SocketEmitter.off(_STORE_EVENT_CHANGE_, storeFn);
53
40
  };
54
41
  }, []);
55
42
  return /*#__PURE__*/_jsx(_Fragment, {});
56
43
  }
57
-
58
44
  export default Sync;
@@ -1,7 +1,4 @@
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
- import _SocketEmitter from "@cloud-app-dev/utils/es/SocketEmitter";
3
- import _nextTick from "@cloud-app-dev/utils/es/nextTick";
4
- import _cache from "@cloud-app-dev/utils/es/cache";
5
2
  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
3
  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; }
7
4
  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; }
@@ -15,6 +12,9 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
15
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
13
  import { isEmpty } from 'lodash-es';
17
14
  import React, { useCallback, useMemo, useState } from 'react';
15
+ import cache from "../cache";
16
+ import nextTick from "../nextTick";
17
+ import SocketEmitter from "../SocketEmitter";
18
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";
19
19
  import Sync from "./Sync";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -23,10 +23,10 @@ var Context = /*#__PURE__*/React.createContext(null);
23
23
  function Provider(_ref) {
24
24
  var children = _ref.children;
25
25
  var _useState = useState({
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') || {}
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
30
  }),
31
31
  _useState2 = _slicedToArray(_useState, 2),
32
32
  state = _useState2[0],
@@ -39,9 +39,9 @@ function Provider(_ref) {
39
39
  user: newUser
40
40
  });
41
41
  });
42
- _nextTick(function () {
43
- _SocketEmitter.emit(_USER_EVENT_CHANGE_, newUser);
44
- _cache.setCache(_USER_SESSION_, newUser, 'session');
42
+ nextTick(function () {
43
+ SocketEmitter.emit(_USER_EVENT_CHANGE_, newUser);
44
+ cache.setCache(_USER_SESSION_, newUser, 'session');
45
45
  console.info('AppContext updateUser is run !', user);
46
46
  });
47
47
  }
@@ -53,9 +53,9 @@ function Provider(_ref) {
53
53
  operation: newOperation
54
54
  });
55
55
  });
56
- _nextTick(function () {
57
- _SocketEmitter.emit(_OPERATION_EVENT_CHANGE_, newOperation);
58
- _cache.setCache(_OPERATION_SESSION_, newOperation, 'session');
56
+ nextTick(function () {
57
+ SocketEmitter.emit(_OPERATION_EVENT_CHANGE_, newOperation);
58
+ cache.setCache(_OPERATION_SESSION_, newOperation, 'session');
59
59
  console.info('AppContext updateOperation is run !', operation);
60
60
  });
61
61
  }
@@ -68,9 +68,9 @@ function Provider(_ref) {
68
68
  loginStatus: status
69
69
  }) : old;
70
70
  });
71
- _nextTick(function () {
72
- _SocketEmitter.emit(_LOGIN_STATUS_EVENT_CHANGE_, status);
73
- _cache.setCache(_LOGIN_STATUS_SESSION_, status, 'session');
71
+ nextTick(function () {
72
+ SocketEmitter.emit(_LOGIN_STATUS_EVENT_CHANGE_, status);
73
+ cache.setCache(_LOGIN_STATUS_SESSION_, status, 'session');
74
74
  console.info('AppContext updateLoginStatus is run !', status);
75
75
  });
76
76
  }
@@ -94,13 +94,13 @@ function Provider(_ref) {
94
94
  return old;
95
95
  }
96
96
  var newStore = _objectSpread(_objectSpread({}, old.store), newData);
97
- _cache.setCache(_STORE_SESSION_, newStore, 'session');
97
+ cache.setCache(_STORE_SESSION_, newStore, 'session');
98
98
  return _objectSpread(_objectSpread({}, old), {}, {
99
99
  store: newStore
100
100
  });
101
101
  });
102
- _nextTick(function () {
103
- _SocketEmitter.emit(_STORE_EVENT_CHANGE_, data);
102
+ nextTick(function () {
103
+ SocketEmitter.emit(_STORE_EVENT_CHANGE_, data);
104
104
  console.info('AppContext updateStore is run !', data);
105
105
  });
106
106
  }
@@ -1,15 +1,9 @@
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
5
 
9
6
  export var _USER_SESSION_ = '_USER_SESSION_'; //用户信息 缓存key
10
-
11
7
  export var _OPERATION_SESSION_ = '_OPERATION_SESSION_'; //应用系统信息 缓存key
12
-
13
8
  export var _LOGIN_STATUS_SESSION_ = '_LOGIN_STATUS_SESSION_'; //登录状态 缓存key
14
-
15
9
  export var _STORE_SESSION_ = '_STORE_SESSION_'; //登录状态 缓存key
package/es/Auth/index.js CHANGED
@@ -2,20 +2,17 @@ import React, { useMemo } from 'react';
2
2
  import Config from "../Config";
3
3
  import { Fragment as _Fragment } from "react/jsx-runtime";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
5
  function Auth(_ref) {
7
6
  var featureId = _ref.featureId,
8
- noAuthContent = _ref.noAuthContent,
9
- children = _ref.children;
7
+ noAuthContent = _ref.noAuthContent,
8
+ children = _ref.children;
10
9
  var action = useMemo(function () {
11
10
  return !!Config.feature.find(function (v) {
12
11
  return v === featureId;
13
12
  });
14
13
  }, [featureId]); //获取按钮权限
15
-
16
14
  return /*#__PURE__*/_jsx(_Fragment, {
17
15
  children: !action ? noAuthContent ? noAuthContent : null : children
18
16
  });
19
17
  }
20
-
21
18
  export default Auth;
@@ -1,6 +1,6 @@
1
- import _nextTick from "@cloud-app-dev/utils/es/nextTick";
2
1
  import React, { useContext, useEffect } from 'react';
3
2
  import AppContext from "../AppContext";
3
+ import nextTick from "../nextTick";
4
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";
@@ -11,7 +11,7 @@ function AutoExit(_ref) {
11
11
  var history = useHistory();
12
12
  useEffect(function () {
13
13
  if (!loginStatus) {
14
- _nextTick(function () {
14
+ nextTick(function () {
15
15
  return history.replace('/login');
16
16
  });
17
17
  }
@@ -8,7 +8,6 @@ var defaultSource = Array.from(new Array(100)).map(function (_, i) {
8
8
  value: i
9
9
  };
10
10
  });
11
-
12
11
  var App = function App() {
13
12
  return /*#__PURE__*/_jsx(ConfigProvider, {
14
13
  prefixCls: "cloudapp",
@@ -23,5 +22,4 @@ var App = function App() {
23
22
  })
24
23
  });
25
24
  };
26
-
27
25
  export default App;
@@ -1,65 +1,52 @@
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 _useUpdateEffect from "ahooks/es/useUpdateEffect";
2
-
3
3
  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; }
4
-
5
4
  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; }
6
-
7
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
-
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
9
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
-
11
9
  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."); }
12
-
13
10
  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 _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; }
16
-
17
- 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; }
18
-
11
+ 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
+ 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; } }
19
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
-
21
14
  import { Badge, Checkbox } from 'antd';
22
15
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
23
16
  import "./index.less";
24
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
18
  import { jsx as _jsx } from "react/jsx-runtime";
26
-
27
19
  function CheckGroupFixed(_ref) {
28
20
  var label = _ref.label,
29
- _ref$source = _ref.source,
30
- source = _ref$source === void 0 ? [] : _ref$source,
31
- _ref$checboxSize = _ref.checboxSize,
32
- checboxSize = _ref$checboxSize === void 0 ? 120 : _ref$checboxSize,
33
- _ref$cutRow = _ref.cutRow,
34
- cutRow = _ref$cutRow === void 0 ? 1 : _ref$cutRow,
35
- _ref$labelSize = _ref.labelSize,
36
- labelSize = _ref$labelSize === void 0 ? 100 : _ref$labelSize,
37
- value = _ref.value,
38
- onChange = _ref.onChange;
39
-
21
+ _ref$source = _ref.source,
22
+ source = _ref$source === void 0 ? [] : _ref$source,
23
+ _ref$checboxSize = _ref.checboxSize,
24
+ checboxSize = _ref$checboxSize === void 0 ? 120 : _ref$checboxSize,
25
+ _ref$cutRow = _ref.cutRow,
26
+ cutRow = _ref$cutRow === void 0 ? 1 : _ref$cutRow,
27
+ _ref$labelSize = _ref.labelSize,
28
+ labelSize = _ref$labelSize === void 0 ? 100 : _ref$labelSize,
29
+ value = _ref.value,
30
+ onChange = _ref.onChange;
40
31
  var _useState = useState({
41
- visible: false,
42
- sider: false,
43
- pos: [0, 0],
44
- w: 0,
45
- selectKeys: value || []
46
- }),
47
- _useState2 = _slicedToArray(_useState, 2),
48
- state = _useState2[0],
49
- setState = _useState2[1];
50
-
32
+ visible: false,
33
+ sider: false,
34
+ pos: [0, 0],
35
+ w: 0,
36
+ selectKeys: value || []
37
+ }),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ state = _useState2[0],
40
+ setState = _useState2[1];
51
41
  var domRef = useRef(null);
52
42
  useLayoutEffect(function () {
53
43
  var _domRef$current;
54
-
55
44
  var contentEle = (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.querySelector('.check-content-box');
56
45
  var contentRect = (contentEle === null || contentEle === void 0 ? void 0 : contentEle.getBoundingClientRect()) || {
57
46
  width: 0
58
47
  };
59
-
60
48
  if (contentRect.width < checboxSize * source.length) {
61
49
  var _domRef$current2;
62
-
63
50
  var lr = (_domRef$current2 = domRef.current) === null || _domRef$current2 === void 0 ? void 0 : _domRef$current2.getBoundingClientRect();
64
51
  setState(function (old) {
65
52
  return _objectSpread(_objectSpread({}, old), {}, {
@@ -81,14 +68,11 @@ function CheckGroupFixed(_ref) {
81
68
  boxShadow: ' 0 0 10px rgba(0,0,0,0.1)'
82
69
  } : {};
83
70
  }, [state.sider, state.w, state.pos]);
84
-
85
71
  _useUpdateEffect(function () {
86
72
  return onChange === null || onChange === void 0 ? void 0 : onChange(state.selectKeys);
87
73
  }, [state.selectKeys]);
88
-
89
74
  useLayoutEffect(function () {
90
75
  var _domRef$current3;
91
-
92
76
  var dom = (_domRef$current3 = domRef.current) === null || _domRef$current3 === void 0 ? void 0 : _domRef$current3.querySelector('.check-box-group-layout');
93
77
  dom === null || dom === void 0 ? void 0 : dom.setAttribute('style', "grid-template-columns:repeat(auto-fill, minmax(".concat(checboxSize, "px, 1fr));"));
94
78
  }, [checboxSize]);
@@ -163,5 +147,4 @@ function CheckGroupFixed(_ref) {
163
147
  })]
164
148
  });
165
149
  }
166
-
167
150
  export default CheckGroupFixed;
@@ -1,7 +1,6 @@
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
2
  import _useClickAway from "ahooks/es/useClickAway";
3
3
  import _useToggle3 from "ahooks/es/useToggle";
4
- import _uuid from "@cloud-app-dev/utils/es/uuid";
5
4
  var _excluded = ["children", "value", "customRender", "popupClassName", "getPopupContainer", "onChange", "selectAotoClose"];
6
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; }
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; }
@@ -18,6 +17,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
18
17
  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; }
19
18
  import { Select } from 'antd';
20
19
  import React, { useMemo, useRef } from 'react';
20
+ import uuid from "../uuid";
21
21
  import "./index.less";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -32,7 +32,7 @@ function CustomRenderSelect(_ref) {
32
32
  selectAotoClose = _ref$selectAotoClose === void 0 ? true : _ref$selectAotoClose,
33
33
  props = _objectWithoutProperties(_ref, _excluded);
34
34
  var classname = useMemo(function () {
35
- return "custom-render-select-dropdown-".concat(_uuid());
35
+ return "custom-render-select-dropdown-".concat(uuid());
36
36
  }, []);
37
37
  var domRef = useRef(null);
38
38
  var _useToggle = _useToggle3(),
@@ -4,8 +4,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
5
  export default function DisableMark(_ref) {
6
6
  var children = _ref.children,
7
- disabled = _ref.disabled,
8
- width = _ref.width;
7
+ disabled = _ref.disabled,
8
+ width = _ref.width;
9
9
  return /*#__PURE__*/_jsxs("div", {
10
10
  style: {
11
11
  width: '100%',
@@ -1,27 +1,25 @@
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 _useEventListener from "ahooks/es/useEventListener";
2
3
  import _useUpdate from "ahooks/es/useUpdate";
3
4
  import _useSize from "ahooks/es/useSize";
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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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
  import React, { useEffect, useImperativeHandle, useRef } from 'react';
12
11
  import { getMouseXY, getPosition } from "./utils";
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
-
15
13
  function DomMove(_ref) {
16
14
  var onDrag = _ref.onDrag,
17
- position = _ref.position,
18
- className = _ref.className,
19
- size = _ref.size,
20
- children = _ref.children,
21
- onDragChange = _ref.onDragChange,
22
- onDragEnd = _ref.onDragEnd,
23
- forwordRef = _ref.forwordRef,
24
- disabled = _ref.disabled;
15
+ position = _ref.position,
16
+ className = _ref.className,
17
+ size = _ref.size,
18
+ children = _ref.children,
19
+ onDragChange = _ref.onDragChange,
20
+ onDragEnd = _ref.onDragEnd,
21
+ forwordRef = _ref.forwordRef,
22
+ disabled = _ref.disabled;
25
23
  var dragRef = useRef(null);
26
24
  var ref = useRef({
27
25
  position: {
@@ -41,12 +39,10 @@ function DomMove(_ref) {
41
39
  }
42
40
  });
43
41
  var reSize = _useSize(dragRef) || {};
44
-
45
42
  var update = _useUpdate();
46
-
47
43
  var updatePosition = function updatePosition(_ref2) {
48
44
  var x = _ref2.x,
49
- y = _ref2.y;
45
+ y = _ref2.y;
50
46
  ref.current.position = {
51
47
  x: x,
52
48
  y: y
@@ -57,7 +53,6 @@ function DomMove(_ref) {
57
53
  y: y
58
54
  });
59
55
  };
60
-
61
56
  useEffect(function () {
62
57
  var offset = getPosition(dragRef === null || dragRef === void 0 ? void 0 : dragRef.current);
63
58
  ref.current.deviation = {
@@ -66,31 +61,31 @@ function DomMove(_ref) {
66
61
  width: reSize.width,
67
62
  height: reSize.height
68
63
  };
69
- }, [reSize.width, reSize.height]); // eslint-disable-next-line react-hooks/exhaustive-deps
64
+ }, [reSize.width, reSize.height]);
70
65
 
66
+ // eslint-disable-next-line react-hooks/exhaustive-deps
71
67
  useImperativeHandle(forwordRef, function () {
72
68
  return {
73
69
  updatePosition: updatePosition
74
70
  };
75
71
  }, []);
76
-
77
72
  _useEventListener('mousemove', function (event) {
78
73
  if (ref.current.isDrag) {
79
74
  // let maxX, maxY;
80
75
  var moveX, moveY;
81
-
82
76
  var _getMouseXY = getMouseXY(event),
83
- _x = _getMouseXY.x,
84
- _y = _getMouseXY.y;
85
-
77
+ _x = _getMouseXY.x,
78
+ _y = _getMouseXY.y;
86
79
  moveX = _x - ref.current.deviation.offsetX;
87
- moveY = _y - ref.current.deviation.offsetY; // 计算可移动位置的大小, 保证元素不会超过可移动范围
80
+ moveY = _y - ref.current.deviation.offsetY;
81
+
82
+ // 计算可移动位置的大小, 保证元素不会超过可移动范围
88
83
  // maxX = document.documentElement.clientWidth - this.deviation.width;
89
84
  // maxY = document.documentElement.clientHeight - this.deviation.height;
85
+
90
86
  // min方法保证不会超过右边界,max保证不会超过左边界
91
87
  // moveX = Math.min(Math.max(0, moveX), maxX);
92
88
  // moveY = Math.min(Math.max(0, moveY), maxY);
93
-
94
89
  var _position = {
95
90
  x: moveX,
96
91
  y: moveY
@@ -100,7 +95,6 @@ function DomMove(_ref) {
100
95
  }, {
101
96
  target: document.body
102
97
  });
103
-
104
98
  _useEventListener('mouseup', function (event) {
105
99
  if (ref.current.isDrag) {
106
100
  ref.current.isDrag = false;
@@ -109,13 +103,11 @@ function DomMove(_ref) {
109
103
  }, {
110
104
  target: document.body
111
105
  });
112
-
113
106
  _useEventListener('mousedown', function (event) {
114
107
  if (!disabled) {
115
108
  var _getMouseXY2 = getMouseXY(event),
116
- _x2 = _getMouseXY2.x,
117
- _y2 = _getMouseXY2.y;
118
-
109
+ _x2 = _getMouseXY2.x,
110
+ _y2 = _getMouseXY2.y;
119
111
  ref.current.deviation.offsetX = _x2 - ref.current.position.x;
120
112
  ref.current.deviation.offsetY = _y2 - ref.current.position.y;
121
113
  ref.current.isDrag = true;
@@ -123,17 +115,15 @@ function DomMove(_ref) {
123
115
  }, {
124
116
  target: dragRef
125
117
  });
126
-
127
118
  var _ref3 = onDrag ? {
128
- x: position === null || position === void 0 ? void 0 : position.x,
129
- y: position === null || position === void 0 ? void 0 : position.y
130
- } : {
131
- x: ref.current.position.x,
132
- y: ref.current.position.y
133
- },
134
- x = _ref3.x,
135
- y = _ref3.y;
136
-
119
+ x: position === null || position === void 0 ? void 0 : position.x,
120
+ y: position === null || position === void 0 ? void 0 : position.y
121
+ } : {
122
+ x: ref.current.position.x,
123
+ y: ref.current.position.y
124
+ },
125
+ x = _ref3.x,
126
+ y = _ref3.y;
137
127
  return /*#__PURE__*/_jsx("div", {
138
128
  ref: dragRef,
139
129
  className: "drag-move-Content ".concat(className),
@@ -145,7 +135,6 @@ function DomMove(_ref) {
145
135
  children: children
146
136
  });
147
137
  }
148
-
149
138
  DomMove.defaultProps = {
150
139
  className: '',
151
140
  size: {
@@ -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
- y = 0;
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