@zgfe/business-lib 1.1.22 → 1.1.24

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 (129) 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.d.ts +3 -1
  11. package/es/assets/demo/index.js +0 -2
  12. package/es/assets/demo/input.js +5 -12
  13. package/es/assets/iconfont/iconfont.js +10 -17
  14. package/es/assets/styles/resetAntd.less +5 -0
  15. package/es/assets/theme.js +0 -1
  16. package/es/attrConditions/components/operateList.js +10 -27
  17. package/es/attrConditions/components/stringList.js +68 -97
  18. package/es/attrConditions/components/valuesList.js +14 -40
  19. package/es/attrConditions/demo/group.js +11 -23
  20. package/es/attrConditions/demo/index.js +17 -26
  21. package/es/attrConditions/group.js +17 -48
  22. package/es/attrConditions/index.js +22 -49
  23. package/es/attrConditions/types.js +0 -1
  24. package/es/attributeSelector/demo/disable.js +8 -16
  25. package/es/attributeSelector/demo/index.js +8 -17
  26. package/es/attributeSelector/index.js +22 -45
  27. package/es/attributeSelector/listPanel.js +18 -46
  28. package/es/attributeSelector/option.js +3 -13
  29. package/es/attributeSelector/types.js +0 -5
  30. package/es/attributeSelector/util.js +0 -3
  31. package/es/chart/demo/index.js +5 -14
  32. package/es/chart/index.js +30 -44
  33. package/es/chart/util/chartOptionConfig.d.ts +3 -3
  34. package/es/chart/util/chartOptionConfig.js +13 -37
  35. package/es/chart/util/data/china.js +1 -4
  36. package/es/chart/util/formatData.d.ts +2 -2
  37. package/es/chart/util/formatData.js +0 -5
  38. package/es/chart/util/formatOption.js +0 -13
  39. package/es/chart/util/mapUtil.js +5 -26
  40. package/es/config.js +0 -2
  41. package/es/cycleTime/demo/disable.js +0 -1
  42. package/es/cycleTime/index.js +19 -46
  43. package/es/cycleTime/month.js +8 -27
  44. package/es/datePicker/datePicker.js +5 -23
  45. package/es/datePicker/demo/customType.js +13 -22
  46. package/es/datePicker/demo/day.js +13 -22
  47. package/es/datePicker/demo/index.js +12 -21
  48. package/es/datePicker/index.js +18 -41
  49. package/es/datePicker/utils.js +0 -7
  50. package/es/demoWrapper/content.js +31 -56
  51. package/es/demoWrapper/head.js +9 -23
  52. package/es/demoWrapper/index.js +14 -30
  53. package/es/dialog/demo/index.js +5 -12
  54. package/es/dialog/index.js +4 -6
  55. package/es/dnd/demo/data.js +19 -28
  56. package/es/dnd/demo/handle.js +19 -28
  57. package/es/dnd/index.js +21 -45
  58. package/es/dnd/item.js +10 -30
  59. package/es/eventSelector/demo/index.js +12 -23
  60. package/es/eventSelector/index.js +14 -42
  61. package/es/eventSelector/listPanel.js +26 -60
  62. package/es/eventSelector/option.js +6 -11
  63. package/es/icon/iconFont.js +7 -13
  64. package/es/layout/analysisLayout/demo/index.js +0 -6
  65. package/es/layout/analysisLayout/index.d.ts +1 -1
  66. package/es/layout/analysisLayout/index.js +16 -34
  67. package/es/layout/detail/index.js +1 -3
  68. package/es/loginForm/index.js +7 -18
  69. package/es/searchInput/index.js +2 -7
  70. package/es/select/demo/children.js +8 -16
  71. package/es/select/demo/customLabel.js +0 -2
  72. package/es/select/demo/group.js +8 -17
  73. package/es/select/demo/index.js +11 -19
  74. package/es/select/demo/loading.js +8 -18
  75. package/es/select/demo/multiple.js +8 -16
  76. package/es/select/handle.js +14 -34
  77. package/es/select/index.js +22 -58
  78. package/es/select/option.js +10 -26
  79. package/es/select/overlay.js +25 -55
  80. package/es/table/demo/data/table.js +0 -2
  81. package/es/table/demo/index.js +13 -39
  82. package/es/table/demo/index2.js +5 -15
  83. package/es/table/demo/index3.js +7 -28
  84. package/es/table/index.js +14 -33
  85. package/es/targetConditionGroup/components/targetDimension.js +12 -37
  86. package/es/targetConditionGroup/demo/group.js +21 -36
  87. package/es/targetConditionGroup/demo/index.js +5 -13
  88. package/es/targetConditionGroup/index.js +31 -82
  89. package/es/targetSelector/demo/index.js +15 -28
  90. package/es/targetSelector/editBox.js +5 -20
  91. package/es/targetSelector/index.js +15 -36
  92. package/es/targetSelector/optionIcon.js +1 -5
  93. package/es/targetSelector/optionMenu.js +0 -3
  94. package/es/userCondition/conditionTypeList.js +7 -12
  95. package/es/userCondition/conditionWrap.js +0 -2
  96. package/es/userCondition/conditions/cdpCondition.js +51 -97
  97. package/es/userCondition/conditions/eventCondition.js +6 -16
  98. package/es/userCondition/conditions/periodCondition.d.ts +1 -1
  99. package/es/userCondition/conditions/periodCondition.js +8 -26
  100. package/es/userCondition/conditions/propCondition.js +29 -61
  101. package/es/userCondition/conditions/runTimesCondition.js +5 -10
  102. package/es/userCondition/conditions/tagsCondition.d.ts +1 -1
  103. package/es/userCondition/conditions/tagsCondition.js +15 -33
  104. package/es/userCondition/conditions/textDesc.js +16 -67
  105. package/es/userCondition/demo/index.js +11 -21
  106. package/es/userCondition/index.js +51 -91
  107. package/es/userCondition/orConditions.js +11 -48
  108. package/es/userCondition/relationLabel.js +1 -4
  109. package/es/userCondition/types.d.ts +2 -2
  110. package/es/userCondition/types.js +0 -1
  111. package/es/userCondition/util.js +4 -13
  112. package/es/userGroup/demo/group.js +14 -23
  113. package/es/userGroup/demo/index.js +5 -15
  114. package/es/userGroup/index.js +12 -30
  115. package/es/userTagsSelector/cascaderOverlay.js +19 -51
  116. package/es/userTagsSelector/components/search/index.js +0 -2
  117. package/es/userTagsSelector/demo/index.js +0 -3
  118. package/es/userTagsSelector/groups/groupOption.js +6 -8
  119. package/es/userTagsSelector/groups/index.js +15 -30
  120. package/es/userTagsSelector/index.js +17 -35
  121. package/es/userTagsSelector/multipleCheckPanel/checkOption.js +3 -6
  122. package/es/userTagsSelector/multipleCheckPanel/index.js +8 -21
  123. package/es/userTagsSelector/util.js +0 -2
  124. package/es/utils/ajax.js +45 -71
  125. package/es/utils/base64.js +3 -22
  126. package/es/utils/type.d.ts +1 -1
  127. package/es/utils/type.js +4 -7
  128. package/es/utils/util.js +1 -17
  129. package/package.json +12 -15
@@ -1,23 +1,13 @@
1
1
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
-
3
2
  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
-
5
3
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
-
7
4
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
-
9
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
-
11
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."); }
12
-
13
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); }
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
-
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; } }
19
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
-
21
11
  import React, { useContext, useEffect, useState } from 'react';
22
12
  import { BizUserConditionContext } from '.';
23
13
  import './styles/orConditions.less';
@@ -33,28 +23,23 @@ import TagsCondition from './conditions/tagsCondition';
33
23
  import { classPrefix } from '.';
34
24
  import Text from './conditions/textDesc';
35
25
  import CdpCondition from './conditions/cdpCondition';
36
-
37
26
  var OrConditions = function OrConditions(props) {
38
27
  var _useContext = useContext(BizUserConditionContext),
39
- orConditionNum = _useContext.orConditionNum,
40
- textMode = _useContext.textMode,
41
- openTagCondition = _useContext.openTagCondition,
42
- openCdpCondition = _useContext.openCdpCondition;
43
-
28
+ orConditionNum = _useContext.orConditionNum,
29
+ textMode = _useContext.textMode,
30
+ openTagCondition = _useContext.openTagCondition,
31
+ openCdpCondition = _useContext.openCdpCondition;
44
32
  var orConditions = props.orConditions,
45
- showAndDesc = props.showAndDesc;
46
-
33
+ showAndDesc = props.showAndDesc;
47
34
  var _useState = useState([]),
48
- _useState2 = _slicedToArray(_useState, 2),
49
- showList = _useState2[0],
50
- setShowList = _useState2[1];
51
-
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ showList = _useState2[0],
37
+ setShowList = _useState2[1];
52
38
  useEffect(function () {
53
39
  if (orConditions) {
54
40
  initShowList();
55
41
  }
56
42
  }, [orConditions]);
57
-
58
43
  function initShowList() {
59
44
  var showList = [];
60
45
  orConditions.forEach(function (condition) {
@@ -66,7 +51,6 @@ var OrConditions = function OrConditions(props) {
66
51
  });
67
52
  setShowList(showList);
68
53
  }
69
-
70
54
  function onAdd(type) {
71
55
  var condition = buildCondition(type);
72
56
  var newData = {
@@ -79,54 +63,45 @@ var OrConditions = function OrConditions(props) {
79
63
  setShowList([].concat(_toConsumableArray(showList), [newData]));
80
64
  props.onChange(newValue);
81
65
  }
82
-
83
66
  function onChangeRunPeriod(id, newData) {
84
67
  var newValue = [];
85
68
  showList.forEach(function (data) {
86
69
  if (id === data.id) {
87
70
  data.condition.runPeriod = newData;
88
71
  }
89
-
90
72
  newValue.push(data.condition);
91
73
  });
92
74
  setShowList(_toConsumableArray(showList));
93
75
  props.onChange(newValue);
94
76
  }
95
-
96
77
  function onChangeAttrs(id, newAttrs) {
97
78
  var newValue = [];
98
79
  showList.forEach(function (data) {
99
80
  if (id === data.id) {
100
81
  data.condition.attrs = newAttrs;
101
82
  }
102
-
103
83
  newValue.push(data.condition);
104
84
  });
105
85
  setShowList(_toConsumableArray(showList));
106
86
  props.onChange(newValue);
107
87
  }
108
-
109
88
  function onChangeEvent(id, newEvnet) {
110
89
  var newValue = [];
111
90
  showList.forEach(function (data) {
112
91
  if (id === data.id) {
113
92
  data.condition = newEvnet;
114
93
  }
115
-
116
94
  newValue.push(data.condition);
117
95
  });
118
96
  setShowList(_toConsumableArray(showList));
119
97
  props.onChange(newValue);
120
98
  }
121
-
122
99
  function onChangeTags(id, newTags) {
123
100
  changeData('tag', id, newTags);
124
101
  }
125
-
126
102
  function onChangeCdp(id, newCdp) {
127
103
  changeData('cdp', id, newCdp);
128
104
  }
129
-
130
105
  function changeData(type, id, newData) {
131
106
  var newValue = [];
132
107
  showList.forEach(function (data) {
@@ -143,28 +118,23 @@ var OrConditions = function OrConditions(props) {
143
118
  data.condition.dataset = newData;
144
119
  }
145
120
  }
146
-
147
121
  newValue.push(data.condition);
148
122
  });
149
123
  setShowList(_toConsumableArray(showList));
150
124
  props.onChange(newValue);
151
125
  }
152
-
153
126
  function onDelete(id) {
154
127
  var index = showList.findIndex(function (item) {
155
128
  return item.id === id;
156
129
  });
157
130
  showList.splice(index, 1);
158
-
159
131
  var newList = _toConsumableArray(showList);
160
-
161
132
  setShowList(newList);
162
133
  var newValue = newList.map(function (item) {
163
134
  return item.condition;
164
135
  });
165
136
  props.onChange(newValue);
166
137
  }
167
-
168
138
  if (textMode) {
169
139
  return /*#__PURE__*/React.createElement(React.Fragment, null, textMode && showAndDesc ? /*#__PURE__*/React.createElement("span", {
170
140
  className: "".concat(classPrefix, "-and-desc")
@@ -172,12 +142,10 @@ var OrConditions = function OrConditions(props) {
172
142
  return renderCondition(item, i);
173
143
  }), /*#__PURE__*/React.createElement("span", null, ")"));
174
144
  }
175
-
176
145
  function renderCondition(data, i) {
177
146
  var condition = data.condition,
178
- id = data.id;
147
+ id = data.id;
179
148
  var conditionDom = null;
180
-
181
149
  if (textMode) {
182
150
  return /*#__PURE__*/React.createElement(Text, {
183
151
  showOrDesc: i > 0,
@@ -185,7 +153,6 @@ var OrConditions = function OrConditions(props) {
185
153
  condition: condition
186
154
  });
187
155
  }
188
-
189
156
  if (condition.labels) {
190
157
  if (!openTagCondition) return null;
191
158
  conditionDom = /*#__PURE__*/React.createElement(TagsCondition, {
@@ -202,7 +169,6 @@ var OrConditions = function OrConditions(props) {
202
169
  });
203
170
  } else {
204
171
  var conditionData = condition;
205
-
206
172
  if (conditionData.eventId === undefined) {
207
173
  conditionDom = /*#__PURE__*/React.createElement(PropCondition, {
208
174
  label: "\u5C5E\u6027",
@@ -233,7 +199,6 @@ var OrConditions = function OrConditions(props) {
233
199
  }));
234
200
  }
235
201
  }
236
-
237
202
  return /*#__PURE__*/React.createElement(ConditionWrap, {
238
203
  key: id,
239
204
  onDelte: function onDelte() {
@@ -241,7 +206,6 @@ var OrConditions = function OrConditions(props) {
241
206
  }
242
207
  }, conditionDom);
243
208
  }
244
-
245
209
  return /*#__PURE__*/React.createElement("div", {
246
210
  className: ["".concat(classPrefix, "-or"),, textMode ? 'text-mode' : ''].join(' ')
247
211
  }, /*#__PURE__*/React.createElement("div", {
@@ -258,5 +222,4 @@ var OrConditions = function OrConditions(props) {
258
222
  show: showList.length < orConditionNum
259
223
  }));
260
224
  };
261
-
262
225
  export default OrConditions;
@@ -1,11 +1,9 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { BizUserConditionContext } from '.';
3
3
  import './styles/relationLabel.less';
4
-
5
4
  var RelationLabel = function RelationLabel(props) {
6
5
  var _useContext = useContext(BizUserConditionContext),
7
- textMode = _useContext.textMode;
8
-
6
+ textMode = _useContext.textMode;
9
7
  if (textMode) return null;
10
8
  return /*#__PURE__*/React.createElement("div", {
11
9
  className: "biz-user-condition-relation"
@@ -13,5 +11,4 @@ var RelationLabel = function RelationLabel(props) {
13
11
  className: "biz-user-condition-relation-label"
14
12
  }, props.children) : null);
15
13
  };
16
-
17
14
  export default RelationLabel;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { UserProp } from '../attributeSelector/types';
3
- export declare type Unpacked<T, U extends keyof T> = Required<T> extends {
3
+ export type Unpacked<T, U extends keyof T> = Required<T> extends {
4
4
  [key in U]: infer R;
5
5
  } ? R : never;
6
6
  export interface RunPeriodI {
@@ -170,7 +170,7 @@ export declare namespace PropConditionType {
170
170
  }[];
171
171
  interface PropsI extends AllConditionBasePropsI<any> {
172
172
  isEvent?: boolean;
173
- label?: string | React.ReactDOM;
173
+ label?: string | React.ReactNode;
174
174
  eventId?: number;
175
175
  attrs: BizUserConditionT.AttrCondition[];
176
176
  }
@@ -1,5 +1,4 @@
1
1
  export var PropType;
2
-
3
2
  (function (PropType) {
4
3
  PropType["STRING"] = "cont-string";
5
4
  PropType["NUMBER"] = "cont-num";
@@ -1,9 +1,9 @@
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
  export function buildCondition(type) {
8
8
  switch (type) {
9
9
  case 'add':
@@ -20,7 +20,6 @@ export function buildCondition(type) {
20
20
  attrs: []
21
21
  };
22
22
  return condition;
23
-
24
23
  case 'active':
25
24
  return {
26
25
  eventId: '-4',
@@ -34,7 +33,6 @@ export function buildCondition(type) {
34
33
  },
35
34
  attrs: []
36
35
  };
37
-
38
36
  case 'event':
39
37
  return {
40
38
  eventId: 0,
@@ -48,7 +46,6 @@ export function buildCondition(type) {
48
46
  values: ['30', '0']
49
47
  }
50
48
  };
51
-
52
49
  case 'prop':
53
50
  return {
54
51
  eventId: undefined,
@@ -56,7 +53,6 @@ export function buildCondition(type) {
56
53
  attrId: 0
57
54
  }]
58
55
  };
59
-
60
56
  case 'tag':
61
57
  return {
62
58
  attrs: [],
@@ -66,7 +62,6 @@ export function buildCondition(type) {
66
62
  },
67
63
  eventId: undefined
68
64
  };
69
-
70
65
  case 'cdp':
71
66
  return {
72
67
  dataset: [undefined]
@@ -95,19 +90,16 @@ export function transformNumberOperate(key) {
95
90
  export function findEvent(eventId, eventGroupList) {
96
91
  for (var i = 0; i < eventGroupList.length; i++) {
97
92
  var eventList = eventGroupList[i].eventList;
98
-
99
93
  for (var j = 0; j < eventList.length; j++) {
100
94
  if (eventList[j].id === eventId) return eventList[j];
101
95
  }
102
96
  }
103
-
104
97
  return null;
105
98
  }
106
99
  export function findPropAndEnv(name, list) {
107
100
  for (var i = 0; i < list.length; i++) {
108
101
  if (list[i].name === name) return list[i];
109
102
  }
110
-
111
103
  return null;
112
104
  }
113
105
  export function buildSelectLayer(data) {
@@ -137,7 +129,6 @@ export function buildTagsGroup(list) {
137
129
  list.forEach(function (label) {
138
130
  if (!label.sequence) return;
139
131
  var index = label.sequence - 1;
140
-
141
132
  if (options[index]) {
142
133
  options[index].children.push(label);
143
134
  } else {
@@ -1,21 +1,15 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
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
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
-
9
8
  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
-
11
9
  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); }
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
-
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; } }
17
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
-
19
13
  import React, { useState } from 'react';
20
14
  import { BizUserGroup, IconFont } from '@zgfe/business-lib';
21
15
  import { Form } from 'antd';
@@ -44,20 +38,17 @@ var initValue = {
44
38
  };
45
39
  export default (function () {
46
40
  var _useState = useState({
47
- user: [initValue]
48
- }),
49
- _useState2 = _slicedToArray(_useState, 2),
50
- target = _useState2[0],
51
- setTarget = _useState2[1];
52
-
41
+ user: [initValue]
42
+ }),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ target = _useState2[0],
45
+ setTarget = _useState2[1];
53
46
  var _Form$useForm = Form.useForm(),
54
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
55
- form = _Form$useForm2[0];
56
-
47
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
48
+ form = _Form$useForm2[0];
57
49
  var onValuesChange = function onValuesChange() {
58
50
  setTarget(arguments.length <= 1 ? undefined : arguments[1]);
59
51
  };
60
-
61
52
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
62
53
  initialValues: target,
63
54
  form: form,
@@ -68,7 +59,7 @@ export default (function () {
68
59
  name: "user"
69
60
  }, function (fields, _ref) {
70
61
  var add = _ref.add,
71
- remove = _ref.remove;
62
+ remove = _ref.remove;
72
63
  return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
73
64
  return /*#__PURE__*/React.createElement(Form.Item, _objectSpread(_objectSpread({}, field), {}, {
74
65
  key: field.key
@@ -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, { useState } from 'react';
14
8
  import { BizUserGroup } from '@zgfe/business-lib';
15
9
  var groupOptions = [{
@@ -31,18 +25,15 @@ var groupOptions = [{
31
25
  id: 6,
32
26
  name: '用户群6'
33
27
  }];
34
-
35
28
  var UserGroupDemo = function UserGroupDemo() {
36
29
  var _useState = useState(),
37
- _useState2 = _slicedToArray(_useState, 2),
38
- group = _useState2[0],
39
- setGroup = _useState2[1];
40
-
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ group = _useState2[0],
32
+ setGroup = _useState2[1];
41
33
  var handleChange = function handleChange(value) {
42
34
  console.log('change', value);
43
35
  setGroup(value);
44
36
  };
45
-
46
37
  return /*#__PURE__*/React.createElement("div", {
47
38
  className: "biz-user-group-demo",
48
39
  style: {
@@ -55,7 +46,6 @@ var UserGroupDemo = function UserGroupDemo() {
55
46
  enableDelete: true
56
47
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u5DF2\u9009\u7528\u6237\u7FA4\uFF1A", JSON.stringify(group)));
57
48
  };
58
-
59
49
  export default (function () {
60
50
  return /*#__PURE__*/React.createElement(UserGroupDemo, null);
61
51
  });
@@ -1,62 +1,45 @@
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, { useContext, useEffect, useState } from 'react';
14
8
  import './styles/index.less';
15
9
  import BizSelect from '../select';
16
10
  import BizTargetOptionIcon from '../targetSelector/optionIcon';
17
11
  import { Skeleton } from 'antd';
18
12
  import BizGlobalDataContext from '../context';
19
-
20
13
  var BizUserGroup = function BizUserGroup(props) {
21
14
  var enableDelete = props.enableDelete,
22
- keyField = props.keyField,
23
- labelField = props.labelField;
24
-
15
+ keyField = props.keyField,
16
+ labelField = props.labelField;
25
17
  var _useState = useState(),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- current = _useState2[0],
28
- setCurrent = _useState2[1];
29
-
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ current = _useState2[0],
20
+ setCurrent = _useState2[1];
30
21
  var _useState3 = useState(true),
31
- _useState4 = _slicedToArray(_useState3, 2),
32
- loading = _useState4[0],
33
- setLoading = _useState4[1];
34
-
22
+ _useState4 = _slicedToArray(_useState3, 2),
23
+ loading = _useState4[0],
24
+ setLoading = _useState4[1];
35
25
  var classPrefix = 'biz-user';
36
-
37
26
  var _useContext = useContext(BizGlobalDataContext),
38
- _useContext$userGroup = _useContext.userGroupList,
39
- userGroupList = _useContext$userGroup === void 0 ? [] : _useContext$userGroup;
40
-
27
+ _useContext$userGroup = _useContext.userGroupList,
28
+ userGroupList = _useContext$userGroup === void 0 ? [] : _useContext$userGroup;
41
29
  useEffect(function () {
42
30
  var value = props.defaultValue || props.value;
43
-
44
31
  if (value) {
45
32
  setCurrent(value);
46
33
  }
47
-
48
34
  setLoading(false);
49
35
  }, []);
50
-
51
36
  var onClickDelete = function onClickDelete() {
52
37
  if (props.onDelete) props.onDelete(current);
53
38
  };
54
-
55
39
  var onChange = function onChange(value) {
56
40
  setCurrent(value);
57
41
  if (props.onChange) props.onChange(value);
58
42
  };
59
-
60
43
  return /*#__PURE__*/React.createElement("div", {
61
44
  className: classPrefix
62
45
  }, /*#__PURE__*/React.createElement(Skeleton, {
@@ -83,7 +66,6 @@ var BizUserGroup = function BizUserGroup(props) {
83
66
  onClick: onClickDelete
84
67
  })));
85
68
  };
86
-
87
69
  BizUserGroup.defaultProps = {
88
70
  keyField: 'id',
89
71
  labelField: 'name'