@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,49 +1,67 @@
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 React, { useEffect, useImperativeHandle, useState } from 'react';
12
22
  import BizConditionItem from './index';
13
23
  import './styles/group.less';
14
24
  import _ from 'lodash';
15
25
  import { Skeleton } from 'antd';
26
+
16
27
  var BizConditionGroup = function BizConditionGroup(props, ref) {
17
28
  var eventIdList = props.eventIdList,
18
- enableDelete = props.enableDelete,
19
- enableEventProp = props.enableEventProp,
20
- enableUserProp = props.enableUserProp,
21
- enableEnvProp = props.enableEnvProp,
22
- disableItemList = props.disableItemList,
23
- onConditionsCount = props.onConditionsCount;
29
+ enableDelete = props.enableDelete,
30
+ enableEventProp = props.enableEventProp,
31
+ enableUserProp = props.enableUserProp,
32
+ enableEnvProp = props.enableEnvProp,
33
+ disableItemList = props.disableItemList,
34
+ onConditionsCount = props.onConditionsCount;
35
+
24
36
  var _useState = useState('and'),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- relation = _useState2[0],
27
- setRelation = _useState2[1];
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ relation = _useState2[0],
39
+ setRelation = _useState2[1];
40
+
28
41
  var _useState3 = useState([]),
29
- _useState4 = _slicedToArray(_useState3, 2),
30
- conditions = _useState4[0],
31
- setConditions = _useState4[1];
42
+ _useState4 = _slicedToArray(_useState3, 2),
43
+ conditions = _useState4[0],
44
+ setConditions = _useState4[1];
45
+
32
46
  var _useState5 = useState(true),
33
- _useState6 = _slicedToArray(_useState5, 2),
34
- ready = _useState6[0],
35
- setReady = _useState6[1];
47
+ _useState6 = _slicedToArray(_useState5, 2),
48
+ ready = _useState6[0],
49
+ setReady = _useState6[1];
50
+
36
51
  var classPrefix = 'biz-condition';
37
52
  useEffect(function () {
38
53
  var data = props.defaultValue || props.value;
54
+
39
55
  if (data) {
40
56
  if (data.relation) setRelation(props.onlyAnd ? 'and' : data.relation);
57
+
41
58
  if (data.conditions) {
42
59
  setConditions(function () {
43
60
  return addKeyToGroup(data.conditions);
44
61
  });
45
62
  }
46
63
  }
64
+
47
65
  setReady(false);
48
66
  }, []);
49
67
  useImperativeHandle(ref, function () {
@@ -60,6 +78,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
60
78
  setValue: function setValue(data) {
61
79
  if (data) {
62
80
  if (data.relation) setRelation(props.onlyAnd ? 'and' : data.relation);
81
+
63
82
  if (data.conditions) {
64
83
  setConditions(function () {
65
84
  return addKeyToGroup(data.conditions);
@@ -72,6 +91,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
72
91
  }
73
92
  };
74
93
  });
94
+
75
95
  var addKeyToGroup = function addKeyToGroup(data) {
76
96
  return data.map(function (item) {
77
97
  return {
@@ -80,6 +100,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
80
100
  };
81
101
  });
82
102
  };
103
+
83
104
  var removeKeyToGroup = function removeKeyToGroup(data) {
84
105
  var group = [];
85
106
  data.forEach(function (item) {
@@ -87,10 +108,12 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
87
108
  });
88
109
  return group;
89
110
  };
111
+
90
112
  var onClickRelation = function onClickRelation(e) {
91
113
  e.stopPropagation();
92
114
  var data = e.target.innerText === '且' ? 'and' : 'or';
93
115
  setRelation(data);
116
+
94
117
  if (props.onChange) {
95
118
  var group = removeKeyToGroup(conditions);
96
119
  props.onChange({
@@ -99,11 +122,14 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
99
122
  });
100
123
  }
101
124
  };
125
+
102
126
  var _onChange = function onChange(data, index) {
103
127
  var conditionArr = _.cloneDeep(conditions);
128
+
104
129
  conditionArr[index].data = data;
105
130
  setConditions(conditionArr);
106
131
  onConditionsCount && onConditionsCount(conditionArr.length);
132
+
107
133
  if (props.onChange) {
108
134
  var group = removeKeyToGroup(conditionArr);
109
135
  props.onChange({
@@ -112,11 +138,14 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
112
138
  });
113
139
  }
114
140
  };
141
+
115
142
  var _onDelete = function onDelete(index) {
116
143
  var conditionArr = _.cloneDeep(conditions);
144
+
117
145
  conditionArr.splice(index, 1);
118
146
  setConditions(conditionArr);
119
147
  onConditionsCount && onConditionsCount(conditionArr.length);
148
+
120
149
  if (props.onChange) {
121
150
  var group = removeKeyToGroup(conditionArr);
122
151
  props.onChange({
@@ -125,6 +154,7 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
125
154
  });
126
155
  }
127
156
  };
157
+
128
158
  return /*#__PURE__*/React.createElement("div", {
129
159
  className: classPrefix
130
160
  }, /*#__PURE__*/React.createElement(Skeleton, {
@@ -163,4 +193,5 @@ var BizConditionGroup = function BizConditionGroup(props, ref) {
163
193
  });
164
194
  }))));
165
195
  };
196
+
166
197
  export default /*#__PURE__*/React.forwardRef(BizConditionGroup);
@@ -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, { useEffect, useState } from 'react';
8
14
  import BizAttributeSelector from '../attributeSelector';
9
15
  import { PropCategory } from '../attributeSelector/types';
@@ -12,37 +18,46 @@ import BizOperateList from './components/operateList';
12
18
  import ValuesList from './components/valuesList';
13
19
  import { Skeleton } from 'antd';
14
20
  export var classPrefix = 'biz-condition-item';
21
+
15
22
  var BizConditionItem = function BizConditionItem(props) {
16
23
  var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
24
+
17
25
  var defaultValue = props.defaultValue,
18
- eventIdList = props.eventIdList,
19
- enableDelete = props.enableDelete,
20
- enableEventProp = props.enableEventProp,
21
- enableUserProp = props.enableUserProp,
22
- enableEnvProp = props.enableEnvProp,
23
- disableItemList = props.disableItemList,
24
- border = props.border,
25
- theme = props.theme;
26
+ eventIdList = props.eventIdList,
27
+ enableDelete = props.enableDelete,
28
+ enableEventProp = props.enableEventProp,
29
+ enableUserProp = props.enableUserProp,
30
+ enableEnvProp = props.enableEnvProp,
31
+ disableItemList = props.disableItemList,
32
+ border = props.border,
33
+ theme = props.theme;
34
+
26
35
  var _useState = useState(),
27
- _useState2 = _slicedToArray(_useState, 2),
28
- attr = _useState2[0],
29
- setAttr = _useState2[1];
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ attr = _useState2[0],
38
+ setAttr = _useState2[1];
39
+
30
40
  var _useState3 = useState(((_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.operator) || ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.operator)),
31
- _useState4 = _slicedToArray(_useState3, 2),
32
- operate = _useState4[0],
33
- setOperate = _useState4[1];
41
+ _useState4 = _slicedToArray(_useState3, 2),
42
+ operate = _useState4[0],
43
+ setOperate = _useState4[1];
44
+
34
45
  var _useState5 = useState(((_props$defaultValue2 = props.defaultValue) === null || _props$defaultValue2 === void 0 ? void 0 : _props$defaultValue2.values) || ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.values)),
35
- _useState6 = _slicedToArray(_useState5, 2),
36
- values = _useState6[0],
37
- setValues = _useState6[1];
46
+ _useState6 = _slicedToArray(_useState5, 2),
47
+ values = _useState6[0],
48
+ setValues = _useState6[1];
49
+
38
50
  var _useState7 = useState(true),
39
- _useState8 = _slicedToArray(_useState7, 2),
40
- ready = _useState8[0],
41
- setReady = _useState8[1];
51
+ _useState8 = _slicedToArray(_useState7, 2),
52
+ ready = _useState8[0],
53
+ setReady = _useState8[1];
54
+
42
55
  useEffect(function () {
43
56
  var data = defaultValue || props.value;
57
+
44
58
  if (data) {
45
59
  var attrData;
60
+
46
61
  if (data.propCategory === PropCategory.EventProp) {
47
62
  if (data.attrId) {
48
63
  attrData = {
@@ -68,13 +83,17 @@ var BizConditionItem = function BizConditionItem(props) {
68
83
  };
69
84
  }
70
85
  }
86
+
71
87
  setAttr(attrData);
72
88
  }
89
+
73
90
  setReady(false);
74
91
  }, []);
92
+
75
93
  var onDelete = function onDelete() {
76
94
  if (props.onDelete) props.onDelete();
77
95
  };
96
+
78
97
  useEffect(function () {
79
98
  if (props.onChange) {
80
99
  if (!attr) return;
@@ -87,27 +106,34 @@ var BizConditionItem = function BizConditionItem(props) {
87
106
  dimensionSub: attr.dimensionSub,
88
107
  label: attr.label
89
108
  };
109
+
90
110
  if (attr.propCategory === PropCategory.EventProp) {
91
111
  responseData.attrName = attr.label;
92
112
  } else {
93
113
  responseData.attrName = attr.name;
94
114
  responseData.category = attr.category;
115
+
95
116
  if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
96
117
  responseData.subtype = attr.subtype;
97
118
  }
98
119
  }
120
+
99
121
  props.onChange(responseData);
100
122
  }
101
123
  }, [attr, operate, values]);
124
+
102
125
  var onChangeAttr = function onChangeAttr(attrData) {
103
126
  setAttr(attrData);
104
127
  };
128
+
105
129
  var onChangeOperate = function onChangeOperate(data) {
106
130
  setOperate(data);
107
131
  };
132
+
108
133
  var onChangeValues = function onChangeValues(data) {
109
134
  setValues(data);
110
135
  };
136
+
111
137
  return /*#__PURE__*/React.createElement("div", {
112
138
  className: [classPrefix, border ? 'border' : ''].join(' ')
113
139
  }, /*#__PURE__*/React.createElement(Skeleton, {
@@ -143,6 +169,7 @@ var BizConditionItem = function BizConditionItem(props) {
143
169
  theme: theme
144
170
  }))));
145
171
  };
172
+
146
173
  BizConditionItem.defaultProps = {
147
174
  border: true,
148
175
  theme: 'secondary'
@@ -1,4 +1,5 @@
1
1
  export var OperateTypes;
2
+
2
3
  (function (OperateTypes) {
3
4
  OperateTypes["Equal"] = "equal";
4
5
  OperateTypes["Contains"] = "contains";
@@ -1,23 +1,31 @@
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 { BizAttributeSelector, DemoWrapper } from '@zgfe/business-lib';
9
15
  import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
10
16
  export default (function () {
11
17
  var _useState = useState({
12
- id: 30183426,
13
- propCategory: 'eventProp'
14
- }),
15
- _useState2 = _slicedToArray(_useState, 2),
16
- attribute = _useState2[0],
17
- setAttribute = _useState2[1];
18
+ id: 30183426,
19
+ propCategory: 'eventProp'
20
+ }),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ attribute = _useState2[0],
23
+ setAttribute = _useState2[1];
24
+
18
25
  function onChange(val) {
19
26
  setAttribute(val);
20
27
  }
28
+
21
29
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)), /*#__PURE__*/React.createElement(DemoWrapper, {
22
30
  needMeta: true
23
31
  }, /*#__PURE__*/React.createElement(BizAttributeSelector, {
@@ -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, { useState } from 'react';
8
14
  import { BizAttributeSelector, BizGlobalDataContext } from '@zgfe/business-lib';
9
15
  import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
@@ -13,20 +19,23 @@ import userData from './userData.js';
13
19
  import convertAttributeData from '../util';
14
20
  export default (function () {
15
21
  var _useState = useState({
16
- id: 30183426,
17
- propCategory: 'eventProp'
18
- }),
19
- _useState2 = _slicedToArray(_useState, 2),
20
- attribute = _useState2[0],
21
- setAttribute = _useState2[1];
22
+ id: 30183426,
23
+ propCategory: 'eventProp'
24
+ }),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ attribute = _useState2[0],
27
+ setAttribute = _useState2[1];
28
+
22
29
  var store = convertAttributeData({
23
30
  eventList: eventData,
24
31
  userPropList: userData,
25
32
  envPropList: envData
26
33
  });
34
+
27
35
  function onChange(val) {
28
36
  setAttribute(val);
29
37
  }
38
+
30
39
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u5C5E\u6027\u662F\uFF1A", JSON.stringify(attribute)), /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
31
40
  value: {
32
41
  eventGroupList: store.eventGroupList,
@@ -1,15 +1,21 @@
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
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
8
9
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
9
11
  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); }
10
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
- 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; } }
12
+
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
12
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
13
19
  import React, { useContext, useEffect, useRef, useState } from 'react';
14
20
  import './styles/index.less';
15
21
  import { Dropdown, Tooltip } from 'antd';
@@ -17,31 +23,40 @@ import AttrListPanel from './listPanel';
17
23
  import IconFont from '../icon/iconFont';
18
24
  import { BizGlobalDataContext } from '..';
19
25
  import SelectHandle from '../select/handle';
26
+
20
27
  var BizAttributeSelector = function BizAttributeSelector(props) {
21
28
  var enableDelete = props.enableDelete,
22
- placeholder = props.placeholder,
23
- theme = props.theme;
29
+ placeholder = props.placeholder,
30
+ theme = props.theme;
31
+
24
32
  var _useState = useState(),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- currentAttr = _useState2[0],
27
- setCurrentAttr = _useState2[1];
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ currentAttr = _useState2[0],
35
+ setCurrentAttr = _useState2[1];
36
+
28
37
  var _useState3 = useState(false),
29
- _useState4 = _slicedToArray(_useState3, 2),
30
- visible = _useState4[0],
31
- setVisible = _useState4[1];
38
+ _useState4 = _slicedToArray(_useState3, 2),
39
+ visible = _useState4[0],
40
+ setVisible = _useState4[1];
41
+
32
42
  var classPrefix = 'biz-attr-select';
43
+
33
44
  var _useState5 = useState(String(Math.random())),
34
- _useState6 = _slicedToArray(_useState5, 1),
35
- id = _useState6[0];
45
+ _useState6 = _slicedToArray(_useState5, 1),
46
+ id = _useState6[0];
47
+
36
48
  var _useContext = useContext(BizGlobalDataContext),
37
- eventGroupList = _useContext.eventGroupList,
38
- userPropList = _useContext.userPropList,
39
- eventEnvList = _useContext.eventEnvList;
49
+ eventGroupList = _useContext.eventGroupList,
50
+ userPropList = _useContext.userPropList,
51
+ eventEnvList = _useContext.eventEnvList;
52
+
40
53
  var boxRef = useRef(null);
54
+
41
55
  var _useState7 = useState(200),
42
- _useState8 = _slicedToArray(_useState7, 2),
43
- width = _useState8[0],
44
- setWidth = _useState8[1];
56
+ _useState8 = _slicedToArray(_useState7, 2),
57
+ width = _useState8[0],
58
+ setWidth = _useState8[1];
59
+
45
60
  useEffect(function () {
46
61
  setWidth(boxRef.current.width || 284);
47
62
  if (!props.defaultValue) return;
@@ -50,8 +65,10 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
50
65
  useEffect(function () {
51
66
  setCurrentAttr(getValue(props.value));
52
67
  }, [props.value]);
68
+
53
69
  function getValue(param) {
54
70
  var res = undefined;
71
+
55
72
  if ((param === null || param === void 0 ? void 0 : param.propCategory) === 'envProp') {
56
73
  eventEnvList === null || eventEnvList === void 0 ? void 0 : eventEnvList.forEach(function (attr) {
57
74
  if (attr.name === param.name) res = attr;
@@ -69,19 +86,24 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
69
86
  if (attr.name === param.name && attr.category === param.category) res = attr;
70
87
  });
71
88
  }
89
+
72
90
  return res;
73
91
  }
92
+
74
93
  function onDelete() {
75
94
  if (props.onDelete) props.onDelete(currentAttr);
76
95
  }
96
+
77
97
  function onChange(val) {
78
98
  setVisible(false);
79
99
  setCurrentAttr(val);
80
100
  if (props.onChange) props.onChange(val);
81
101
  }
102
+
82
103
  var onVisibleChange = function onVisibleChange(flag) {
83
104
  setVisible(flag);
84
105
  };
106
+
85
107
  return /*#__PURE__*/React.createElement("div", {
86
108
  className: classPrefix
87
109
  }, /*#__PURE__*/React.createElement("div", {
@@ -122,6 +144,7 @@ var BizAttributeSelector = function BizAttributeSelector(props) {
122
144
  onClick: onDelete
123
145
  }))));
124
146
  };
147
+
125
148
  BizAttributeSelector.defaultProps = {
126
149
  enableDelete: false,
127
150
  placeholder: '请选择',