@zgfe/business-lib 1.0.0-beta.4 → 1.0.1-beta.0

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 (248) hide show
  1. package/es/analysisLayout/demo/index.js +4 -1
  2. package/es/analysisLayout/index.d.ts +1 -28
  3. package/es/analysisLayout/index.js +32 -42
  4. package/es/analysisLayout/index.less +7 -5
  5. package/es/assets/styles/chunks.less +143 -0
  6. package/es/assets/styles/inner.less +3 -0
  7. package/es/assets/styles/resetAntd.less +398 -0
  8. package/es/assets/styles/variable.less +21 -0
  9. package/es/assets/theme.d.ts +5 -0
  10. package/es/assets/theme.js +4 -0
  11. package/es/attrConditions/components/operateList.d.ts +8 -0
  12. package/es/attrConditions/components/operateList.js +83 -0
  13. package/es/attrConditions/components/stringList.d.ts +9 -0
  14. package/es/attrConditions/components/stringList.js +167 -0
  15. package/es/attrConditions/components/valuesList.d.ts +10 -0
  16. package/es/attrConditions/components/valuesList.js +186 -0
  17. package/es/{attributeSelector/demo/multi.d.ts → attrConditions/demo/group.d.ts} +0 -0
  18. package/es/attrConditions/demo/group.js +82 -0
  19. package/es/{globalAttributes → attrConditions}/demo/index.d.ts +0 -0
  20. package/es/{datePicker/demo/form.js → attrConditions/demo/index.js} +43 -23
  21. package/es/attrConditions/group.d.ts +5 -0
  22. package/es/attrConditions/group.js +184 -0
  23. package/es/attrConditions/index.d.ts +6 -0
  24. package/es/attrConditions/index.js +160 -0
  25. package/es/attrConditions/styles/group.less +49 -0
  26. package/es/attrConditions/styles/index.less +94 -0
  27. package/es/attrConditions/types.d.ts +63 -0
  28. package/es/attrConditions/types.js +19 -0
  29. package/es/attrConditions/utils/operates.d.ts +16 -0
  30. package/es/attrConditions/utils/operates.js +67 -0
  31. package/es/{multipleSelector → attributeSelector}/demo/index.d.ts +1 -0
  32. package/es/attributeSelector/demo/{singleForm.js → index.js} +42 -44
  33. package/es/attributeSelector/index.d.ts +4 -109
  34. package/es/attributeSelector/index.js +85 -527
  35. package/es/attributeSelector/listPanel.d.ts +4 -0
  36. package/es/attributeSelector/listPanel.js +206 -0
  37. package/es/attributeSelector/option.d.ts +15 -0
  38. package/es/attributeSelector/option.js +53 -0
  39. package/es/attributeSelector/styles/index.less +100 -0
  40. package/es/attributeSelector/types.d.ts +79 -0
  41. package/es/attributeSelector/types.js +15 -0
  42. package/es/attributeSelector/util.d.ts +7 -0
  43. package/es/attributeSelector/util.js +69 -0
  44. package/es/chart/demo/bar.js +2 -1
  45. package/es/chart/demo/pie.js +1 -0
  46. package/es/chart/index.d.ts +2 -80
  47. package/es/chart/index.js +27 -24
  48. package/es/chart/styles/index.less +50 -0
  49. package/es/chart/types.d.ts +46 -0
  50. package/es/chart/{type.js → types.js} +0 -0
  51. package/es/chart/util/{chartConfig.d.ts → chartOptionConfig.d.ts} +4 -35
  52. package/es/chart/util/{chartConfig.js → chartOptionConfig.js} +46 -109
  53. package/es/chart/util/formatData.d.ts +3 -7
  54. package/es/chart/util/formatData.js +47 -26
  55. package/es/chart/util/formatOption.d.ts +2 -1
  56. package/es/chart/util/formatOption.js +22 -9
  57. package/es/chart/util/mapUtil.d.ts +3 -3
  58. package/es/chart/util/mapUtil.js +9 -19
  59. package/es/commonStyle/icon.less +130 -110
  60. package/es/commonStyle/select.less +1 -1
  61. package/es/commonStyle/theme.less +520 -470
  62. package/es/context/index.d.ts +16 -0
  63. package/es/context/index.js +3 -0
  64. package/es/datePicker/datePicker.d.ts +10 -0
  65. package/es/datePicker/datePicker.js +115 -0
  66. package/es/datePicker/demo/index.d.ts +1 -0
  67. package/es/datePicker/demo/index.js +9 -2
  68. package/es/datePicker/index.d.ts +4 -27
  69. package/es/datePicker/index.js +72 -148
  70. package/es/datePicker/styles/index.less +48 -0
  71. package/es/datePicker/types.d.ts +24 -0
  72. package/es/{eventSelector/type.js → datePicker/types.js} +0 -0
  73. package/es/datePicker/utils.d.ts +6 -0
  74. package/es/datePicker/utils.js +70 -0
  75. package/es/dialog/components/itemNode.d.ts +9 -0
  76. package/es/dialog/components/itemNode.js +107 -0
  77. package/es/dialog/components/list.d.ts +3 -13
  78. package/es/dialog/components/list.js +8 -7
  79. package/es/dialog/components/selectToInput.d.ts +4 -41
  80. package/es/dialog/components/selectToInput.js +109 -54
  81. package/es/dialog/components/styles/handle.less +39 -0
  82. package/es/dialog/components/styles/list.less +60 -0
  83. package/es/dialog/components/styles/tab.less +55 -0
  84. package/es/dialog/components/tab.d.ts +3 -7
  85. package/es/dialog/components/tab.js +57 -19
  86. package/es/dialog/data/{chart.d.ts → data.d.ts} +9 -0
  87. package/es/dialog/data/{chart.js → data.js} +11 -0
  88. package/es/dialog/demo/index.d.ts +23 -0
  89. package/es/dialog/demo/index.js +60 -22
  90. package/es/dialog/demo/index2.js +14 -2
  91. package/es/dialog/index.d.ts +4 -65
  92. package/es/dialog/index.js +124 -108
  93. package/es/dialog/styles/index.less +11 -0
  94. package/es/dialog/types.d.ts +77 -0
  95. package/es/{targetConditionGroup/type.js → dialog/types.js} +0 -0
  96. package/es/eventSelector/demo/index.js +26 -44
  97. package/es/eventSelector/index.d.ts +4 -25
  98. package/es/eventSelector/index.js +91 -338
  99. package/es/eventSelector/listPanel.d.ts +4 -0
  100. package/es/eventSelector/listPanel.js +195 -0
  101. package/es/eventSelector/option.d.ts +17 -0
  102. package/es/eventSelector/option.js +54 -0
  103. package/es/eventSelector/styles/index.less +77 -0
  104. package/es/eventSelector/types.d.ts +31 -0
  105. package/es/eventSelector/types.js +1 -0
  106. package/es/index.d.ts +12 -10
  107. package/es/index.js +7 -10
  108. package/es/{attributeSelector/data → mock}/env.d.ts +0 -0
  109. package/es/{attributeSelector/data → mock}/env.js +0 -0
  110. package/es/{attributeSelector/data → mock}/event.d.ts +0 -0
  111. package/es/{attributeSelector/data → mock}/event.js +0 -0
  112. package/es/{attributeSelector/data → mock}/user.d.ts +0 -0
  113. package/es/{attributeSelector/data → mock}/user.js +0 -0
  114. package/es/searchInput/index.d.ts +8 -0
  115. package/es/searchInput/index.js +31 -0
  116. package/es/{attributeSelector/demo/multiForm.d.ts → select/demo/group.d.ts} +0 -0
  117. package/es/{globalAttributes/demo/index.js → select/demo/group.js} +49 -31
  118. package/es/select/demo/index.js +49 -21
  119. package/es/{attributeSelector/demo/single.d.ts → select/demo/multiple.d.ts} +0 -0
  120. package/es/{multipleSelector/demo/index.js → select/demo/multiple.js} +55 -12
  121. package/es/select/handle.d.ts +5 -0
  122. package/es/select/handle.js +119 -0
  123. package/es/select/index.d.ts +4 -41
  124. package/es/select/index.js +166 -121
  125. package/es/select/option.d.ts +4 -0
  126. package/es/select/option.js +59 -0
  127. package/es/select/overlay.d.ts +4 -0
  128. package/es/select/overlay.js +154 -0
  129. package/es/select/styles/handle.less +111 -0
  130. package/es/select/styles/index.less +99 -0
  131. package/es/select/types.d.ts +65 -0
  132. package/es/select/types.js +1 -0
  133. package/es/table/demo/data/table.js +1 -1
  134. package/es/table/demo/index.d.ts +1 -1
  135. package/es/table/demo/index.js +9 -8
  136. package/es/table/demo/index2.js +45 -3
  137. package/es/{attributeSelector/demo/singleForm.d.ts → table/demo/index3.d.ts} +0 -0
  138. package/es/table/demo/index3.js +218 -0
  139. package/es/table/index.d.ts +4 -30
  140. package/es/table/index.js +19 -17
  141. package/es/table/styles/index.less +5 -0
  142. package/es/table/type.d.ts +10 -0
  143. package/es/table/type.js +1 -0
  144. package/es/targetConditionGroup/components/targetDimension.d.ts +8 -0
  145. package/es/targetConditionGroup/components/targetDimension.js +153 -0
  146. package/es/targetConditionGroup/data/operates.d.ts +8 -24
  147. package/es/targetConditionGroup/data/operates.js +26 -69
  148. package/es/targetConditionGroup/demo/group.d.ts +3 -0
  149. package/es/targetConditionGroup/demo/group.js +127 -0
  150. package/es/targetConditionGroup/demo/index.js +41 -51
  151. package/es/targetConditionGroup/demo/styles/index.less +29 -0
  152. package/es/targetConditionGroup/index.d.ts +4 -51
  153. package/es/targetConditionGroup/index.js +187 -222
  154. package/es/targetConditionGroup/styles/index.less +25 -0
  155. package/es/targetConditionGroup/types.d.ts +32 -0
  156. package/es/targetConditionGroup/types.js +1 -0
  157. package/es/targetSelector/demo/index.d.ts +1 -0
  158. package/es/targetSelector/demo/index.js +29 -71
  159. package/es/targetSelector/editBox.d.ts +8 -0
  160. package/es/targetSelector/{components/BizEventNameEditBox.js → editBox.js} +49 -24
  161. package/es/targetSelector/index.d.ts +5 -39
  162. package/es/targetSelector/index.js +102 -169
  163. package/es/targetSelector/optionIcon.d.ts +9 -0
  164. package/es/targetSelector/optionIcon.js +24 -0
  165. package/es/targetSelector/optionMenu.d.ts +7 -0
  166. package/es/targetSelector/optionMenu.js +38 -0
  167. package/es/targetSelector/styles/index.less +88 -0
  168. package/es/targetSelector/types.d.ts +18 -0
  169. package/es/targetSelector/types.js +1 -0
  170. package/es/{datePicker/demo/form.d.ts → userGroup/demo/group.d.ts} +0 -0
  171. package/es/{targetConditionGroup/demo/form.js → userGroup/demo/group.js} +68 -72
  172. package/es/userGroup/demo/index.d.ts +0 -1
  173. package/es/userGroup/demo/index.js +5 -62
  174. package/es/userGroup/index.d.ts +3 -77
  175. package/es/userGroup/index.js +58 -108
  176. package/es/userGroup/styles/index.less +20 -0
  177. package/es/userGroup/types.d.ts +15 -0
  178. package/es/userGroup/types.js +1 -0
  179. package/es/utils/ajax.js +5 -20
  180. package/es/utils/type.d.ts +42 -44
  181. package/es/utils/util.d.ts +1 -35
  182. package/es/utils/util.js +27 -57
  183. package/package.json +11 -4
  184. package/es/attributeSelector/demo/multi.js +0 -39
  185. package/es/attributeSelector/demo/multiForm.js +0 -64
  186. package/es/attributeSelector/demo/single.js +0 -43
  187. package/es/attributeSelector/group.d.ts +0 -31
  188. package/es/attributeSelector/group.js +0 -225
  189. package/es/attributeSelector/index.less +0 -172
  190. package/es/chart/index.less +0 -38
  191. package/es/chart/style/circle.svg +0 -4
  192. package/es/chart/type.d.ts +0 -22
  193. package/es/datePicker/data.d.ts +0 -9
  194. package/es/datePicker/data.js +0 -65
  195. package/es/datePicker/index.less +0 -364
  196. package/es/dialog/components/style/list.less +0 -59
  197. package/es/dialog/components/style/tab.less +0 -61
  198. package/es/dialog/style/index.less +0 -76
  199. package/es/eventSelector/demo/form.d.ts +0 -2
  200. package/es/eventSelector/demo/form.js +0 -89
  201. package/es/eventSelector/demo/nodata.d.ts +0 -2
  202. package/es/eventSelector/demo/nodata.js +0 -13
  203. package/es/eventSelector/index.less +0 -121
  204. package/es/eventSelector/type.d.ts +0 -41
  205. package/es/globalAttributes/demo/data/env.d.ts +0 -11
  206. package/es/globalAttributes/demo/data/env.js +0 -181
  207. package/es/globalAttributes/demo/data/event.d.ts +0 -237
  208. package/es/globalAttributes/demo/data/event.js +0 -3483
  209. package/es/globalAttributes/demo/data/user.d.ts +0 -22
  210. package/es/globalAttributes/demo/data/user.js +0 -218
  211. package/es/globalAttributes/index.d.ts +0 -46
  212. package/es/globalAttributes/index.js +0 -117
  213. package/es/multipleSelector/index.d.ts +0 -36
  214. package/es/multipleSelector/index.js +0 -103
  215. package/es/multipleSelector/index.less +0 -136
  216. package/es/table/demo/index.less +0 -8
  217. package/es/table/index.less +0 -139
  218. package/es/targetConditionGroup/components/conditionGroup.d.ts +0 -30
  219. package/es/targetConditionGroup/components/conditionGroup.js +0 -111
  220. package/es/targetConditionGroup/components/conditionItem.d.ts +0 -47
  221. package/es/targetConditionGroup/components/conditionItem.js +0 -259
  222. package/es/targetConditionGroup/components/style/group.less +0 -47
  223. package/es/targetConditionGroup/components/style/index.less +0 -16
  224. package/es/targetConditionGroup/demo/data/env.d.ts +0 -11
  225. package/es/targetConditionGroup/demo/data/env.js +0 -181
  226. package/es/targetConditionGroup/demo/data/event.d.ts +0 -237
  227. package/es/targetConditionGroup/demo/data/event.js +0 -3483
  228. package/es/targetConditionGroup/demo/data/user.d.ts +0 -22
  229. package/es/targetConditionGroup/demo/data/user.js +0 -218
  230. package/es/targetConditionGroup/demo/form.d.ts +0 -2
  231. package/es/targetConditionGroup/demo/item.d.ts +0 -2
  232. package/es/targetConditionGroup/demo/item.js +0 -5
  233. package/es/targetConditionGroup/index.less +0 -64
  234. package/es/targetConditionGroup/type.d.ts +0 -50
  235. package/es/targetSelector/components/BizCascadeBox.d.ts +0 -34
  236. package/es/targetSelector/components/BizCascadeBox.js +0 -213
  237. package/es/targetSelector/components/BizEventNameEditBox.d.ts +0 -20
  238. package/es/targetSelector/demo/form.d.ts +0 -2
  239. package/es/targetSelector/demo/form.js +0 -133
  240. package/es/targetSelector/demo/nodata.d.ts +0 -2
  241. package/es/targetSelector/demo/nodata.js +0 -13
  242. package/es/targetSelector/index.less +0 -28
  243. package/es/userGroup/demo/cluster.d.ts +0 -3
  244. package/es/userGroup/demo/cluster.js +0 -102
  245. package/es/userGroup/demo/index.less +0 -3
  246. package/es/userGroup/index.less +0 -2
  247. package/es/userGroup/userCluster.d.ts +0 -63
  248. package/es/userGroup/userCluster.js +0 -255
@@ -0,0 +1,206 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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
+
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); }
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
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import { Anchor, Button } from 'antd';
14
+ import React, { useContext, useEffect, useState } from 'react';
15
+ import { BizGlobalDataContext } from '..';
16
+ import BizSearchInput from '../searchInput';
17
+ import Option from './option';
18
+ var Link = Anchor.Link;
19
+
20
+ var AttrListPanel = function AttrListPanel(props) {
21
+ var _props$disableItemLis;
22
+
23
+ var id = props.id,
24
+ _props$enableEnvProp = props.enableEnvProp,
25
+ enableEnvProp = _props$enableEnvProp === void 0 ? true : _props$enableEnvProp,
26
+ _props$enableEventPro = props.enableEventProp,
27
+ enableEventProp = _props$enableEventPro === void 0 ? false : _props$enableEventPro,
28
+ _props$enableUserProp = props.enableUserProp,
29
+ enableUserProp = _props$enableUserProp === void 0 ? true : _props$enableUserProp,
30
+ _props$eventIdList = props.eventIdList,
31
+ eventIdList = _props$eventIdList === void 0 ? [] : _props$eventIdList;
32
+
33
+ var _useState = useState(''),
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ searchValue = _useState2[0],
36
+ setSearchValue = _useState2[1];
37
+
38
+ var _useContext = useContext(BizGlobalDataContext),
39
+ eventGroupList = _useContext.eventGroupList,
40
+ userPropList = _useContext.userPropList,
41
+ eventEnvList = _useContext.eventEnvList;
42
+
43
+ var _useState3 = useState([]),
44
+ _useState4 = _slicedToArray(_useState3, 2),
45
+ optionList = _useState4[0],
46
+ setOptionList = _useState4[1];
47
+
48
+ var _useState5 = useState(),
49
+ _useState6 = _slicedToArray(_useState5, 2),
50
+ currentAttr = _useState6[0],
51
+ setCurrentAttr = _useState6[1];
52
+
53
+ var disableItemlist = (_props$disableItemLis = props.disableItemList) === null || _props$disableItemLis === void 0 ? void 0 : _props$disableItemLis.map(function (item) {
54
+ if (item.propCategory === 'envProp') {
55
+ item.key = "envProp-".concat(item.name);
56
+ } else if (item.propCategory === 'eventProp') {
57
+ item.key = item.id;
58
+ } else if (item.propCategory === 'userProp') {
59
+ item.key = "userProp-".concat(item.name);
60
+ }
61
+
62
+ return item;
63
+ });
64
+ var anchor = {
65
+ container: "container-".concat(id),
66
+ event: "event".concat(id),
67
+ user: "user".concat(id),
68
+ env: "env".concat(id)
69
+ };
70
+ var classPrefix = 'biz-attr-select';
71
+ useEffect(function () {
72
+ var list = [];
73
+
74
+ if (enableEventProp) {
75
+ var hasAnchor = false;
76
+ eventGroupList === null || eventGroupList === void 0 ? void 0 : eventGroupList.forEach(function (group) {
77
+ group.eventList.forEach(function (event) {
78
+ if (event.isDelete || event.isStop) return;
79
+ if (eventIdList.length && !eventIdList.includes(event.id)) return;
80
+ var group = {
81
+ isEvent: true,
82
+ groupName: event.alias || event.name,
83
+ anchor: hasAnchor ? String(Math.random()) : anchor.event,
84
+ key: "event-".concat(event.id),
85
+ children: []
86
+ };
87
+ hasAnchor = true;
88
+ event.attrList.forEach(function (attr) {
89
+ group.children.push(attr);
90
+ });
91
+ list.push(group);
92
+ });
93
+ });
94
+ }
95
+
96
+ if (enableUserProp) {
97
+ list.push({
98
+ isEvent: false,
99
+ groupName: '用户属性',
100
+ key: 'userProps',
101
+ anchor: anchor.user,
102
+ children: userPropList
103
+ });
104
+ }
105
+
106
+ if (enableEnvProp) {
107
+ list.push({
108
+ isEvent: false,
109
+ groupName: '触发环境',
110
+ key: 'eventEnvProps',
111
+ anchor: anchor.env,
112
+ children: eventEnvList
113
+ });
114
+ }
115
+
116
+ setOptionList(list);
117
+ }, [eventGroupList, userPropList, eventEnvList, eventIdList]);
118
+ useEffect(function () {
119
+ setCurrentAttr(props.value);
120
+ }, [props.value]);
121
+
122
+ function onClick(option) {
123
+ setCurrentAttr(option);
124
+ if (props.onChange) props.onChange(option);
125
+ }
126
+
127
+ var showList = function () {
128
+ var list = [];
129
+ optionList.map(function (group) {
130
+ if (!group.children.length) return;
131
+ var head = /*#__PURE__*/React.createElement(Option, {
132
+ group: group,
133
+ key: group.key
134
+ });
135
+ var childList = [];
136
+ group.children.forEach(function (option) {
137
+ if (searchValue && !new RegExp(searchValue, 'i').test(option === null || option === void 0 ? void 0 : option.label)) return;
138
+ var disabled = false;
139
+ disableItemlist === null || disableItemlist === void 0 ? void 0 : disableItemlist.forEach(function (item) {
140
+ if (item.key === option.key) disabled = true;
141
+ });
142
+ childList.push( /*#__PURE__*/React.createElement(Option, {
143
+ option: option,
144
+ key: option === null || option === void 0 ? void 0 : option.key,
145
+ checked: (currentAttr === null || currentAttr === void 0 ? void 0 : currentAttr.key) === (option === null || option === void 0 ? void 0 : option.key),
146
+ highlight: {
147
+ enable: true,
148
+ text: searchValue
149
+ },
150
+ disabled: disabled,
151
+ onClick: onClick
152
+ }));
153
+ });
154
+
155
+ if (childList.length) {
156
+ list.push(head);
157
+ list = list.concat(childList);
158
+ }
159
+ });
160
+ return list;
161
+ }();
162
+
163
+ if (!showList.length && !searchValue) return /*#__PURE__*/React.createElement("div", {
164
+ className: "".concat(classPrefix, "-drowdown nodata")
165
+ }, "\u6682\u65E0\u6570\u636E");
166
+ return /*#__PURE__*/React.createElement("div", {
167
+ className: "".concat(classPrefix, "-drowdown")
168
+ }, /*#__PURE__*/React.createElement(BizSearchInput, {
169
+ onChange: function onChange(val) {
170
+ return setSearchValue(val);
171
+ },
172
+ placeholder: "\u641C\u7D22\u5C5E\u6027"
173
+ }), showList.length ? /*#__PURE__*/React.createElement(Anchor, {
174
+ className: "".concat(classPrefix, "-anchor-panel"),
175
+ affix: false,
176
+ onClick: function onClick(e) {
177
+ e.preventDefault();
178
+ },
179
+ getContainer: function getContainer() {
180
+ return document.getElementById(anchor.container);
181
+ }
182
+ }, enableEventProp && /*#__PURE__*/React.createElement(Link, {
183
+ href: "#".concat(anchor.event),
184
+ title: /*#__PURE__*/React.createElement(Button, {
185
+ size: "small"
186
+ }, "\u4E8B\u4EF6\u5C5E\u6027")
187
+ }), enableUserProp && /*#__PURE__*/React.createElement(Link, {
188
+ href: "#".concat(anchor.user),
189
+ title: /*#__PURE__*/React.createElement(Button, {
190
+ size: "small"
191
+ }, "\u7528\u6237\u5C5E\u6027")
192
+ }), enableEnvProp && /*#__PURE__*/React.createElement(Link, {
193
+ "data-type": 'event',
194
+ href: "#".concat(anchor.env),
195
+ title: /*#__PURE__*/React.createElement(Button, {
196
+ size: "small"
197
+ }, "\u89E6\u53D1\u73AF\u5883")
198
+ })) : null, /*#__PURE__*/React.createElement("div", {
199
+ id: anchor.container,
200
+ className: "".concat(classPrefix, "-container")
201
+ }, showList.length ? showList : /*#__PURE__*/React.createElement("div", {
202
+ className: "".concat(classPrefix, "-nodata")
203
+ }, "\u6682\u65E0\u6570\u636E")));
204
+ };
205
+
206
+ export default AttrListPanel;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { AttributeSelect } from './types';
3
+ declare const Option: React.FC<{
4
+ option?: AttributeSelect.Value;
5
+ group?: AttributeSelect.Option;
6
+ disabled?: boolean;
7
+ highlight?: {
8
+ enable: boolean;
9
+ text: string;
10
+ color?: string;
11
+ };
12
+ checked?: boolean;
13
+ onClick?: (option: AttributeSelect.Value) => void;
14
+ }>;
15
+ export default Option;
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { IconFont } from '..';
3
+ import { util } from '../utils';
4
+
5
+ var Option = function Option(props) {
6
+ var option = props.option,
7
+ group = props.group,
8
+ checked = props.checked,
9
+ disabled = props.disabled;
10
+ var classPrefix = 'biz-attr-select';
11
+
12
+ function onClick() {
13
+ if (disabled) return;
14
+ if (props.onClick) props.onClick(option);
15
+ }
16
+
17
+ function getLabel(label) {
18
+ if (!props.highlight || !props.highlight.enable || !props.highlight.text) return label;
19
+ var text = props.highlight.text;
20
+ if (text.length === label.length) return /*#__PURE__*/React.createElement("span", {
21
+ className: "".concat(classPrefix, "-highlight")
22
+ }, label);
23
+ return util.setHighLight(label, props.highlight.text, function (text, key) {
24
+ return /*#__PURE__*/React.createElement("span", {
25
+ className: "".concat(classPrefix, "-highlight"),
26
+ key: key
27
+ }, text);
28
+ });
29
+ }
30
+
31
+ if (group) {
32
+ return /*#__PURE__*/React.createElement("div", {
33
+ id: group.anchor,
34
+ className: "".concat(classPrefix, "-group")
35
+ }, /*#__PURE__*/React.createElement("div", {
36
+ className: "".concat(classPrefix, "-split")
37
+ }), /*#__PURE__*/React.createElement("span", {
38
+ title: group.isEvent ? "\u4E8B\u4EF6\u5C5E\u6027[".concat(group.groupName, "]") : group.groupName
39
+ }, group.isEvent ? "\u4E8B\u4EF6\u5C5E\u6027[".concat(group.groupName, "]") : group.groupName));
40
+ }
41
+
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: "".concat(classPrefix, "-option ").concat(checked ? 'active' : '', " ").concat(disabled ? 'disabled' : ''),
44
+ onClick: onClick
45
+ }, /*#__PURE__*/React.createElement(IconFont, {
46
+ className: "".concat(classPrefix, "-option-icon"),
47
+ type: "".concat((option === null || option === void 0 ? void 0 : option.propCategory) === 'userProp' ? 'icon-yonghushuxing' : (option === null || option === void 0 ? void 0 : option.propCategory) === 'eventProp' ? 'icon-shijianshuxing1' : 'icon-chufahuanjing')
48
+ }), /*#__PURE__*/React.createElement("span", {
49
+ title: (option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label)
50
+ }, getLabel((option === null || option === void 0 ? void 0 : option.alias) || (option === null || option === void 0 ? void 0 : option.label))));
51
+ };
52
+
53
+ export default Option;
@@ -0,0 +1,100 @@
1
+ @import '../../assets/styles/inner.less';
2
+ .biz-attr-select {
3
+ &-handle {
4
+ display: flex;
5
+ flex-direction: row;
6
+ .__select-handle();
7
+ &:hover .biz-attr-select-del-icon {
8
+ display: inline-block;
9
+ }
10
+ }
11
+ &-del-icon {
12
+ display: none;
13
+ flex: none;
14
+ width: @icon-width;
15
+ line-height: 2em;
16
+ text-align: center;
17
+ border-radius: @border-radius-small;
18
+ &:hover {
19
+ .__error-hover();
20
+ }
21
+ }
22
+ &-drowdown {
23
+ width: 284px;
24
+ .__select-panel();
25
+ &.nodata {
26
+ .__select-nodata();
27
+ }
28
+ }
29
+ &-anchor-panel {
30
+ padding: 12px 0 20px 0;
31
+ .ant-anchor {
32
+ display: flex;
33
+ flex-direction: row;
34
+ .ant-anchor-ink::before {
35
+ width: 0;
36
+ }
37
+ .ant-anchor-link {
38
+ padding: 0;
39
+ &:last-of-type .ant-btn {
40
+ margin-right: 0;
41
+ }
42
+ }
43
+ .ant-btn {
44
+ margin-right: 8px;
45
+ }
46
+ .ant-anchor-link-active .ant-btn {
47
+ .__default-hover();
48
+ }
49
+ }
50
+ }
51
+ &-container {
52
+ max-height: 400px;
53
+ overflow-x: hidden;
54
+ overflow-y: auto;
55
+ }
56
+ &-nodata {
57
+ .__select-nodata();
58
+ }
59
+ &-group {
60
+ position: relative;
61
+ height: 32px;
62
+ padding: 0 @padding-sm;
63
+ color: @text-color-secondary;
64
+ line-height: 32px;
65
+ &::before {
66
+ position: absolute;
67
+ top: 9px;
68
+ left: 5px;
69
+ width: 3px;
70
+ height: 14px;
71
+ background-color: @primary-color;
72
+ border-radius: 10px;
73
+ content: '';
74
+ }
75
+ & > span {
76
+ position: relative;
77
+ display: inline-block;
78
+ max-width: 225px;
79
+ padding-right: @padding-xss;
80
+ background: #fff;
81
+ .__default-overflow();
82
+ }
83
+ }
84
+ &-split {
85
+ position: absolute;
86
+ top: 18px;
87
+ width: 100%;
88
+ height: 0;
89
+ border-bottom: 1px solid @border-color-base;
90
+ }
91
+ &-option {
92
+ .__select-option();
93
+ &:not(.active, :hover, .disabled) .biz-attr-select-highlight {
94
+ color: @primary-color;
95
+ }
96
+ }
97
+ &-option-icon {
98
+ margin-right: @margin-xs;
99
+ }
100
+ }
@@ -0,0 +1,79 @@
1
+ export declare enum PropType {
2
+ STRING = 1,
3
+ NUMBER = 2,
4
+ DATE = 3
5
+ }
6
+ export declare enum PropCategory {
7
+ EventProp = "eventProp",
8
+ UserProp = "userProp",
9
+ EnvProp = "envProp"
10
+ }
11
+ export interface AnalysisEvent {
12
+ id: number;
13
+ name: string;
14
+ alias?: string;
15
+ attrList: Array<EventProp>;
16
+ isDelete?: boolean;
17
+ isStop?: boolean;
18
+ isOverview?: boolean;
19
+ }
20
+ export interface EventGroup {
21
+ id: number;
22
+ name?: string;
23
+ eventList: AnalysisEvent[];
24
+ }
25
+ export interface BasicProp {
26
+ label?: string;
27
+ alias?: string;
28
+ type?: PropType;
29
+ realTime?: boolean;
30
+ }
31
+ export interface UserProp extends BasicProp {
32
+ name: string;
33
+ category?: 'fixed' | 'custom';
34
+ propCategory: 'userProp';
35
+ key?: string;
36
+ subtype?: number;
37
+ }
38
+ export interface EnvProp extends BasicProp {
39
+ category?: 'fixed' | 'custom';
40
+ propCategory: 'envProp';
41
+ name: string;
42
+ key?: string;
43
+ }
44
+ export interface EventProp extends BasicProp {
45
+ eventId?: number;
46
+ id: number;
47
+ propCategory: 'eventProp';
48
+ key?: number;
49
+ isHidden?: boolean;
50
+ }
51
+ export interface PropGroups {
52
+ eventGroupList?: EventGroup[];
53
+ userPropList?: UserProp[];
54
+ envPropList?: EnvProp[];
55
+ }
56
+ export declare namespace AttributeSelect {
57
+ type Value = EventProp | UserProp | EnvProp | null;
58
+ interface Props {
59
+ id?: string;
60
+ value?: Value;
61
+ defaultValue?: Value;
62
+ disableItemList?: (EventProp | UserProp | EnvProp)[];
63
+ enableDelete?: boolean;
64
+ placeholder?: string;
65
+ enableEventProp?: boolean;
66
+ enableUserProp?: boolean;
67
+ enableEnvProp?: boolean;
68
+ eventIdList?: number[];
69
+ onChange?: (value: Value) => void;
70
+ onDelete?: (value?: Value) => void;
71
+ }
72
+ interface Option {
73
+ groupName: string;
74
+ isEvent: boolean;
75
+ key: string;
76
+ anchor: string;
77
+ children: Value[];
78
+ }
79
+ }
@@ -0,0 +1,15 @@
1
+ export var PropType;
2
+
3
+ (function (PropType) {
4
+ PropType[PropType["STRING"] = 1] = "STRING";
5
+ PropType[PropType["NUMBER"] = 2] = "NUMBER";
6
+ PropType[PropType["DATE"] = 3] = "DATE";
7
+ })(PropType || (PropType = {}));
8
+
9
+ export var PropCategory;
10
+
11
+ (function (PropCategory) {
12
+ PropCategory["EventProp"] = "eventProp";
13
+ PropCategory["UserProp"] = "userProp";
14
+ PropCategory["EnvProp"] = "envProp";
15
+ })(PropCategory || (PropCategory = {}));
@@ -0,0 +1,7 @@
1
+ import { OldSystem } from '../utils/type';
2
+ import { PropGroups } from './types';
3
+ export default function convertAttributeData(store: {
4
+ envPropList?: OldSystem.EnvProp[];
5
+ userPropList?: OldSystem.UserProp[];
6
+ eventList?: OldSystem.EventGroup[];
7
+ }): PropGroups;
@@ -0,0 +1,69 @@
1
+ export default function convertAttributeData(store) {
2
+ var _store$eventList, _store$envPropList, _store$userPropList;
3
+
4
+ var res = {
5
+ envPropList: [],
6
+ eventGroupList: [],
7
+ userPropList: []
8
+ };
9
+ (_store$eventList = store.eventList) === null || _store$eventList === void 0 ? void 0 : _store$eventList.forEach(function (group_) {
10
+ var _res$eventGroupList;
11
+
12
+ var group = {
13
+ id: group_.groupId,
14
+ name: group_.groupName,
15
+ eventList: []
16
+ };
17
+ group_.eventList.forEach(function (e) {
18
+ if (e.is_delete || e.is_stop) return;
19
+ var event = {
20
+ alias: e.alias_name,
21
+ attrList: e.event_attrs.map(function (item) {
22
+ return {
23
+ alias: item.alias_name,
24
+ eventId: e.event_id,
25
+ id: item.attr_id,
26
+ isHidden: item.hidden,
27
+ key: item.attr_id,
28
+ label: item.attr_name,
29
+ propCategory: 'eventProp',
30
+ type: item.prop_type,
31
+ realTime: true
32
+ };
33
+ }),
34
+ id: e.event_id,
35
+ isDelete: e.is_delete,
36
+ isStop: e.is_stop,
37
+ name: e.event_name
38
+ };
39
+ group.eventList.push(event);
40
+ });
41
+ (_res$eventGroupList = res.eventGroupList) === null || _res$eventGroupList === void 0 ? void 0 : _res$eventGroupList.push(group);
42
+ });
43
+ res.envPropList = (_store$envPropList = store.envPropList) === null || _store$envPropList === void 0 ? void 0 : _store$envPropList.map(function (prop) {
44
+ return {
45
+ alias: prop.alias_name,
46
+ category: prop.category,
47
+ key: "envProp-".concat(prop.name),
48
+ label: prop.text,
49
+ name: prop.name,
50
+ propCategory: 'envProp',
51
+ type: prop.type,
52
+ realTime: true
53
+ };
54
+ });
55
+ res.userPropList = (_store$userPropList = store.userPropList) === null || _store$userPropList === void 0 ? void 0 : _store$userPropList.map(function (prop) {
56
+ return {
57
+ alias: prop.alias_name,
58
+ category: prop.category,
59
+ key: "userProp-".concat(prop.name),
60
+ label: prop.text,
61
+ name: prop.name,
62
+ propCategory: 'userProp',
63
+ type: prop.type,
64
+ subtype: prop.subtype,
65
+ realTime: prop.category === 'custom'
66
+ };
67
+ });
68
+ return res;
69
+ }
@@ -9,6 +9,7 @@ export default (function () {
9
9
  showList: ['付款成功', '搜索商品', '查看商品详情']
10
10
  }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(BizChart, {
11
11
  data: chartData,
12
- type: "bar"
12
+ type: "bar",
13
+ xRotate: -45
13
14
  }));
14
15
  });
@@ -8,6 +8,7 @@ export default (function () {
8
8
  showAll: false,
9
9
  legendPosition: "bottom",
10
10
  legendOrient: "vertical",
11
+ colors: ['#1D9ED1', '#F383A2', '#9FB40F', '#FF6B3B', '#8C8C47'],
11
12
  showList: ['付款成功', '搜索商品', '查看商品详情', 'click']
12
13
  });
13
14
  });
@@ -1,83 +1,5 @@
1
1
  import React from 'react';
2
2
  import './util/data/china.js';
3
- import { DataProps } from './type';
4
- interface BizChartProps {
5
- /**
6
- * @description 图形类型
7
- * @default line
8
- */
9
- type: 'bar' | 'pie' | 'line' | 'map';
10
- /**
11
- * @description 数据(x轴和series数据)
12
- * @default -
13
- */
14
- data: DataProps;
15
- /**
16
- * @description 柱图是同色还是一柱一色(仅对柱图单一系列作用)
17
- * @default true
18
- */
19
- sameColor?: boolean;
20
- /**
21
- * @description 是否是城市
22
- * @default true
23
- */
24
- isCity?: boolean;
25
- /**
26
- * @description 用户群,以,隔开
27
- * @default -
28
- */
29
- userGroup?: string;
30
- /**
31
- * @description 提示格式
32
- * @default -
33
- */
34
- tooltipFormatter?: (param: any) => string;
35
- /**
36
- * @description x轴标签格式
37
- * @default -
38
- */
39
- xAxisFormatter?: (param: any) => string;
40
- /**
41
- * @description y轴标签格式
42
- * @default -
43
- */
44
- yAxisFormatter?: (param: any) => string;
45
- /**
46
- * @description value 单位
47
- * @default -
48
- */
49
- valueUnit?: string;
50
- /**
51
- * @description 图例位置
52
- * @default -
53
- */
54
- legendPosition?: 'top' | 'bottom' | 'middle';
55
- /**
56
- * @description 图例布局朝向
57
- * @default -
58
- */
59
- legendOrient?: 'horizontal' | 'vertical';
60
- /**
61
- * @description 显示数据项(从store中过滤),对应series中的names字段。如果没传的话,默认会展示前10条记录
62
- * @abstract [['group', 'item1'], ['group', 'item2']]或['item1', 'item2']
63
- * @default -
64
- */
65
- showList?: Array<any>;
66
- /**
67
- * @description 默认展示showList指定的条目或者前10条记录,并生成"其它"记录。showAll置为true后,将强制在饼图上展示所有记录
68
- * @default true
69
- */
70
- showAll?: boolean;
71
- /**
72
- * @description 是否将series中每项数据的names转为新的x轴
73
- * @tip 目前只有柱状图时有效
74
- * @default false
75
- */
76
- reverseXAxis?: boolean;
77
- /**
78
- * @description reverseXAxis为true时,该项是图例名称
79
- */
80
- seriesName?: string;
81
- }
82
- declare const BizChart: React.FC<BizChartProps>;
3
+ import { ChartTypes } from './types';
4
+ declare const BizChart: React.FC<ChartTypes.Props>;
83
5
  export default BizChart;