@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
package/es/dnd/item.js CHANGED
@@ -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 React, { useRef, useState } from 'react';
8
14
  import { classPrefix } from '.';
9
15
  var preMouse = {
@@ -16,22 +22,28 @@ var style = {
16
22
  left: 0,
17
23
  pointerEvents: 'inherit'
18
24
  };
25
+
19
26
  var BizDndItem = function BizDndItem(props) {
20
27
  var className = props.className,
21
- render = props.render,
22
- data = props.data,
23
- draddingClassName = props.draddingClassName;
28
+ render = props.render,
29
+ data = props.data,
30
+ draddingClassName = props.draddingClassName;
31
+
24
32
  var _useState = useState(false),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- isDragging = _useState2[0],
27
- setIsDragging = _useState2[1];
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ isDragging = _useState2[0],
35
+ setIsDragging = _useState2[1];
36
+
28
37
  var ref = useRef();
38
+
29
39
  function onMousedown(e) {
30
40
  var _e$currentTarget$getB = e.currentTarget.getBoundingClientRect(),
31
- top = _e$currentTarget$getB.top,
32
- left = _e$currentTarget$getB.left;
41
+ top = _e$currentTarget$getB.top,
42
+ left = _e$currentTarget$getB.left;
43
+
33
44
  window.addEventListener('mousemove', onMouseMove);
34
45
  window.addEventListener('mouseup', onMouseUp);
46
+
35
47
  if (ref.current) {
36
48
  var computedStyle = window.getComputedStyle(ref.current);
37
49
  style = {
@@ -50,6 +62,7 @@ var BizDndItem = function BizDndItem(props) {
50
62
  setIsDragging(true);
51
63
  }
52
64
  }
65
+
53
66
  function onMouseMove(e) {
54
67
  var computedStyle = window.getComputedStyle(ref.current);
55
68
  style.position = 'fixed';
@@ -65,6 +78,7 @@ var BizDndItem = function BizDndItem(props) {
65
78
  };
66
79
  if (props.onDragging) props.onDragging(data);
67
80
  }
81
+
68
82
  function onMouseUp() {
69
83
  setIsDragging(false);
70
84
  window.removeEventListener('mousemove', onMouseMove);
@@ -80,6 +94,7 @@ var BizDndItem = function BizDndItem(props) {
80
94
  setStyle();
81
95
  if (props.onDropEnd) props.onDropEnd(data);
82
96
  }
97
+
83
98
  function setStyle() {
84
99
  if (ref.current) {
85
100
  ref.current.style.position = style.position;
@@ -89,10 +104,12 @@ var BizDndItem = function BizDndItem(props) {
89
104
  ref.current.style.width = style.width;
90
105
  }
91
106
  }
107
+
92
108
  if (props.data.isTemp) return /*#__PURE__*/React.createElement("div", {
93
109
  className: "".concat(classPrefix, "-item ").concat(className),
94
110
  ref: ref
95
111
  });
112
+
96
113
  if (props.data.disabled) {
97
114
  return /*#__PURE__*/React.createElement("div", {
98
115
  className: "".concat(classPrefix, "-item disable ").concat(className),
@@ -102,6 +119,7 @@ var BizDndItem = function BizDndItem(props) {
102
119
  }
103
120
  }, render(data, props.index));
104
121
  }
122
+
105
123
  if (props.handle) {
106
124
  var handle = /*#__PURE__*/React.createElement("span", {
107
125
  className: "".concat(classPrefix, "-handle ").concat(props.handleClassName),
@@ -115,6 +133,7 @@ var BizDndItem = function BizDndItem(props) {
115
133
  ref: ref
116
134
  }, render(data, props.index, handle));
117
135
  }
136
+
118
137
  return /*#__PURE__*/React.createElement("div", {
119
138
  className: "".concat(classPrefix, "-item ").concat(className, " ").concat(isDragging ? draddingClassName : ''),
120
139
  onMouseDown: onMousedown,
@@ -124,4 +143,5 @@ var BizDndItem = function BizDndItem(props) {
124
143
  ref: ref
125
144
  }, render(data, props.index));
126
145
  };
146
+
127
147
  export default BizDndItem;
@@ -1,30 +1,40 @@
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 { BizEventSelector, convertAttributeData, BizGlobalDataContext } from '@zgfe/business-lib';
9
15
  import eventData from '../../mock/event';
16
+
10
17
  var EventDemo = function EventDemo() {
11
18
  var store = convertAttributeData({
12
19
  eventList: eventData
13
20
  });
21
+
14
22
  var _useState = useState({
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];
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
+
25
34
  var onChange = function onChange(data) {
26
35
  setValue(data);
27
36
  };
37
+
28
38
  return /*#__PURE__*/React.createElement("div", {
29
39
  style: {
30
40
  height: '500px',
@@ -44,6 +54,7 @@ var EventDemo = function EventDemo() {
44
54
  onChange: onChange
45
55
  })), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u9009\u62E9\u7684\u4E8B\u4EF6\u662F\uFF1A", JSON.stringify(value))));
46
56
  };
57
+
47
58
  export default (function () {
48
59
  return /*#__PURE__*/React.createElement(EventDemo, null);
49
60
  });
@@ -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 { Dropdown } from 'antd';
8
14
  import React, { useContext, useEffect, useState } from 'react';
9
15
  import SelectHandle from '../select/handle';
@@ -11,23 +17,28 @@ import BizGlobalDataContext from '../context';
11
17
  import EventListPanel from './listPanel';
12
18
  import './styles/index.less';
13
19
  export var classPrefix = 'biz-event-select';
20
+
14
21
  var BizEventSelector = function BizEventSelector(props) {
15
22
  var alias = props.alias,
16
- placeholder = props.placeholder,
17
- showAllEvent = props.showAllEvent,
18
- border = props.border,
19
- theme = props.theme,
20
- defaultSelectAble = props.defaultSelectAble;
23
+ placeholder = props.placeholder,
24
+ showAllEvent = props.showAllEvent,
25
+ border = props.border,
26
+ theme = props.theme,
27
+ defaultSelectAble = props.defaultSelectAble;
28
+
21
29
  var _useState = useState(),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- currentValue = _useState2[0],
24
- setCurrentValue = _useState2[1];
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ currentValue = _useState2[0],
32
+ setCurrentValue = _useState2[1];
33
+
25
34
  var _useState3 = useState(false),
26
- _useState4 = _slicedToArray(_useState3, 2),
27
- visible = _useState4[0],
28
- setVisible = _useState4[1];
35
+ _useState4 = _slicedToArray(_useState3, 2),
36
+ visible = _useState4[0],
37
+ setVisible = _useState4[1];
38
+
29
39
  var _useContext = useContext(BizGlobalDataContext),
30
- eventGroupList = _useContext.eventGroupList;
40
+ eventGroupList = _useContext.eventGroupList;
41
+
31
42
  var selectId = (Math.random() + 10).toString();
32
43
  useEffect(function () {
33
44
  if (!props.defaultValue) return;
@@ -39,9 +50,12 @@ var BizEventSelector = function BizEventSelector(props) {
39
50
  var data = getValue(props.value);
40
51
  setCurrentValue(data);
41
52
  }, [props.value]);
53
+
42
54
  var getValue = function getValue(param) {
43
55
  var _param$group, _param$event;
56
+
44
57
  var res = {};
58
+
45
59
  if (!((_param$group = param.group) === null || _param$group === void 0 ? void 0 : _param$group.id)) {
46
60
  res.group = {
47
61
  id: 0,
@@ -55,6 +69,7 @@ var BizEventSelector = function BizEventSelector(props) {
55
69
  }()
56
70
  };
57
71
  }
72
+
58
73
  if (((_param$event = param.event) === null || _param$event === void 0 ? void 0 : _param$event.id) === -100) {
59
74
  res.event = {
60
75
  id: -100,
@@ -62,41 +77,53 @@ var BizEventSelector = function BizEventSelector(props) {
62
77
  attrList: []
63
78
  };
64
79
  }
80
+
65
81
  eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
66
82
  var _param$group2;
83
+
67
84
  if (group.id === ((_param$group2 = param.group) === null || _param$group2 === void 0 ? void 0 : _param$group2.id)) res.group = group;
68
85
  group.eventList.forEach(function (event) {
69
86
  var _param$event2;
87
+
70
88
  if (event.id === ((_param$event2 = param.event) === null || _param$event2 === void 0 ? void 0 : _param$event2.id)) res.event = event;
71
89
  });
72
90
  });
73
91
  return res;
74
92
  };
93
+
75
94
  var getLabel = function getLabel() {
76
95
  var label = '';
77
96
  if (!(currentValue === null || currentValue === void 0 ? void 0 : currentValue.event)) return label;
78
97
  var name = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.alias) || (currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.name);
98
+
79
99
  if ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.event.id) === -100) {
80
100
  var _currentValue$group;
101
+
81
102
  label = "".concat((currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$group = currentValue.group) === null || _currentValue$group === void 0 ? void 0 : _currentValue$group.name) || '所有分组', "/").concat(name);
82
103
  } else {
83
104
  label = name;
84
105
  }
106
+
85
107
  if (alias && alias !== name) {
86
108
  label += "(".concat(alias, ")");
87
109
  }
110
+
88
111
  return label;
89
112
  };
113
+
90
114
  var onChange = function onChange(value, isOverview) {
91
115
  if (!defaultSelectAble && !isOverview) {
92
116
  setVisible(false);
93
117
  }
118
+
94
119
  setCurrentValue(value);
95
120
  props.onChange && props.onChange(value);
96
121
  };
122
+
97
123
  var onVisibleChange = function onVisibleChange(flag) {
98
124
  setVisible(flag);
99
125
  };
126
+
100
127
  return /*#__PURE__*/React.createElement("div", {
101
128
  className: [classPrefix, border ? 'border' : ''].join(' ')
102
129
  }, /*#__PURE__*/React.createElement(Dropdown, {
@@ -128,6 +155,7 @@ var BizEventSelector = function BizEventSelector(props) {
128
155
  size: props.size
129
156
  }))));
130
157
  };
158
+
131
159
  BizEventSelector.defaultProps = {
132
160
  showAllEvent: true,
133
161
  defaultSelectAble: true,
@@ -1,13 +1,23 @@
1
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
2
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
3
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+
4
7
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+
5
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+
6
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+
7
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
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; } }
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
+
10
19
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
+
11
21
  import { Skeleton } from 'antd';
12
22
  import _ from 'lodash';
13
23
  import React, { useContext, useEffect, useState } from 'react';
@@ -17,31 +27,39 @@ import { BizGlobalDataContext } from '..';
17
27
  import { ShowStatus } from '../attributeSelector/types';
18
28
  import BizSearchInput from '../searchInput';
19
29
  import EventListOption from './option';
30
+
20
31
  var EventListPanel = function EventListPanel(props) {
21
32
  var showOverview = props.showOverview,
22
- defaultSelectAble = props.defaultSelectAble;
33
+ defaultSelectAble = props.defaultSelectAble;
34
+
23
35
  var _useState = useState(''),
24
- _useState2 = _slicedToArray(_useState, 2),
25
- searchValue = _useState2[0],
26
- setSearchValue = _useState2[1];
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ searchValue = _useState2[0],
38
+ setSearchValue = _useState2[1];
39
+
27
40
  var _useContext = useContext(BizGlobalDataContext),
28
- eventGroupList = _useContext.eventGroupList;
41
+ eventGroupList = _useContext.eventGroupList;
42
+
29
43
  var _useState3 = useState(eventGroupList || []),
30
- _useState4 = _slicedToArray(_useState3, 2),
31
- groupList = _useState4[0],
32
- setGroupList = _useState4[1];
44
+ _useState4 = _slicedToArray(_useState3, 2),
45
+ groupList = _useState4[0],
46
+ setGroupList = _useState4[1];
47
+
33
48
  var _useState5 = useState(),
34
- _useState6 = _slicedToArray(_useState5, 2),
35
- currentGroup = _useState6[0],
36
- setCurrentGroup = _useState6[1];
49
+ _useState6 = _slicedToArray(_useState5, 2),
50
+ currentGroup = _useState6[0],
51
+ setCurrentGroup = _useState6[1];
52
+
37
53
  var _useState7 = useState([]),
38
- _useState8 = _slicedToArray(_useState7, 2),
39
- searchEventList = _useState8[0],
40
- setSearchEventList = _useState8[1];
54
+ _useState8 = _slicedToArray(_useState7, 2),
55
+ searchEventList = _useState8[0],
56
+ setSearchEventList = _useState8[1];
57
+
41
58
  var _useState9 = useState(),
42
- _useState10 = _slicedToArray(_useState9, 2),
43
- currentValue = _useState10[0],
44
- setCurrentValue = _useState10[1];
59
+ _useState10 = _slicedToArray(_useState9, 2),
60
+ currentValue = _useState10[0],
61
+ setCurrentValue = _useState10[1];
62
+
45
63
  var scrollableId = 'scrollableDiv' + Math.random();
46
64
  var overviewData = {
47
65
  id: -100,
@@ -64,6 +82,7 @@ var EventListPanel = function EventListPanel(props) {
64
82
  } else {
65
83
  list.push(item);
66
84
  }
85
+
67
86
  listObj[item.id] = 1;
68
87
  }
69
88
  });
@@ -92,19 +111,25 @@ var EventListPanel = function EventListPanel(props) {
92
111
  return list;
93
112
  });
94
113
  }, [searchValue, currentGroup, showOverview]);
114
+
95
115
  function onClickEvent(e) {
96
116
  var resVal = _.cloneDeep(currentValue) || {};
97
117
  resVal.event = e;
118
+
98
119
  if (e.id === -100) {
99
120
  resVal.group = currentGroup;
100
121
  }
122
+
101
123
  setCurrentValue(resVal);
102
124
  if (props.onChange) props.onChange(resVal);
103
125
  }
126
+
104
127
  function onClickGroup(g) {
105
128
  var _currentValue$event;
129
+
106
130
  setCurrentGroup(g);
107
131
  var isOverview = (currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$event = currentValue.event) === null || _currentValue$event === void 0 ? void 0 : _currentValue$event.id) === -100;
132
+
108
133
  if (defaultSelectAble || isOverview) {
109
134
  var resVal = _.cloneDeep(currentValue) || {};
110
135
  resVal.group = g;
@@ -113,6 +138,7 @@ var EventListPanel = function EventListPanel(props) {
113
138
  if (props.onChange) props.onChange(resVal, isOverview);
114
139
  }
115
140
  }
141
+
116
142
  if (!groupList || !groupList.length || !groupList[0].eventList || !groupList[0].eventList.length) {
117
143
  return /*#__PURE__*/React.createElement("div", {
118
144
  className: "".concat(classPrefix, "-nodata-panel")
@@ -120,6 +146,7 @@ var EventListPanel = function EventListPanel(props) {
120
146
  className: "".concat(classPrefix, "-nodata")
121
147
  }, "\u6682\u65E0\u6570\u636E"));
122
148
  }
149
+
123
150
  return /*#__PURE__*/React.createElement("div", {
124
151
  className: "".concat(classPrefix, "-list-panel")
125
152
  }, /*#__PURE__*/React.createElement("div", {
@@ -155,29 +182,43 @@ var EventListPanel = function EventListPanel(props) {
155
182
  onClick: onClickEvent
156
183
  }))));
157
184
  };
185
+
158
186
  var InfiniteScrollList = function InfiniteScrollList(_ref) {
159
187
  var scrollableTarget = _ref.scrollableTarget,
160
- searchEventList = _ref.searchEventList,
161
- searchValue = _ref.searchValue,
162
- currentGroup = _ref.currentGroup,
163
- currentValue = _ref.currentValue,
164
- onClick = _ref.onClick;
188
+ searchEventList = _ref.searchEventList,
189
+ searchValue = _ref.searchValue,
190
+ currentGroup = _ref.currentGroup,
191
+ currentValue = _ref.currentValue,
192
+ onClick = _ref.onClick;
193
+
165
194
  var _useState11 = useState([]),
166
- _useState12 = _slicedToArray(_useState11, 2),
167
- showList = _useState12[0],
168
- setShowList = _useState12[1];
195
+ _useState12 = _slicedToArray(_useState11, 2),
196
+ showList = _useState12[0],
197
+ setShowList = _useState12[1];
198
+
199
+ var _useState13 = useState([]),
200
+ _useState14 = _slicedToArray(_useState13, 2),
201
+ canShowList = _useState14[0],
202
+ setCanShowList = _useState14[1];
203
+
169
204
  useEffect(function () {
170
- setShowList(searchEventList.slice(0, 10));
205
+ var data = searchEventList.filter(function (item) {
206
+ return item.eventHidden !== ShowStatus.hidden;
207
+ });
208
+ setCanShowList(data);
209
+ setShowList(data.slice(0, 10));
171
210
  }, [searchEventList]);
211
+
172
212
  var loadMoreData = function loadMoreData() {
173
- var moreData = searchEventList.slice(showList.length, showList.length + 10);
213
+ var moreData = canShowList.slice(showList.length, showList.length + 10);
174
214
  setShowList(function (list) {
175
215
  return [].concat(_toConsumableArray(list), _toConsumableArray(moreData));
176
216
  });
177
217
  };
218
+
178
219
  return /*#__PURE__*/React.createElement(InfiniteScroll, {
179
220
  dataLength: showList.length,
180
- hasMore: showList.length < searchEventList.length,
221
+ hasMore: showList.length < canShowList.length,
181
222
  loader: /*#__PURE__*/React.createElement(Skeleton, {
182
223
  paragraph: {
183
224
  rows: 1
@@ -190,7 +231,7 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
190
231
  key: Math.random()
191
232
  }, showList.map(function (e) {
192
233
  var _currentValue$event2;
193
- if (e.eventHidden === ShowStatus.hidden) return null;
234
+
194
235
  return /*#__PURE__*/React.createElement(EventListOption, {
195
236
  label: e.alias || e.name,
196
237
  key: "".concat(currentGroup === null || currentGroup === void 0 ? void 0 : currentGroup.id, "-").concat(e.id),
@@ -204,4 +245,5 @@ var InfiniteScrollList = function InfiniteScrollList(_ref) {
204
245
  });
205
246
  }));
206
247
  };
248
+
207
249
  export default EventListPanel;
@@ -3,17 +3,20 @@ import React from 'react';
3
3
  import { classPrefix } from '.';
4
4
  import IconFont from '../icon/iconFont';
5
5
  import { util } from '../utils';
6
+
6
7
  var EventListOption = function EventListOption(props) {
7
8
  var showCount = props.showCount,
8
- count = props.count,
9
- label = props.label,
10
- checked = props.checked,
11
- highlight = props.highlight,
12
- onClick = props.onClick,
13
- data = props.data;
9
+ count = props.count,
10
+ label = props.label,
11
+ checked = props.checked,
12
+ highlight = props.highlight,
13
+ onClick = props.onClick,
14
+ data = props.data;
15
+
14
16
  var _onClick = function _onClick() {
15
17
  if (onClick) onClick(data);
16
18
  };
19
+
17
20
  function getLabel(label) {
18
21
  if (!highlight || !highlight.enable || !highlight.text) return label;
19
22
  var text = highlight.text;
@@ -27,6 +30,7 @@ var EventListOption = function EventListOption(props) {
27
30
  }, text);
28
31
  });
29
32
  }
33
+
30
34
  return /*#__PURE__*/React.createElement("div", {
31
35
  className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : ''),
32
36
  onClick: _onClick
@@ -41,4 +45,5 @@ var EventListOption = function EventListOption(props) {
41
45
  count: count
42
46
  }));
43
47
  };
48
+
44
49
  export default EventListOption;
@@ -1,18 +1,23 @@
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
  var _excluded = ["className", "type", "family"];
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
+
4
5
  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; }
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); }
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
+
8
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+
9
11
  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; }
12
+
10
13
  import React, { useMemo } from 'react';
14
+
11
15
  var IconFont = function IconFont(props) {
12
16
  var className = props.className,
13
- type = props.type,
14
- family = props.family,
15
- rest = _objectWithoutProperties(props, _excluded);
17
+ type = props.type,
18
+ family = props.family,
19
+ rest = _objectWithoutProperties(props, _excluded);
20
+
16
21
  var iconClassName = useMemo(function () {
17
22
  return "".concat(family, " ").concat(className, " ").concat(type);
18
23
  }, [className, type]);
@@ -23,6 +28,7 @@ var IconFont = function IconFont(props) {
23
28
  }
24
29
  }, rest));
25
30
  };
31
+
26
32
  IconFont.defaultProps = {
27
33
  className: '',
28
34
  family: 'bsicon'
package/es/index.d.ts CHANGED
@@ -28,8 +28,7 @@ import BizDnd from './dnd';
28
28
  import BizDetailLayout from './layout/detail';
29
29
  import BizLoginForm from './loginForm';
30
30
  import DemoWrapper from './demoWrapper';
31
- import SocketClient from './socket';
32
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
31
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig, };
33
32
  export type { UserGroupTypes } from './userGroup/types';
34
33
  export type { BizSelectTypes } from './select/types';
35
34
  export type { AttributeSelect } from './attributeSelector/types';
package/es/index.js CHANGED
@@ -27,5 +27,4 @@ import BizDnd from './dnd';
27
27
  import BizDetailLayout from './layout/detail';
28
28
  import BizLoginForm from './loginForm';
29
29
  import DemoWrapper from './demoWrapper';
30
- import SocketClient from './socket';
31
- export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, SocketClient, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };
30
+ export { BizSearchInput, BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizDetailLayout, BizUserGroup, IconFont, BizTargetSelector, BizEventSelector, BizAttributeSelector, BizGlobalDataContext, BizTargetCondition, BizDatePicker, BizConditionItem, BizConditionGroup, BizUserCondition, BizAddToScene, BizAddToPanel, BizCycleTime, BizDnd, BizLoginForm, DemoWrapper, ajax, util, theme, convertAttributeData, BizUserTagsSelect, setGlobalConfig };