@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,160 @@
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 React, { useEffect, useState } from 'react';
14
+ import BizAttributeSelector from '../attributeSelector';
15
+ import { PropCategory } from '../attributeSelector/types';
16
+ import './styles/index.less';
17
+ import BizOperateList from './components/operateList';
18
+ import ValuesList from './components/valuesList';
19
+ import { Skeleton } from 'antd';
20
+ export var classPrefix = 'biz-condition-item';
21
+
22
+ var BizConditionItem = function BizConditionItem(props) {
23
+ var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
24
+
25
+ var defaultValue = props.defaultValue,
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
+
33
+ var _useState = useState(),
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ attr = _useState2[0],
36
+ setAttr = _useState2[1];
37
+
38
+ var _useState3 = useState(((_props$defaultValue = props.defaultValue) === null || _props$defaultValue === void 0 ? void 0 : _props$defaultValue.operation) || ((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.operation)),
39
+ _useState4 = _slicedToArray(_useState3, 2),
40
+ operate = _useState4[0],
41
+ setOperate = _useState4[1];
42
+
43
+ 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)),
44
+ _useState6 = _slicedToArray(_useState5, 2),
45
+ values = _useState6[0],
46
+ setValues = _useState6[1];
47
+
48
+ var _useState7 = useState(true),
49
+ _useState8 = _slicedToArray(_useState7, 2),
50
+ ready = _useState8[0],
51
+ setReady = _useState8[1];
52
+
53
+ useEffect(function () {
54
+ var data = defaultValue || props.value;
55
+
56
+ if (data) {
57
+ var attrData;
58
+
59
+ if (data.propCategory === PropCategory.EventProp) {
60
+ if (data.attrId) {
61
+ attrData = {
62
+ id: data.attrId,
63
+ propCategory: data.propCategory,
64
+ type: data.type,
65
+ key: data.attrId
66
+ };
67
+ }
68
+ } else if (data.propCategory === PropCategory.UserProp || data.propCategory === PropCategory.EnvProp) {
69
+ if (data.attrName) {
70
+ attrData = {
71
+ name: data.attrName,
72
+ propCategory: data.propCategory,
73
+ type: data.type,
74
+ category: data.category,
75
+ key: "".concat(data.propCategory, "-").concat(data.attrName),
76
+ subtype: data.subtype
77
+ };
78
+ }
79
+ }
80
+
81
+ setAttr(attrData);
82
+ }
83
+
84
+ setReady(false);
85
+ }, []);
86
+
87
+ var onDelete = function onDelete() {
88
+ if (props.onDelete) props.onDelete();
89
+ };
90
+
91
+ useEffect(function () {
92
+ if (props.onChange) {
93
+ if (!attr) return;
94
+ var responseData = {
95
+ propCategory: attr.propCategory,
96
+ type: attr.type,
97
+ operation: operate,
98
+ values: values || []
99
+ };
100
+
101
+ if (attr.propCategory === PropCategory.EventProp) {
102
+ responseData.attrId = attr.id;
103
+ } else {
104
+ responseData.attrName = attr.name;
105
+ responseData.category = attr.category;
106
+
107
+ if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
108
+ responseData.subtype = attr.subtype;
109
+ }
110
+ }
111
+
112
+ props.onChange(responseData);
113
+ }
114
+ }, [attr, operate, values]);
115
+
116
+ var onChangeAttr = function onChangeAttr(attrData) {
117
+ setAttr(attrData);
118
+ };
119
+
120
+ var onChangeOperate = function onChangeOperate(data) {
121
+ setOperate(data);
122
+ };
123
+
124
+ var onChangeValues = function onChangeValues(data) {
125
+ setValues(data);
126
+ };
127
+
128
+ return /*#__PURE__*/React.createElement("div", {
129
+ className: classPrefix
130
+ }, /*#__PURE__*/React.createElement(Skeleton, {
131
+ loading: ready,
132
+ active: true,
133
+ paragraph: {
134
+ rows: 2
135
+ }
136
+ }, /*#__PURE__*/React.createElement(BizAttributeSelector, {
137
+ value: attr,
138
+ eventIdList: eventIdList,
139
+ enableDelete: enableDelete,
140
+ enableEventProp: enableEventProp,
141
+ enableUserProp: enableUserProp,
142
+ enableEnvProp: enableEnvProp,
143
+ disableItemList: disableItemList,
144
+ onChange: onChangeAttr,
145
+ onDelete: onDelete
146
+ }), /*#__PURE__*/React.createElement("div", {
147
+ className: "".concat(classPrefix, "-panel")
148
+ }, /*#__PURE__*/React.createElement(BizOperateList, {
149
+ attr: attr,
150
+ defaultValue: operate,
151
+ onChange: onChangeOperate
152
+ }), /*#__PURE__*/React.createElement(ValuesList, {
153
+ attr: attr,
154
+ operate: operate,
155
+ defaultValue: values,
156
+ onChange: onChangeValues
157
+ }))));
158
+ };
159
+
160
+ export default BizConditionItem;
@@ -0,0 +1,49 @@
1
+ @import '../../assets/styles/inner.less';
2
+
3
+ .biz-condition {
4
+ display: flex;
5
+
6
+ /* 是筛选条件组 */
7
+ &-group-handle {
8
+ position: relative;
9
+ width: 1px;
10
+ margin-right: 16px;
11
+ margin-left: 8px;
12
+ background: @border-color-base;
13
+ }
14
+
15
+ &-group-operate {
16
+ position: absolute;
17
+ top: 50%;
18
+ left: 50%;
19
+ width: 16px;
20
+ transform: translate(-50%, -50%);
21
+
22
+ &-text {
23
+ width: 16px;
24
+ height: 16px;
25
+ font-size: 12px;
26
+ line-height: 16px;
27
+ text-align: center;
28
+
29
+ .__default-hover();
30
+
31
+ &:first-child {
32
+ border-radius: @border-radius-sx @border-radius-sx 0px 0px;
33
+ }
34
+
35
+ &:last-child {
36
+ border-radius: 0px 0px @border-radius-sx @border-radius-sx;
37
+ }
38
+
39
+ &.active {
40
+ color: #fff;
41
+ background: @primary-color;
42
+ }
43
+ }
44
+ }
45
+
46
+ &-item-container {
47
+ flex: 1;
48
+ }
49
+ }
@@ -0,0 +1,94 @@
1
+ @import '../../assets/styles/inner.less';
2
+
3
+ /* 筛选条件 */
4
+ .biz-condition-item {
5
+ .__select-handle();
6
+
7
+ &-panel {
8
+ display: flex;
9
+ width: 100%;
10
+ }
11
+
12
+ &:not(:last-child) {
13
+ margin-bottom: 8px;
14
+ }
15
+
16
+ /* 覆盖属性组件样式 */
17
+ /* --- start --- */
18
+ .biz-attr-select-handle {
19
+ margin-bottom: 2px;
20
+ padding: 0;
21
+ border: none;
22
+ border-radius: 0;
23
+ }
24
+
25
+ .ant-input {
26
+ background-color: @background-color-gray;
27
+ }
28
+
29
+ .biz-attr-select-del-icon {
30
+ background-color: #fff;
31
+
32
+ &:hover {
33
+ .__error-hover();
34
+ }
35
+ }
36
+
37
+ // 自定义下拉框样式
38
+ .biz-select-handle-input {
39
+ background-color: @background-color-gray;
40
+ border: none;
41
+ }
42
+
43
+ /* --- end --- */
44
+
45
+ &-multi-select {
46
+ flex: 1;
47
+ }
48
+
49
+ &-single-select {
50
+ width: 100px;
51
+ margin-right: 8px;
52
+
53
+ &.gray {
54
+ color: @text-color-secondary;
55
+
56
+ &:hover {
57
+ color: @primary-color;
58
+ }
59
+ }
60
+ }
61
+
62
+ &-input {
63
+ .ant-input-group-addon {
64
+ background-color: @background-color-gray;
65
+ border: none;
66
+ }
67
+
68
+ &-select {
69
+ width: 60px;
70
+ border: none;
71
+ border-left: 1px solid @border-color-split;
72
+ }
73
+ }
74
+
75
+ &-date.ant-picker {
76
+ flex: 1;
77
+ border-color: transparent;
78
+
79
+ &.ant-picker {
80
+ background-color: @background-color-gray;
81
+
82
+ &:hover {
83
+ background-color: @background-color-base;
84
+ border-color: @primary-color;
85
+ }
86
+
87
+ &.ant-picker-focused {
88
+ background-color: @background-color-base;
89
+ border-color: @primary-color;
90
+ box-shadow: @box-shadow-base;
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,63 @@
1
+ import { EnvProp, EventProp, PropType, UserProp } from '../attributeSelector/types';
2
+ interface BasicAttrTypes {
3
+ eventIdList?: number[];
4
+ enableDelete?: boolean;
5
+ enableEventProp?: boolean;
6
+ enableUserProp?: boolean;
7
+ enableEnvProp?: boolean;
8
+ disableItemList?: (EventProp | UserProp | EnvProp)[];
9
+ }
10
+ export declare namespace AttrConditionTypes {
11
+ interface ItemValue {
12
+ subtype?: number;
13
+ attrId?: number;
14
+ attrName?: string;
15
+ type?: PropType;
16
+ propCategory?: 'userProp' | 'eventProp' | 'envProp';
17
+ category?: 'fixed' | 'custom';
18
+ operation?: string;
19
+ values?: string[];
20
+ }
21
+ interface GroupValue {
22
+ relation?: 'and' | 'or';
23
+ conditions: ItemValue[];
24
+ }
25
+ interface ItemProp extends BasicAttrTypes {
26
+ defaultValue?: ItemValue;
27
+ value?: ItemValue;
28
+ onChange?: (value: ItemValue) => void;
29
+ onDelete?: (value?: ItemValue) => void;
30
+ }
31
+ interface GroupProp extends BasicAttrTypes {
32
+ defaultValue?: GroupValue;
33
+ value?: GroupValue;
34
+ onChange?: (value: GroupValue) => void;
35
+ onConditionsCount?: (value: number) => void;
36
+ }
37
+ interface Option {
38
+ name: string;
39
+ value: string;
40
+ }
41
+ interface GroupAddKey {
42
+ key: number;
43
+ data?: ItemValue;
44
+ }
45
+ }
46
+ export declare enum OperateTypes {
47
+ Equal = "equal",
48
+ Contains = "contains",
49
+ NotEqual = "not equal",
50
+ NotContains = "not contains",
51
+ BeginWith = "begin with",
52
+ NotBeginWith = "not begin with",
53
+ NotEndWith = "not end with",
54
+ IsNull = "is null",
55
+ IsNotNull = "is not null",
56
+ GT = "gt",
57
+ LT = "lt",
58
+ GE = "ge",
59
+ LE = "le",
60
+ Relative = "relative",
61
+ Absolute = "absolute"
62
+ }
63
+ export {};
@@ -0,0 +1,19 @@
1
+ export var OperateTypes;
2
+
3
+ (function (OperateTypes) {
4
+ OperateTypes["Equal"] = "equal";
5
+ OperateTypes["Contains"] = "contains";
6
+ OperateTypes["NotEqual"] = "not equal";
7
+ OperateTypes["NotContains"] = "not contains";
8
+ OperateTypes["BeginWith"] = "begin with";
9
+ OperateTypes["NotBeginWith"] = "not begin with";
10
+ OperateTypes["NotEndWith"] = "not end with";
11
+ OperateTypes["IsNull"] = "is null";
12
+ OperateTypes["IsNotNull"] = "is not null";
13
+ OperateTypes["GT"] = "gt";
14
+ OperateTypes["LT"] = "lt";
15
+ OperateTypes["GE"] = "ge";
16
+ OperateTypes["LE"] = "le";
17
+ OperateTypes["Relative"] = "relative";
18
+ OperateTypes["Absolute"] = "absolute";
19
+ })(OperateTypes || (OperateTypes = {}));
@@ -0,0 +1,16 @@
1
+ export declare const stringOperate: {
2
+ name: string;
3
+ value: string;
4
+ }[];
5
+ export declare const numberOperate: {
6
+ name: string;
7
+ value: string;
8
+ }[];
9
+ export declare const dateOperate: {
10
+ name: string;
11
+ value: string;
12
+ }[];
13
+ export declare const propSubtype: {
14
+ label: string;
15
+ value: string;
16
+ }[];
@@ -0,0 +1,67 @@
1
+ export var stringOperate = [{
2
+ name: '是',
3
+ value: 'equal'
4
+ }, {
5
+ name: '包含',
6
+ value: 'contains'
7
+ }, {
8
+ name: '不是',
9
+ value: 'not equal'
10
+ }, {
11
+ name: '不包含',
12
+ value: 'not contains'
13
+ }, {
14
+ name: '开头是',
15
+ value: 'begin with'
16
+ }, {
17
+ name: '结尾是',
18
+ value: 'end with'
19
+ }, {
20
+ name: '开头不是',
21
+ value: 'not begin with'
22
+ }, {
23
+ name: '结尾不是',
24
+ value: 'not end with'
25
+ }, {
26
+ name: '是空值',
27
+ value: 'is null'
28
+ }, {
29
+ name: '不是空值',
30
+ value: 'is not null'
31
+ }];
32
+ export var numberOperate = [{
33
+ name: '>',
34
+ value: 'gt'
35
+ }, {
36
+ name: '=',
37
+ value: 'equal'
38
+ }, {
39
+ name: '<',
40
+ value: 'lt'
41
+ }, {
42
+ name: '>=',
43
+ value: 'ge'
44
+ }, {
45
+ name: '<=',
46
+ value: 'le'
47
+ }, {
48
+ name: '≠',
49
+ value: 'not equal'
50
+ }];
51
+ export var dateOperate = [{
52
+ name: '最近',
53
+ value: 'relative'
54
+ }, {
55
+ name: '固定时段',
56
+ value: 'absolute'
57
+ }];
58
+ export var propSubtype = [{
59
+ label: '时',
60
+ value: '1'
61
+ }, {
62
+ label: '分',
63
+ value: '2'
64
+ }, {
65
+ label: '秒',
66
+ value: '3'
67
+ }];
@@ -1,2 +1,3 @@
1
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
1
2
  declare const _default: () => JSX.Element;
2
3
  export default _default;
@@ -11,56 +11,54 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
13
  import React, { useState } from 'react';
14
- import { Button, Form } from 'antd';
15
- import BizAttributeSelector from '..';
16
- import eventData from '../data/event';
17
- import envData from '../data/env';
18
- import userData from '../data/user';
19
- var options = {
20
- event: eventData,
21
- user: userData,
22
- env: envData
23
- };
14
+ import { BizAttributeSelector, BizGlobalDataContext } from '@zgfe/business-lib';
15
+ import '@zgfe/business-lib/es/assets/styles/resetAntd.less';
16
+ import eventData from '../../mock/event';
17
+ import envData from '../../mock/env';
18
+ import userData from '../../mock/user';
19
+ import convertAttributeData from '../util';
24
20
  export default (function () {
25
- var _Form$useForm = Form.useForm(),
26
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
27
- form = _Form$useForm2[0];
28
-
29
21
  var _useState = useState({
30
- attr: 'visit_times'
22
+ id: 30183426,
23
+ propCategory: 'eventProp'
31
24
  }),
32
25
  _useState2 = _slicedToArray(_useState, 2),
33
- formData = _useState2[0],
34
- setFormData = _useState2[1];
26
+ attribute = _useState2[0],
27
+ setAttribute = _useState2[1];
35
28
 
36
- var onFinish = function onFinish(values) {
37
- setFormData(values);
38
- };
29
+ var store = convertAttributeData({
30
+ eventList: eventData,
31
+ userPropList: userData,
32
+ envPropList: envData
33
+ });
39
34
 
40
- var onFinishFailed = function onFinishFailed(errorInfo) {
41
- console.log('Failed:', errorInfo);
42
- };
35
+ function onChange(val) {
36
+ setAttribute(val);
37
+ }
43
38
 
44
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
45
- form: form,
46
- onFinish: onFinish,
47
- onFinishFailed: onFinishFailed,
48
- initialValues: formData
49
- }, /*#__PURE__*/React.createElement(Form.Item, {
50
- label: "\u5C5E\u6027",
51
- name: "attr"
52
- }, /*#__PURE__*/React.createElement(BizAttributeSelector, {
53
- options: options,
54
- showUserProp: true,
55
- showEventEnv: true,
56
- responseType: 'object'
57
- })), /*#__PURE__*/React.createElement(Form.Item, {
58
- wrapperCol: {
59
- offset: 8,
60
- span: 16
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, {
40
+ value: {
41
+ eventGroupList: store.eventGroupList,
42
+ userPropList: store.userPropList,
43
+ eventEnvList: store.envPropList
61
44
  }
62
- }, /*#__PURE__*/React.createElement(Button, {
63
- type: "primary",
64
- htmlType: "submit"
65
- }, "Submit"))), /*#__PURE__*/React.createElement("p", null, JSON.stringify(formData)));
45
+ }, /*#__PURE__*/React.createElement(BizAttributeSelector, {
46
+ enableEventProp: true,
47
+ enableUserProp: true,
48
+ eventIdList: [24143016],
49
+ value: attribute,
50
+ onChange: onChange,
51
+ enableDelete: true,
52
+ disableItemList: [{
53
+ propCategory: 'eventProp',
54
+ id: 30183424
55
+ }, {
56
+ name: 'is_anonymous',
57
+ propCategory: 'userProp'
58
+ }, {
59
+ name: 'browser_version',
60
+ propCategory: 'envProp'
61
+ }],
62
+ enableEnvProp: true
63
+ })));
66
64
  });
@@ -1,110 +1,5 @@
1
- import React, { ReactNode } from 'react';
2
- import { EventMetaProps } from '../utils/type';
3
- import './index.less';
4
- export interface AttrsListProps extends BasicOption {
5
- value?: string | number;
6
- text?: string;
7
- attr_id?: string | number;
8
- attr_name?: string;
9
- alias_name?: string | null;
10
- prop_type?: string | number;
11
- icon?: string;
12
- value_dict?: boolean;
13
- hidden?: boolean | number;
14
- dimension_sub?: string | number;
15
- [prop: string]: any;
16
- }
17
- interface BasicOption {
18
- attrId?: string;
19
- id?: string | number;
20
- label?: string | number;
21
- name?: string;
22
- dimensionId?: string;
23
- }
24
- export interface AttributeProps {
25
- /**
26
- * @description 若组件是表单选项,value就是form的initialValues,也是组件的默认选项
27
- * @description.zh-CN
28
- * @default -
29
- */
30
- value?: string | number | AttrsListProps | null;
31
- /**
32
- * @description 默认选项
33
- * @description.zh-CN
34
- * @default -
35
- */
36
- defaultValue?: string | number | AttrsListProps | null;
37
- /**
38
- * @description 禁用的选项列表:key值列表
39
- * @description.zh-CN
40
- * @default []
41
- */
42
- disabled?: Array<string | number>;
43
- /**
44
- * @description 返回数据类型
45
- * @description.zh-CN id | object
46
- * @default id
47
- */
48
- responseType?: string;
49
- /**
50
- * @description 数据化配置选项内容
51
- * @description.zh-CN
52
- * @default -
53
- */
54
- options?: EventMetaProps;
55
- /**
56
- * @description 是否展示删除按钮
57
- * @description.zh-CN
58
- * @default false
59
- */
60
- showDeleteIcon?: boolean;
61
- /**
62
- * @description 选择框是第几个
63
- * @description.zh-CN
64
- * @default 0
65
- */
66
- index?: number;
67
- /**
68
- * @description 选择框默认文本
69
- * @description.zh-CN
70
- * @default 请选择
71
- */
72
- placeholder?: string;
73
- /**
74
- * @description 是否展示事件属性
75
- * @default true
76
- */
77
- showEventProp?: Boolean;
78
- /**
79
- * @description 是否展示用户属性
80
- * @default true
81
- */
82
- showUserProp?: Boolean;
83
- /**
84
- * @description 是否展示触发环境
85
- * @default true
86
- */
87
- showEventEnv?: Boolean;
88
- /**
89
- * @description 如果是事件属性,则传事件id,多个用逗号隔开
90
- * @default -
91
- */
92
- eventIds?: string;
93
- children?: ReactNode;
94
- }
95
- export interface AttributeSingleProps extends AttributeProps {
96
- /**
97
- * @description 选中 option 时,调用此函数
98
- * @description.zh-CN
99
- * @default
100
- */
101
- onChange?: (option: string | number | AttrsListProps, value: string | number | AttrsListProps, index: number) => void;
102
- /**
103
- * @description 删除选择框
104
- * @description.zh-CN
105
- * @default -
106
- */
107
- onDelete?: () => void;
108
- }
109
- declare const BizAttributeSelector: React.FC<AttributeSingleProps>;
1
+ import React from 'react';
2
+ import { AttributeSelect } from './types';
3
+ import './styles/index.less';
4
+ declare const BizAttributeSelector: React.FC<AttributeSelect.Props>;
110
5
  export default BizAttributeSelector;