@zgfe/business-lib 1.1.29-visual.8 → 1.1.29

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 (140) hide show
  1. package/es/addToPanel/components/addPanel.js +21 -8
  2. package/es/addToPanel/components/radioGroup.js +3 -1
  3. package/es/addToPanel/components/styleList.js +22 -5
  4. package/es/addToPanel/demo/edit.js +12 -5
  5. package/es/addToPanel/demo/index.js +12 -5
  6. package/es/addToPanel/index.js +58 -21
  7. package/es/addToScene/addGroup.js +4 -0
  8. package/es/addToScene/demo/index.js +12 -5
  9. package/es/addToScene/index.js +40 -13
  10. package/es/assets/demo/index.js +2 -0
  11. package/es/assets/demo/input.js +12 -5
  12. package/es/assets/iconfont/iconfont.js +17 -10
  13. package/es/assets/theme.js +1 -0
  14. package/es/attrConditions/components/operateList.js +27 -10
  15. package/es/attrConditions/components/stringList.js +97 -68
  16. package/es/attrConditions/components/valuesList.js +40 -14
  17. package/es/attrConditions/demo/group.js +23 -11
  18. package/es/attrConditions/demo/index.js +26 -17
  19. package/es/attrConditions/group.js +48 -17
  20. package/es/attrConditions/index.js +49 -22
  21. package/es/attrConditions/types.js +1 -0
  22. package/es/attributeSelector/demo/disable.js +16 -8
  23. package/es/attributeSelector/demo/index.js +17 -8
  24. package/es/attributeSelector/index.js +45 -22
  25. package/es/attributeSelector/listPanel.js +46 -18
  26. package/es/attributeSelector/option.js +13 -3
  27. package/es/attributeSelector/types.js +5 -0
  28. package/es/attributeSelector/util.js +3 -0
  29. package/es/chart/demo/index.js +14 -5
  30. package/es/chart/index.js +44 -30
  31. package/es/chart/util/chartOptionConfig.d.ts +3 -3
  32. package/es/chart/util/chartOptionConfig.js +37 -13
  33. package/es/chart/util/data/china.js +4 -1
  34. package/es/chart/util/formatData.d.ts +2 -2
  35. package/es/chart/util/formatData.js +5 -0
  36. package/es/chart/util/formatOption.js +13 -0
  37. package/es/chart/util/mapUtil.js +26 -5
  38. package/es/config.js +2 -0
  39. package/es/constants/apis.d.ts +0 -1
  40. package/es/constants/apis.js +1 -2
  41. package/es/cycleTime/demo/disable.js +1 -0
  42. package/es/cycleTime/index.js +46 -19
  43. package/es/cycleTime/month.js +27 -8
  44. package/es/datePicker/datePicker.js +23 -5
  45. package/es/datePicker/demo/customType.js +22 -13
  46. package/es/datePicker/demo/day.js +22 -13
  47. package/es/datePicker/demo/index.js +21 -12
  48. package/es/datePicker/index.js +41 -18
  49. package/es/datePicker/utils.js +7 -0
  50. package/es/demoWrapper/content.d.ts +1 -2
  51. package/es/demoWrapper/content.js +64 -42
  52. package/es/demoWrapper/demo/index.js +4 -5
  53. package/es/demoWrapper/head.d.ts +1 -3
  54. package/es/demoWrapper/head.js +27 -25
  55. package/es/demoWrapper/index.js +36 -28
  56. package/es/dialog/demo/index.js +12 -5
  57. package/es/dialog/index.js +6 -4
  58. package/es/dnd/demo/data.js +28 -19
  59. package/es/dnd/demo/handle.js +28 -19
  60. package/es/dnd/index.js +45 -21
  61. package/es/dnd/item.js +30 -10
  62. package/es/eventSelector/demo/index.js +23 -12
  63. package/es/eventSelector/index.js +42 -14
  64. package/es/eventSelector/listPanel.js +73 -31
  65. package/es/eventSelector/option.js +11 -6
  66. package/es/icon/iconFont.js +13 -7
  67. package/es/index.d.ts +1 -2
  68. package/es/index.js +1 -2
  69. package/es/layout/analysisLayout/demo/index.js +6 -0
  70. package/es/layout/analysisLayout/index.d.ts +1 -1
  71. package/es/layout/analysisLayout/index.js +34 -16
  72. package/es/layout/detail/index.js +3 -1
  73. package/es/loginForm/index.js +18 -7
  74. package/es/searchInput/index.js +7 -2
  75. package/es/select/demo/children.js +16 -8
  76. package/es/select/demo/customLabel.js +2 -0
  77. package/es/select/demo/group.js +17 -8
  78. package/es/select/demo/index.js +19 -11
  79. package/es/select/demo/loading.js +18 -8
  80. package/es/select/demo/multiple.js +16 -8
  81. package/es/select/handle.js +34 -14
  82. package/es/select/index.js +59 -22
  83. package/es/select/option.js +30 -10
  84. package/es/select/overlay.js +62 -25
  85. package/es/table/demo/data/table.js +2 -0
  86. package/es/table/demo/index.js +39 -13
  87. package/es/table/demo/index2.js +15 -5
  88. package/es/table/demo/index3.js +28 -7
  89. package/es/table/index.js +33 -14
  90. package/es/targetConditionGroup/components/targetDimension.js +38 -12
  91. package/es/targetConditionGroup/demo/group.js +36 -21
  92. package/es/targetConditionGroup/demo/index.js +13 -5
  93. package/es/targetConditionGroup/index.js +84 -31
  94. package/es/targetSelector/demo/index.js +28 -15
  95. package/es/targetSelector/editBox.js +20 -5
  96. package/es/targetSelector/index.js +36 -15
  97. package/es/targetSelector/optionIcon.js +5 -1
  98. package/es/targetSelector/optionMenu.js +3 -0
  99. package/es/userCondition/conditionTypeList.js +12 -7
  100. package/es/userCondition/conditionWrap.js +2 -0
  101. package/es/userCondition/conditions/cdpCondition.js +97 -51
  102. package/es/userCondition/conditions/eventCondition.js +16 -6
  103. package/es/userCondition/conditions/periodCondition.js +26 -8
  104. package/es/userCondition/conditions/propCondition.js +61 -29
  105. package/es/userCondition/conditions/runTimesCondition.js +10 -5
  106. package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
  107. package/es/userCondition/conditions/tagsCondition.js +33 -15
  108. package/es/userCondition/conditions/textDesc.js +67 -16
  109. package/es/userCondition/demo/index.js +21 -11
  110. package/es/userCondition/index.js +91 -51
  111. package/es/userCondition/orConditions.js +48 -11
  112. package/es/userCondition/relationLabel.js +4 -1
  113. package/es/userCondition/types.d.ts +1 -1
  114. package/es/userCondition/types.js +1 -0
  115. package/es/userCondition/util.js +13 -4
  116. package/es/userGroup/demo/group.js +23 -14
  117. package/es/userGroup/demo/index.js +15 -5
  118. package/es/userGroup/index.js +30 -12
  119. package/es/userTagsSelector/cascaderOverlay.js +51 -19
  120. package/es/userTagsSelector/components/search/index.js +2 -0
  121. package/es/userTagsSelector/demo/index.js +3 -0
  122. package/es/userTagsSelector/groups/groupOption.js +8 -6
  123. package/es/userTagsSelector/groups/index.js +30 -15
  124. package/es/userTagsSelector/index.js +35 -17
  125. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +6 -3
  126. package/es/userTagsSelector/multipleCheckPanel/index.js +21 -8
  127. package/es/userTagsSelector/util.js +2 -0
  128. package/es/utils/ajax.js +71 -45
  129. package/es/utils/base64.js +22 -3
  130. package/es/utils/type.d.ts +1 -1
  131. package/es/utils/type.js +7 -4
  132. package/es/utils/util.js +16 -0
  133. package/package.json +2 -2
  134. package/es/socket/demo/demo.d.ts +0 -2
  135. package/es/socket/demo/demo.js +0 -139
  136. package/es/socket/demo/index.less +0 -27
  137. package/es/socket/index.d.ts +0 -31
  138. package/es/socket/index.js +0 -284
  139. package/es/socket/types.d.ts +0 -37
  140. package/es/socket/types.js +0 -26
@@ -1,47 +1,51 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
2
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."); }
4
+
3
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ 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
+
6
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
7
13
  import { Select, Skeleton } from 'antd';
8
14
  import React, { useEffect, useState } from 'react';
9
15
  import request from '../utils/ajax';
16
+
10
17
  var DemoHeader = function DemoHeader(_ref) {
11
18
  var defaultApp = _ref.defaultApp,
12
- onChangeApp = _ref.onChangeApp,
13
- onLoading = _ref.onLoading;
19
+ onChangeApp = _ref.onChangeApp;
20
+
14
21
  var _useState = useState([]),
15
- _useState2 = _slicedToArray(_useState, 2),
16
- appList = _useState2[0],
17
- setAppList = _useState2[1];
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ appList = _useState2[0],
24
+ setAppList = _useState2[1];
25
+
18
26
  var _useState3 = useState(true),
19
- _useState4 = _slicedToArray(_useState3, 2),
20
- loading = _useState4[0],
21
- setLoading = _useState4[1];
27
+ _useState4 = _slicedToArray(_useState3, 2),
28
+ loading = _useState4[0],
29
+ setLoading = _useState4[1];
30
+
22
31
  useEffect(function () {
23
32
  queryAppList();
24
33
  }, []);
25
- useEffect(function () {
26
- if (onLoading) onLoading(loading);
27
- }, [loading, appList]);
34
+
28
35
  function queryAppList() {
29
36
  setLoading(true);
30
37
  request('/analysis/api/common/proxy/data/v2ajaxGetDataByApp.jsp').then(function (res) {
31
38
  setAppList(res.applist);
32
- if (defaultApp) {
33
- _onChange(res.applist.find(function (item) {
34
- return item.id === defaultApp;
35
- }));
36
- }
37
- if (!defaultApp && res.applist.length) _onChange(res.applist[0]);
39
+ if (!defaultApp && res.applist.length) onChange(res.applist[0].id);
38
40
  }).finally(function () {
39
41
  setLoading(false);
40
42
  });
41
43
  }
42
- function _onChange(item) {
43
- if (onChangeApp) onChangeApp(item);
44
+
45
+ function onChange(id) {
46
+ if (onChangeApp) onChangeApp(id);
44
47
  }
48
+
45
49
  if (loading) return /*#__PURE__*/React.createElement(Skeleton.Input, null);
46
50
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Select, {
47
51
  defaultValue: defaultApp || appList[0].id,
@@ -50,13 +54,11 @@ var DemoHeader = function DemoHeader(_ref) {
50
54
  label: 'appName',
51
55
  value: 'id'
52
56
  },
53
- onChange: function onChange(_id, app) {
54
- console.log('默认应用', app);
55
- _onChange(app);
56
- },
57
+ onChange: onChange,
57
58
  style: {
58
59
  width: '200px'
59
60
  }
60
61
  }));
61
62
  };
63
+
62
64
  export default DemoHeader;
@@ -1,9 +1,15 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
2
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."); }
4
+
3
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ 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
+
6
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
7
13
  import { Card, Spin } from 'antd';
8
14
  import React, { useEffect, useState } from 'react';
9
15
  import BizLoginForm from '../loginForm';
@@ -11,30 +17,32 @@ import request from '../utils/ajax';
11
17
  import DemoContent from './content';
12
18
  import DemoHeader from './head';
13
19
  import './index.less';
20
+
14
21
  var DemoWrapper = function DemoWrapper(_ref) {
15
22
  var children = _ref.children,
16
- className = _ref.className,
17
- defaultApp = _ref.defaultApp,
18
- needMeta = _ref.needMeta;
23
+ className = _ref.className,
24
+ defaultApp = _ref.defaultApp,
25
+ needMeta = _ref.needMeta;
26
+
19
27
  var _useState = useState(true),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- loading = _useState2[0],
22
- setLoading = _useState2[1];
23
- var _useState3 = useState(true),
24
- _useState4 = _slicedToArray(_useState3, 2),
25
- appListLoading = _useState4[0],
26
- setAppListLoading = _useState4[1];
27
- var _useState5 = useState(false),
28
- _useState6 = _slicedToArray(_useState5, 2),
29
- notLogin = _useState6[0],
30
- setNotLogin = _useState6[1];
31
- var _useState7 = useState(),
32
- _useState8 = _slicedToArray(_useState7, 2),
33
- app = _useState8[0],
34
- setApp = _useState8[1];
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ loading = _useState2[0],
30
+ setLoading = _useState2[1];
31
+
32
+ var _useState3 = useState(false),
33
+ _useState4 = _slicedToArray(_useState3, 2),
34
+ notLogin = _useState4[0],
35
+ setNotLogin = _useState4[1];
36
+
37
+ var _useState5 = useState(defaultApp),
38
+ _useState6 = _slicedToArray(_useState5, 2),
39
+ appId = _useState6[0],
40
+ setAppId = _useState6[1];
41
+
35
42
  useEffect(function () {
36
43
  getCurrentUser();
37
44
  }, []);
45
+
38
46
  function getCurrentUser() {
39
47
  request('/analysis/api/common/proxy/user/getUserInfo.jsp').then(function (res) {
40
48
  if (res.status === 503 || res.ret === '-1') setNotLogin(true);
@@ -44,9 +52,11 @@ var DemoWrapper = function DemoWrapper(_ref) {
44
52
  setLoading(false);
45
53
  });
46
54
  }
55
+
47
56
  if (loading) {
48
57
  return /*#__PURE__*/React.createElement(Spin, null);
49
58
  }
59
+
50
60
  if (notLogin) {
51
61
  return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BizLoginForm, {
52
62
  onSuccess: function onSuccess() {
@@ -54,22 +64,20 @@ var DemoWrapper = function DemoWrapper(_ref) {
54
64
  }
55
65
  }));
56
66
  }
67
+
57
68
  return /*#__PURE__*/React.createElement(Card, {
58
69
  title: /*#__PURE__*/React.createElement(DemoHeader, {
59
70
  defaultApp: defaultApp,
60
- onChangeApp: setApp,
61
- onLoading: setAppListLoading
71
+ onChangeApp: setAppId
62
72
  }),
63
73
  className: className,
64
74
  bodyStyle: {
65
75
  background: '#FAFAFB'
66
76
  }
67
- }, appListLoading ? /*#__PURE__*/React.createElement(Spin, {
68
- tip: "\u5E94\u7528\u4FE1\u606F\u521D\u59CB\u5316\u4E2D"
69
- }) : /*#__PURE__*/React.createElement(DemoContent, {
70
- currentApp: app,
71
- needMeta: needMeta,
72
- key: app === null || app === void 0 ? void 0 : app.appId
77
+ }, /*#__PURE__*/React.createElement(DemoContent, {
78
+ currentApp: appId,
79
+ needMeta: needMeta
73
80
  }, children));
74
81
  };
82
+
75
83
  export default DemoWrapper;
@@ -1,17 +1,24 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
2
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."); }
4
+
3
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ 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
+
6
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
7
13
  import React, { useState } from 'react';
8
14
  import { BizDialog } from '@zgfe/business-lib';
9
15
  import { Button } from 'antd';
10
16
  export default (function () {
11
17
  var _useState = useState(false),
12
- _useState2 = _slicedToArray(_useState, 2),
13
- visible = _useState2[0],
14
- setVisible = _useState2[1];
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ visible = _useState2[0],
20
+ setVisible = _useState2[1];
21
+
15
22
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
16
23
  type: "primary",
17
24
  onClick: function onClick() {
@@ -1,14 +1,15 @@
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
1
  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; }
2
+
3
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; }
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; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- 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); }
4
+
5
+ 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; }
6
+
7
7
  import { Modal } from 'antd';
8
8
  import React from 'react';
9
9
  import './styles/index.less';
10
10
  import { IconFont } from '..';
11
11
  export var classPrefix = 'biz-dialog';
12
+
12
13
  var BizDialog = function BizDialog(props) {
13
14
  return /*#__PURE__*/React.createElement(Modal, _objectSpread(_objectSpread({
14
15
  bodyStyle: {
@@ -21,6 +22,7 @@ var BizDialog = function BizDialog(props) {
21
22
  })
22
23
  }), props.children);
23
24
  };
25
+
24
26
  BizDialog.defaultProps = {
25
27
  width: 520,
26
28
  visible: false,
@@ -1,32 +1,39 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
2
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."); }
4
+
3
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ 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
+
6
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
7
13
  import React, { useState } from 'react';
8
14
  import { BizDnd } from '@zgfe/business-lib';
9
15
  import styles from './styles/index.less';
10
16
  import _ from 'lodash';
11
17
  export default (function () {
12
18
  var _useState = useState([{
13
- id: 0,
14
- label: 'a'
15
- }, {
16
- id: 1,
17
- label: 'b'
18
- }, {
19
- id: 2,
20
- label: 'c'
21
- }, {
22
- id: 3,
23
- label: '添加',
24
- disabled: true,
25
- isAdd: true
26
- }]),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- list = _useState2[0],
29
- setList = _useState2[1];
19
+ id: 0,
20
+ label: 'a'
21
+ }, {
22
+ id: 1,
23
+ label: 'b'
24
+ }, {
25
+ id: 2,
26
+ label: 'c'
27
+ }, {
28
+ id: 3,
29
+ label: '添加',
30
+ disabled: true,
31
+ isAdd: true
32
+ }]),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ list = _useState2[0],
35
+ setList = _useState2[1];
36
+
30
37
  function onAdd() {
31
38
  setList(function (list) {
32
39
  var res = [];
@@ -37,11 +44,13 @@ export default (function () {
37
44
  label: String.fromCharCode(97 + i)
38
45
  });
39
46
  }
47
+
40
48
  res.push(_.cloneDeep(item));
41
49
  });
42
50
  return res;
43
51
  });
44
52
  }
53
+
45
54
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDnd, {
46
55
  className: styles.container,
47
56
  store: list,
@@ -1,32 +1,39 @@
1
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
2
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."); }
4
+
3
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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
+
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
+
9
+ 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
+
6
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
7
13
  import React, { useState } from 'react';
8
14
  import { BizDnd } from '@zgfe/business-lib';
9
15
  import styles from './styles/index.less';
10
16
  import _ from 'lodash';
11
17
  export default (function () {
12
18
  var _useState = useState([{
13
- id: 0,
14
- label: 'a'
15
- }, {
16
- id: 1,
17
- label: 'b'
18
- }, {
19
- id: 2,
20
- label: 'c'
21
- }, {
22
- id: 3,
23
- label: '添加',
24
- disabled: true,
25
- isAdd: true
26
- }]),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- list = _useState2[0],
29
- setList = _useState2[1];
19
+ id: 0,
20
+ label: 'a'
21
+ }, {
22
+ id: 1,
23
+ label: 'b'
24
+ }, {
25
+ id: 2,
26
+ label: 'c'
27
+ }, {
28
+ id: 3,
29
+ label: '添加',
30
+ disabled: true,
31
+ isAdd: true
32
+ }]),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ list = _useState2[0],
35
+ setList = _useState2[1];
36
+
30
37
  function onAdd() {
31
38
  setList(function (list) {
32
39
  var res = [];
@@ -37,11 +44,13 @@ export default (function () {
37
44
  label: String.fromCharCode(97 + i)
38
45
  });
39
46
  }
47
+
40
48
  res.push(_.cloneDeep(item));
41
49
  });
42
50
  return res;
43
51
  });
44
52
  }
53
+
45
54
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDnd, {
46
55
  className: styles.container,
47
56
  store: list,
package/es/dnd/index.js CHANGED
@@ -1,58 +1,75 @@
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
- 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; }
3
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
- 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); }
1
+ 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; }
2
+
5
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+
6
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+
7
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); }
8
- 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; }
9
- 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; } }
8
+
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; }
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
+
10
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
+
11
15
  import React, { useEffect, useState } from 'react';
12
16
  import BizDndItem from './item';
13
17
  import _ from 'lodash';
14
18
  import './styles/index.less';
15
19
  export var classPrefix = 'biz-dnd';
20
+
16
21
  var BizDnd = function BizDnd(props) {
17
22
  var store = props.store,
18
- keyField = props.keyField,
19
- className = props.className,
20
- itemClassName = props.itemClassName,
21
- tempClassName = props.tempClassName,
22
- draddingClassName = props.draddingClassName,
23
- handle = props.handle,
24
- handleClassName = props.handleClassName;
23
+ keyField = props.keyField,
24
+ className = props.className,
25
+ itemClassName = props.itemClassName,
26
+ tempClassName = props.tempClassName,
27
+ draddingClassName = props.draddingClassName,
28
+ handle = props.handle,
29
+ handleClassName = props.handleClassName;
30
+
25
31
  var _useState = useState(),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- current = _useState2[0],
28
- setCurrent = _useState2[1];
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ current = _useState2[0],
34
+ setCurrent = _useState2[1];
35
+
29
36
  var _useState3 = useState(),
30
- _useState4 = _slicedToArray(_useState3, 2),
31
- setHoverTarget = _useState4[1];
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ setHoverTarget = _useState4[1];
39
+
32
40
  var _useState5 = useState(store),
33
- _useState6 = _slicedToArray(_useState5, 2),
34
- renderData = _useState6[0],
35
- setRenderData = _useState6[1];
41
+ _useState6 = _slicedToArray(_useState5, 2),
42
+ renderData = _useState6[0],
43
+ setRenderData = _useState6[1];
44
+
36
45
  useEffect(function () {
37
46
  setRenderData(_.cloneDeep(store));
38
47
  }, [store]);
48
+
39
49
  function onMouseOver(data) {
40
50
  setHoverTarget(data);
41
51
  setHoverTarget(data);
42
52
  setRenderData(function (list) {
43
53
  var res = [];
54
+
44
55
  for (var i = 0; i < list.length; i++) {
45
56
  var item = _.cloneDeep(list[i]);
57
+
46
58
  if (item.isTemp) continue;
59
+
47
60
  if (current && item[keyField] === data[keyField]) {
48
61
  var _res$push;
62
+
49
63
  res.push((_res$push = {}, _defineProperty(_res$push, props.keyField, "".concat(item[props.keyField], "-temp")), _defineProperty(_res$push, "isTemp", true), _res$push));
50
64
  }
65
+
51
66
  res.push(item);
52
67
  }
68
+
53
69
  return res;
54
70
  });
55
71
  }
72
+
56
73
  function onDropEnd(data) {
57
74
  setHoverTarget(function (target) {
58
75
  setCurrent(undefined);
@@ -61,14 +78,19 @@ var BizDnd = function BizDnd(props) {
61
78
  if (!list.find(function (item) {
62
79
  return item.isTemp;
63
80
  })) return list;
81
+
64
82
  for (var i = 0; i < list.length; i++) {
65
83
  var item = _.cloneDeep(list[i]);
84
+
66
85
  if (item[keyField] === data[keyField] || item.isTemp) continue;
86
+
67
87
  if (item[keyField] === target[keyField]) {
68
88
  res.push(data);
69
89
  }
90
+
70
91
  res.push(item);
71
92
  }
93
+
72
94
  setTimeout(function () {
73
95
  if (props.onChange) props.onChange(res);
74
96
  });
@@ -77,6 +99,7 @@ var BizDnd = function BizDnd(props) {
77
99
  return target;
78
100
  });
79
101
  }
102
+
80
103
  return /*#__PURE__*/React.createElement("div", {
81
104
  className: "".concat(classPrefix, "-container ").concat(className)
82
105
  }, renderData.map(function (data, i) {
@@ -95,6 +118,7 @@ var BizDnd = function BizDnd(props) {
95
118
  });
96
119
  }));
97
120
  };
121
+
98
122
  BizDnd.defaultProps = {
99
123
  keyField: 'key'
100
124
  };