@zgfe/business-lib 1.1.27 → 1.1.28

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 (126) hide show
  1. package/es/addToPanel/components/addPanel.js +8 -21
  2. package/es/addToPanel/components/radioGroup.js +1 -3
  3. package/es/addToPanel/components/styleList.js +5 -22
  4. package/es/addToPanel/demo/edit.js +5 -12
  5. package/es/addToPanel/demo/index.js +5 -12
  6. package/es/addToPanel/index.js +21 -58
  7. package/es/addToScene/addGroup.js +0 -4
  8. package/es/addToScene/demo/index.js +5 -12
  9. package/es/addToScene/index.js +13 -40
  10. package/es/assets/demo/index.js +0 -2
  11. package/es/assets/demo/input.js +5 -12
  12. package/es/assets/iconfont/iconfont.js +10 -17
  13. package/es/assets/theme.js +0 -1
  14. package/es/attrConditions/components/operateList.js +10 -27
  15. package/es/attrConditions/components/stringList.js +69 -98
  16. package/es/attrConditions/components/valuesList.js +14 -40
  17. package/es/attrConditions/demo/group.js +11 -23
  18. package/es/attrConditions/demo/index.js +17 -26
  19. package/es/attrConditions/group.js +17 -48
  20. package/es/attrConditions/index.js +22 -49
  21. package/es/attrConditions/types.js +0 -1
  22. package/es/attributeSelector/demo/disable.js +8 -16
  23. package/es/attributeSelector/demo/index.js +8 -17
  24. package/es/attributeSelector/index.js +22 -45
  25. package/es/attributeSelector/listPanel.js +18 -46
  26. package/es/attributeSelector/option.js +3 -13
  27. package/es/attributeSelector/types.js +0 -5
  28. package/es/attributeSelector/util.js +0 -3
  29. package/es/chart/demo/index.js +5 -14
  30. package/es/chart/index.js +30 -44
  31. package/es/chart/util/chartOptionConfig.d.ts +3 -3
  32. package/es/chart/util/chartOptionConfig.js +13 -37
  33. package/es/chart/util/data/china.js +1 -4
  34. package/es/chart/util/formatData.d.ts +2 -2
  35. package/es/chart/util/formatData.js +0 -5
  36. package/es/chart/util/formatOption.js +0 -13
  37. package/es/chart/util/mapUtil.js +5 -26
  38. package/es/config.js +0 -2
  39. package/es/cycleTime/demo/disable.js +0 -1
  40. package/es/cycleTime/index.js +19 -46
  41. package/es/cycleTime/month.js +8 -27
  42. package/es/datePicker/datePicker.js +5 -23
  43. package/es/datePicker/demo/customType.js +13 -22
  44. package/es/datePicker/demo/day.js +13 -22
  45. package/es/datePicker/demo/index.js +12 -21
  46. package/es/datePicker/index.js +18 -41
  47. package/es/datePicker/utils.js +0 -7
  48. package/es/demoWrapper/content.js +31 -56
  49. package/es/demoWrapper/head.js +9 -23
  50. package/es/demoWrapper/index.js +14 -30
  51. package/es/dialog/demo/index.js +5 -12
  52. package/es/dialog/index.js +4 -6
  53. package/es/dnd/demo/data.js +19 -28
  54. package/es/dnd/demo/handle.js +19 -28
  55. package/es/dnd/index.js +21 -45
  56. package/es/dnd/item.js +10 -30
  57. package/es/eventSelector/demo/index.js +12 -23
  58. package/es/eventSelector/index.js +14 -42
  59. package/es/eventSelector/listPanel.js +27 -61
  60. package/es/eventSelector/option.js +6 -11
  61. package/es/icon/iconFont.js +7 -13
  62. package/es/layout/analysisLayout/demo/index.js +0 -6
  63. package/es/layout/analysisLayout/index.d.ts +1 -1
  64. package/es/layout/analysisLayout/index.js +16 -34
  65. package/es/layout/detail/index.js +1 -3
  66. package/es/loginForm/index.js +7 -18
  67. package/es/searchInput/index.js +2 -7
  68. package/es/select/demo/children.js +8 -16
  69. package/es/select/demo/customLabel.js +0 -2
  70. package/es/select/demo/group.js +8 -17
  71. package/es/select/demo/index.js +11 -19
  72. package/es/select/demo/loading.js +8 -18
  73. package/es/select/demo/multiple.js +8 -16
  74. package/es/select/handle.js +14 -34
  75. package/es/select/index.js +22 -59
  76. package/es/select/option.js +10 -30
  77. package/es/select/overlay.js +25 -62
  78. package/es/table/demo/data/table.js +0 -2
  79. package/es/table/demo/index.js +13 -39
  80. package/es/table/demo/index2.js +5 -15
  81. package/es/table/demo/index3.js +7 -28
  82. package/es/table/index.js +14 -33
  83. package/es/targetConditionGroup/components/targetDimension.js +12 -38
  84. package/es/targetConditionGroup/demo/group.js +21 -36
  85. package/es/targetConditionGroup/demo/index.js +5 -13
  86. package/es/targetConditionGroup/index.js +31 -84
  87. package/es/targetSelector/demo/index.js +15 -28
  88. package/es/targetSelector/editBox.js +5 -20
  89. package/es/targetSelector/index.js +15 -36
  90. package/es/targetSelector/optionIcon.js +1 -5
  91. package/es/targetSelector/optionMenu.js +0 -3
  92. package/es/userCondition/conditionTypeList.js +7 -12
  93. package/es/userCondition/conditionWrap.js +0 -2
  94. package/es/userCondition/conditions/cdpCondition.js +51 -97
  95. package/es/userCondition/conditions/eventCondition.js +6 -16
  96. package/es/userCondition/conditions/periodCondition.js +8 -26
  97. package/es/userCondition/conditions/propCondition.js +29 -61
  98. package/es/userCondition/conditions/runTimesCondition.js +5 -10
  99. package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
  100. package/es/userCondition/conditions/tagsCondition.js +15 -33
  101. package/es/userCondition/conditions/textDesc.js +16 -67
  102. package/es/userCondition/demo/index.js +11 -21
  103. package/es/userCondition/index.js +51 -91
  104. package/es/userCondition/orConditions.js +11 -48
  105. package/es/userCondition/relationLabel.js +1 -4
  106. package/es/userCondition/types.d.ts +1 -1
  107. package/es/userCondition/types.js +0 -1
  108. package/es/userCondition/util.js +4 -13
  109. package/es/userGroup/demo/group.js +14 -23
  110. package/es/userGroup/demo/index.js +5 -15
  111. package/es/userGroup/index.js +12 -30
  112. package/es/userTagsSelector/cascaderOverlay.js +19 -51
  113. package/es/userTagsSelector/components/search/index.js +0 -2
  114. package/es/userTagsSelector/demo/index.js +0 -3
  115. package/es/userTagsSelector/groups/groupOption.js +6 -8
  116. package/es/userTagsSelector/groups/index.js +15 -30
  117. package/es/userTagsSelector/index.js +17 -35
  118. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +3 -6
  119. package/es/userTagsSelector/multipleCheckPanel/index.js +8 -21
  120. package/es/userTagsSelector/util.js +0 -2
  121. package/es/utils/ajax.js +45 -71
  122. package/es/utils/base64.js +3 -22
  123. package/es/utils/type.d.ts +1 -1
  124. package/es/utils/type.js +4 -7
  125. package/es/utils/util.js +0 -16
  126. package/package.json +2 -2
@@ -1,15 +1,9 @@
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
- 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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import { Card, Spin } from 'antd';
14
8
  import React, { useEffect, useState } from 'react';
15
9
  import BizLoginForm from '../loginForm';
@@ -17,32 +11,26 @@ import request from '../utils/ajax';
17
11
  import DemoContent from './content';
18
12
  import DemoHeader from './head';
19
13
  import './index.less';
20
-
21
14
  var DemoWrapper = function DemoWrapper(_ref) {
22
15
  var children = _ref.children,
23
- className = _ref.className,
24
- defaultApp = _ref.defaultApp,
25
- needMeta = _ref.needMeta;
26
-
16
+ className = _ref.className,
17
+ defaultApp = _ref.defaultApp,
18
+ needMeta = _ref.needMeta;
27
19
  var _useState = useState(true),
28
- _useState2 = _slicedToArray(_useState, 2),
29
- loading = _useState2[0],
30
- setLoading = _useState2[1];
31
-
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ loading = _useState2[0],
22
+ setLoading = _useState2[1];
32
23
  var _useState3 = useState(false),
33
- _useState4 = _slicedToArray(_useState3, 2),
34
- notLogin = _useState4[0],
35
- setNotLogin = _useState4[1];
36
-
24
+ _useState4 = _slicedToArray(_useState3, 2),
25
+ notLogin = _useState4[0],
26
+ setNotLogin = _useState4[1];
37
27
  var _useState5 = useState(defaultApp),
38
- _useState6 = _slicedToArray(_useState5, 2),
39
- appId = _useState6[0],
40
- setAppId = _useState6[1];
41
-
28
+ _useState6 = _slicedToArray(_useState5, 2),
29
+ appId = _useState6[0],
30
+ setAppId = _useState6[1];
42
31
  useEffect(function () {
43
32
  getCurrentUser();
44
33
  }, []);
45
-
46
34
  function getCurrentUser() {
47
35
  request('/analysis/api/common/proxy/user/getUserInfo.jsp').then(function (res) {
48
36
  if (res.status === 503 || res.ret === '-1') setNotLogin(true);
@@ -52,11 +40,9 @@ var DemoWrapper = function DemoWrapper(_ref) {
52
40
  setLoading(false);
53
41
  });
54
42
  }
55
-
56
43
  if (loading) {
57
44
  return /*#__PURE__*/React.createElement(Spin, null);
58
45
  }
59
-
60
46
  if (notLogin) {
61
47
  return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BizLoginForm, {
62
48
  onSuccess: function onSuccess() {
@@ -64,7 +50,6 @@ var DemoWrapper = function DemoWrapper(_ref) {
64
50
  }
65
51
  }));
66
52
  }
67
-
68
53
  return /*#__PURE__*/React.createElement(Card, {
69
54
  title: /*#__PURE__*/React.createElement(DemoHeader, {
70
55
  defaultApp: defaultApp,
@@ -79,5 +64,4 @@ var DemoWrapper = function DemoWrapper(_ref) {
79
64
  needMeta: needMeta
80
65
  }, children));
81
66
  };
82
-
83
67
  export default DemoWrapper;
@@ -1,24 +1,17 @@
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
- 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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useState } from 'react';
14
8
  import { BizDialog } from '@zgfe/business-lib';
15
9
  import { Button } from 'antd';
16
10
  export default (function () {
17
11
  var _useState = useState(false),
18
- _useState2 = _slicedToArray(_useState, 2),
19
- visible = _useState2[0],
20
- setVisible = _useState2[1];
21
-
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ visible = _useState2[0],
14
+ setVisible = _useState2[1];
22
15
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
23
16
  type: "primary",
24
17
  onClick: function onClick() {
@@ -1,15 +1,14 @@
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
  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
-
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
-
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); }
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
-
13
12
  var BizDialog = function BizDialog(props) {
14
13
  return /*#__PURE__*/React.createElement(Modal, _objectSpread(_objectSpread({
15
14
  bodyStyle: {
@@ -22,7 +21,6 @@ var BizDialog = function BizDialog(props) {
22
21
  })
23
22
  }), props.children);
24
23
  };
25
-
26
24
  BizDialog.defaultProps = {
27
25
  width: 520,
28
26
  visible: false,
@@ -1,39 +1,32 @@
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
- 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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useState } from 'react';
14
8
  import { BizDnd } from '@zgfe/business-lib';
15
9
  import styles from './styles/index.less';
16
10
  import _ from 'lodash';
17
11
  export default (function () {
18
12
  var _useState = useState([{
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
-
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];
37
30
  function onAdd() {
38
31
  setList(function (list) {
39
32
  var res = [];
@@ -44,13 +37,11 @@ export default (function () {
44
37
  label: String.fromCharCode(97 + i)
45
38
  });
46
39
  }
47
-
48
40
  res.push(_.cloneDeep(item));
49
41
  });
50
42
  return res;
51
43
  });
52
44
  }
53
-
54
45
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDnd, {
55
46
  className: styles.container,
56
47
  store: list,
@@ -1,39 +1,32 @@
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
- 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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useState } from 'react';
14
8
  import { BizDnd } from '@zgfe/business-lib';
15
9
  import styles from './styles/index.less';
16
10
  import _ from 'lodash';
17
11
  export default (function () {
18
12
  var _useState = useState([{
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
-
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];
37
30
  function onAdd() {
38
31
  setList(function (list) {
39
32
  var res = [];
@@ -44,13 +37,11 @@ export default (function () {
44
37
  label: String.fromCharCode(97 + i)
45
38
  });
46
39
  }
47
-
48
40
  res.push(_.cloneDeep(item));
49
41
  });
50
42
  return res;
51
43
  });
52
44
  }
53
-
54
45
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizDnd, {
55
46
  className: styles.container,
56
47
  store: list,
package/es/dnd/index.js CHANGED
@@ -1,75 +1,58 @@
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
-
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); }
3
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
-
5
6
  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
-
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
-
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; } }
13
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
-
15
11
  import React, { useEffect, useState } from 'react';
16
12
  import BizDndItem from './item';
17
13
  import _ from 'lodash';
18
14
  import './styles/index.less';
19
15
  export var classPrefix = 'biz-dnd';
20
-
21
16
  var BizDnd = function BizDnd(props) {
22
17
  var store = props.store,
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
-
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;
31
25
  var _useState = useState(),
32
- _useState2 = _slicedToArray(_useState, 2),
33
- current = _useState2[0],
34
- setCurrent = _useState2[1];
35
-
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ current = _useState2[0],
28
+ setCurrent = _useState2[1];
36
29
  var _useState3 = useState(),
37
- _useState4 = _slicedToArray(_useState3, 2),
38
- setHoverTarget = _useState4[1];
39
-
30
+ _useState4 = _slicedToArray(_useState3, 2),
31
+ setHoverTarget = _useState4[1];
40
32
  var _useState5 = useState(store),
41
- _useState6 = _slicedToArray(_useState5, 2),
42
- renderData = _useState6[0],
43
- setRenderData = _useState6[1];
44
-
33
+ _useState6 = _slicedToArray(_useState5, 2),
34
+ renderData = _useState6[0],
35
+ setRenderData = _useState6[1];
45
36
  useEffect(function () {
46
37
  setRenderData(_.cloneDeep(store));
47
38
  }, [store]);
48
-
49
39
  function onMouseOver(data) {
50
40
  setHoverTarget(data);
51
41
  setHoverTarget(data);
52
42
  setRenderData(function (list) {
53
43
  var res = [];
54
-
55
44
  for (var i = 0; i < list.length; i++) {
56
45
  var item = _.cloneDeep(list[i]);
57
-
58
46
  if (item.isTemp) continue;
59
-
60
47
  if (current && item[keyField] === data[keyField]) {
61
48
  var _res$push;
62
-
63
49
  res.push((_res$push = {}, _defineProperty(_res$push, props.keyField, "".concat(item[props.keyField], "-temp")), _defineProperty(_res$push, "isTemp", true), _res$push));
64
50
  }
65
-
66
51
  res.push(item);
67
52
  }
68
-
69
53
  return res;
70
54
  });
71
55
  }
72
-
73
56
  function onDropEnd(data) {
74
57
  setHoverTarget(function (target) {
75
58
  setCurrent(undefined);
@@ -78,19 +61,14 @@ var BizDnd = function BizDnd(props) {
78
61
  if (!list.find(function (item) {
79
62
  return item.isTemp;
80
63
  })) return list;
81
-
82
64
  for (var i = 0; i < list.length; i++) {
83
65
  var item = _.cloneDeep(list[i]);
84
-
85
66
  if (item[keyField] === data[keyField] || item.isTemp) continue;
86
-
87
67
  if (item[keyField] === target[keyField]) {
88
68
  res.push(data);
89
69
  }
90
-
91
70
  res.push(item);
92
71
  }
93
-
94
72
  setTimeout(function () {
95
73
  if (props.onChange) props.onChange(res);
96
74
  });
@@ -99,7 +77,6 @@ var BizDnd = function BizDnd(props) {
99
77
  return target;
100
78
  });
101
79
  }
102
-
103
80
  return /*#__PURE__*/React.createElement("div", {
104
81
  className: "".concat(classPrefix, "-container ").concat(className)
105
82
  }, renderData.map(function (data, i) {
@@ -118,7 +95,6 @@ var BizDnd = function BizDnd(props) {
118
95
  });
119
96
  }));
120
97
  };
121
-
122
98
  BizDnd.defaultProps = {
123
99
  keyField: 'key'
124
100
  };
package/es/dnd/item.js CHANGED
@@ -1,15 +1,9 @@
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
- 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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useRef, useState } from 'react';
14
8
  import { classPrefix } from '.';
15
9
  var preMouse = {
@@ -22,28 +16,22 @@ var style = {
22
16
  left: 0,
23
17
  pointerEvents: 'inherit'
24
18
  };
25
-
26
19
  var BizDndItem = function BizDndItem(props) {
27
20
  var className = props.className,
28
- render = props.render,
29
- data = props.data,
30
- draddingClassName = props.draddingClassName;
31
-
21
+ render = props.render,
22
+ data = props.data,
23
+ draddingClassName = props.draddingClassName;
32
24
  var _useState = useState(false),
33
- _useState2 = _slicedToArray(_useState, 2),
34
- isDragging = _useState2[0],
35
- setIsDragging = _useState2[1];
36
-
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ isDragging = _useState2[0],
27
+ setIsDragging = _useState2[1];
37
28
  var ref = useRef();
38
-
39
29
  function onMousedown(e) {
40
30
  var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
41
- top = _e$currentTarget$getB.top,
42
- left = _e$currentTarget$getB.left;
43
-
31
+ top = _e$currentTarget$getB.top,
32
+ left = _e$currentTarget$getB.left;
44
33
  window.addEventListener('mousemove', onMouseMove);
45
34
  window.addEventListener('mouseup', onMouseUp);
46
-
47
35
  if (ref.current) {
48
36
  var computedStyle = window.getComputedStyle(ref.current);
49
37
  style = {
@@ -62,7 +50,6 @@ var BizDndItem = function BizDndItem(props) {
62
50
  setIsDragging(true);
63
51
  }
64
52
  }
65
-
66
53
  function onMouseMove(e) {
67
54
  var computedStyle = window.getComputedStyle(ref.current);
68
55
  style.position = 'fixed';
@@ -78,7 +65,6 @@ var BizDndItem = function BizDndItem(props) {
78
65
  };
79
66
  if (props.onDragging) props.onDragging(data);
80
67
  }
81
-
82
68
  function onMouseUp() {
83
69
  setIsDragging(false);
84
70
  window.removeEventListener('mousemove', onMouseMove);
@@ -94,7 +80,6 @@ var BizDndItem = function BizDndItem(props) {
94
80
  setStyle();
95
81
  if (props.onDropEnd) props.onDropEnd(data);
96
82
  }
97
-
98
83
  function setStyle() {
99
84
  if (ref.current) {
100
85
  ref.current.style.position = style.position;
@@ -104,12 +89,10 @@ var BizDndItem = function BizDndItem(props) {
104
89
  ref.current.style.width = style.width;
105
90
  }
106
91
  }
107
-
108
92
  if (props.data.isTemp) return /*#__PURE__*/React.createElement("div", {
109
93
  className: "".concat(classPrefix, "-item ").concat(className),
110
94
  ref: ref
111
95
  });
112
-
113
96
  if (props.data.disabled) {
114
97
  return /*#__PURE__*/React.createElement("div", {
115
98
  className: "".concat(classPrefix, "-item disable ").concat(className),
@@ -119,7 +102,6 @@ var BizDndItem = function BizDndItem(props) {
119
102
  }
120
103
  }, render(data, props.index));
121
104
  }
122
-
123
105
  if (props.handle) {
124
106
  var handle = /*#__PURE__*/React.createElement("span", {
125
107
  className: "".concat(classPrefix, "-handle ").concat(props.handleClassName),
@@ -133,7 +115,6 @@ var BizDndItem = function BizDndItem(props) {
133
115
  ref: ref
134
116
  }, render(data, props.index, handle));
135
117
  }
136
-
137
118
  return /*#__PURE__*/React.createElement("div", {
138
119
  className: "".concat(classPrefix, "-item ").concat(className, " ").concat(isDragging ? draddingClassName : ''),
139
120
  onMouseDown: onMousedown,
@@ -143,5 +124,4 @@ var BizDndItem = function BizDndItem(props) {
143
124
  ref: ref
144
125
  }, render(data, props.index));
145
126
  };
146
-
147
127
  export default BizDndItem;
@@ -1,40 +1,30 @@
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
- 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
-
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; } }
11
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
7
  import React, { useState } from 'react';
14
8
  import { BizEventSelector, convertAttributeData, BizGlobalDataContext } from '@zgfe/business-lib';
15
9
  import eventData from '../../mock/event';
16
-
17
10
  var EventDemo = function EventDemo() {
18
11
  var store = convertAttributeData({
19
12
  eventList: eventData
20
13
  });
21
-
22
14
  var _useState = useState({
23
- group: {
24
- id: 4201
25
- },
26
- event: {
27
- id: 24143017
28
- }
29
- }),
30
- _useState2 = _slicedToArray(_useState, 2),
31
- value = _useState2[0],
32
- setValue = _useState2[1];
33
-
15
+ group: {
16
+ id: 4201
17
+ },
18
+ event: {
19
+ id: 24143017
20
+ }
21
+ }),
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ value = _useState2[0],
24
+ setValue = _useState2[1];
34
25
  var onChange = function onChange(data) {
35
26
  setValue(data);
36
27
  };
37
-
38
28
  return /*#__PURE__*/React.createElement("div", {
39
29
  style: {
40
30
  height: '500px',
@@ -54,7 +44,6 @@ var EventDemo = function EventDemo() {
54
44
  onChange: onChange
55
45
  })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
56
46
  };
57
-
58
47
  export default (function () {
59
48
  return /*#__PURE__*/React.createElement(EventDemo, null);
60
49
  });