@zgfe/business-lib 1.0.0-beta.1

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 (178) hide show
  1. package/README.md +12 -0
  2. package/es/analysisLayout/demo/index.d.ts +3 -0
  3. package/es/analysisLayout/demo/index.js +30 -0
  4. package/es/analysisLayout/demo/index.less +12 -0
  5. package/es/analysisLayout/index.d.ts +13 -0
  6. package/es/analysisLayout/index.js +153 -0
  7. package/es/analysisLayout/index.less +115 -0
  8. package/es/attributeSelector/data/env.d.ts +11 -0
  9. package/es/attributeSelector/data/env.js +181 -0
  10. package/es/attributeSelector/data/event.d.ts +237 -0
  11. package/es/attributeSelector/data/event.js +3483 -0
  12. package/es/attributeSelector/data/user.d.ts +22 -0
  13. package/es/attributeSelector/data/user.js +218 -0
  14. package/es/attributeSelector/demo/multi.d.ts +2 -0
  15. package/es/attributeSelector/demo/multi.js +39 -0
  16. package/es/attributeSelector/demo/multiForm.d.ts +2 -0
  17. package/es/attributeSelector/demo/multiForm.js +64 -0
  18. package/es/attributeSelector/demo/single.d.ts +2 -0
  19. package/es/attributeSelector/demo/single.js +43 -0
  20. package/es/attributeSelector/demo/singleForm.d.ts +2 -0
  21. package/es/attributeSelector/demo/singleForm.js +66 -0
  22. package/es/attributeSelector/group.d.ts +31 -0
  23. package/es/attributeSelector/group.js +225 -0
  24. package/es/attributeSelector/index.d.ts +110 -0
  25. package/es/attributeSelector/index.js +578 -0
  26. package/es/attributeSelector/index.less +172 -0
  27. package/es/chart/chartConfig.d.ts +28 -0
  28. package/es/chart/chartConfig.js +256 -0
  29. package/es/chart/color.d.ts +1 -0
  30. package/es/chart/color.js +1 -0
  31. package/es/chart/demo/bar.d.ts +2 -0
  32. package/es/chart/demo/bar.js +19 -0
  33. package/es/chart/demo/data.d.ts +11 -0
  34. package/es/chart/demo/data.js +37 -0
  35. package/es/chart/demo/index.d.ts +2 -0
  36. package/es/chart/demo/index.js +9 -0
  37. package/es/chart/demo/pie.d.ts +2 -0
  38. package/es/chart/demo/pie.js +30 -0
  39. package/es/chart/index.d.ts +63 -0
  40. package/es/chart/index.js +76 -0
  41. package/es/chart/index.less +38 -0
  42. package/es/chart/style/circle.svg +4 -0
  43. package/es/commonStyle/icon.less +147 -0
  44. package/es/commonStyle/index.less +171 -0
  45. package/es/commonStyle/select.less +101 -0
  46. package/es/commonStyle/theme.less +432 -0
  47. package/es/commonStyle/variable.less +124 -0
  48. package/es/datePicker/data.d.ts +9 -0
  49. package/es/datePicker/data.js +65 -0
  50. package/es/datePicker/demo/form.d.ts +2 -0
  51. package/es/datePicker/demo/form.js +53 -0
  52. package/es/datePicker/demo/index.d.ts +2 -0
  53. package/es/datePicker/demo/index.js +30 -0
  54. package/es/datePicker/index.d.ts +29 -0
  55. package/es/datePicker/index.js +207 -0
  56. package/es/datePicker/index.less +388 -0
  57. package/es/dialog/components/list.d.ts +15 -0
  58. package/es/dialog/components/list.js +57 -0
  59. package/es/dialog/components/selectToInput.d.ts +43 -0
  60. package/es/dialog/components/selectToInput.js +107 -0
  61. package/es/dialog/components/style/list.less +59 -0
  62. package/es/dialog/components/style/tab.less +61 -0
  63. package/es/dialog/components/tab.d.ts +9 -0
  64. package/es/dialog/components/tab.js +50 -0
  65. package/es/dialog/data/chart.d.ts +11 -0
  66. package/es/dialog/data/chart.js +62 -0
  67. package/es/dialog/demo/index.d.ts +2 -0
  68. package/es/dialog/demo/index.js +122 -0
  69. package/es/dialog/demo/index2.d.ts +2 -0
  70. package/es/dialog/demo/index2.js +79 -0
  71. package/es/dialog/demo/index3.d.ts +2 -0
  72. package/es/dialog/demo/index3.js +61 -0
  73. package/es/dialog/index.d.ts +68 -0
  74. package/es/dialog/index.js +188 -0
  75. package/es/dialog/style/index.less +70 -0
  76. package/es/eventSelector/cascade.less +120 -0
  77. package/es/eventSelector/demo/form.d.ts +2 -0
  78. package/es/eventSelector/demo/form.js +89 -0
  79. package/es/eventSelector/demo/index.d.ts +2 -0
  80. package/es/eventSelector/demo/index.js +69 -0
  81. package/es/eventSelector/demo/nodata.d.ts +2 -0
  82. package/es/eventSelector/demo/nodata.js +13 -0
  83. package/es/eventSelector/index.d.ts +27 -0
  84. package/es/eventSelector/index.js +390 -0
  85. package/es/eventSelector/type.d.ts +41 -0
  86. package/es/eventSelector/type.js +1 -0
  87. package/es/globalAttributes/demo/data/env.d.ts +11 -0
  88. package/es/globalAttributes/demo/data/env.js +181 -0
  89. package/es/globalAttributes/demo/data/event.d.ts +237 -0
  90. package/es/globalAttributes/demo/data/event.js +3483 -0
  91. package/es/globalAttributes/demo/data/user.d.ts +22 -0
  92. package/es/globalAttributes/demo/data/user.js +218 -0
  93. package/es/globalAttributes/demo/index.d.ts +2 -0
  94. package/es/globalAttributes/demo/index.js +50 -0
  95. package/es/globalAttributes/index.d.ts +46 -0
  96. package/es/globalAttributes/index.js +116 -0
  97. package/es/index.d.ts +23 -0
  98. package/es/index.js +25 -0
  99. package/es/multipleSelector/demo/index.d.ts +2 -0
  100. package/es/multipleSelector/demo/index.js +35 -0
  101. package/es/multipleSelector/index.d.ts +36 -0
  102. package/es/multipleSelector/index.js +109 -0
  103. package/es/multipleSelector/index.less +138 -0
  104. package/es/select/demo/index.d.ts +2 -0
  105. package/es/select/demo/index.js +22 -0
  106. package/es/select/index.d.ts +42 -0
  107. package/es/select/index.js +142 -0
  108. package/es/table/demo/data/color.d.ts +1 -0
  109. package/es/table/demo/data/color.js +1 -0
  110. package/es/table/demo/data/data.d.ts +11 -0
  111. package/es/table/demo/data/data.js +37 -0
  112. package/es/table/demo/data/table.d.ts +4 -0
  113. package/es/table/demo/data/table.js +37 -0
  114. package/es/table/demo/index.d.ts +3 -0
  115. package/es/table/demo/index.js +171 -0
  116. package/es/table/demo/index.less +8 -0
  117. package/es/table/demo/index2.d.ts +2 -0
  118. package/es/table/demo/index2.js +9 -0
  119. package/es/table/index.d.ts +32 -0
  120. package/es/table/index.js +80 -0
  121. package/es/table/index.less +102 -0
  122. package/es/targetConditionGroup/components/conditionGroup.d.ts +30 -0
  123. package/es/targetConditionGroup/components/conditionGroup.js +111 -0
  124. package/es/targetConditionGroup/components/conditionItem.d.ts +47 -0
  125. package/es/targetConditionGroup/components/conditionItem.js +259 -0
  126. package/es/targetConditionGroup/components/style/group.less +47 -0
  127. package/es/targetConditionGroup/components/style/index.less +16 -0
  128. package/es/targetConditionGroup/data/operates.d.ts +36 -0
  129. package/es/targetConditionGroup/data/operates.js +98 -0
  130. package/es/targetConditionGroup/demo/data/env.d.ts +11 -0
  131. package/es/targetConditionGroup/demo/data/env.js +181 -0
  132. package/es/targetConditionGroup/demo/data/event.d.ts +237 -0
  133. package/es/targetConditionGroup/demo/data/event.js +3483 -0
  134. package/es/targetConditionGroup/demo/data/user.d.ts +22 -0
  135. package/es/targetConditionGroup/demo/data/user.js +218 -0
  136. package/es/targetConditionGroup/demo/form.d.ts +2 -0
  137. package/es/targetConditionGroup/demo/form.js +96 -0
  138. package/es/targetConditionGroup/demo/index.d.ts +2 -0
  139. package/es/targetConditionGroup/demo/index.js +73 -0
  140. package/es/targetConditionGroup/demo/item.d.ts +2 -0
  141. package/es/targetConditionGroup/demo/item.js +5 -0
  142. package/es/targetConditionGroup/index.d.ts +53 -0
  143. package/es/targetConditionGroup/index.js +265 -0
  144. package/es/targetConditionGroup/index.less +65 -0
  145. package/es/targetConditionGroup/type.d.ts +50 -0
  146. package/es/targetConditionGroup/type.js +1 -0
  147. package/es/targetSelector/components/BizCascadeBox.d.ts +34 -0
  148. package/es/targetSelector/components/BizCascadeBox.js +213 -0
  149. package/es/targetSelector/components/BizEventNameEditBox.d.ts +20 -0
  150. package/es/targetSelector/components/BizEventNameEditBox.js +57 -0
  151. package/es/targetSelector/demo/form.d.ts +2 -0
  152. package/es/targetSelector/demo/form.js +133 -0
  153. package/es/targetSelector/demo/index.d.ts +2 -0
  154. package/es/targetSelector/demo/index.js +107 -0
  155. package/es/targetSelector/demo/nodata.d.ts +2 -0
  156. package/es/targetSelector/demo/nodata.js +13 -0
  157. package/es/targetSelector/index.d.ts +40 -0
  158. package/es/targetSelector/index.js +204 -0
  159. package/es/targetSelector/index.less +53 -0
  160. package/es/userGroup/demo/cluster.d.ts +3 -0
  161. package/es/userGroup/demo/cluster.js +102 -0
  162. package/es/userGroup/demo/index.d.ts +3 -0
  163. package/es/userGroup/demo/index.js +115 -0
  164. package/es/userGroup/demo/index.less +3 -0
  165. package/es/userGroup/index.d.ts +79 -0
  166. package/es/userGroup/index.js +134 -0
  167. package/es/userGroup/index.less +2 -0
  168. package/es/userGroup/userCluster.d.ts +63 -0
  169. package/es/userGroup/userCluster.js +254 -0
  170. package/es/utils/ajax.d.ts +7 -0
  171. package/es/utils/ajax.js +139 -0
  172. package/es/utils/index.d.ts +3 -0
  173. package/es/utils/index.js +3 -0
  174. package/es/utils/type.d.ts +54 -0
  175. package/es/utils/type.js +1 -0
  176. package/es/utils/util.d.ts +67 -0
  177. package/es/utils/util.js +204 -0
  178. package/package.json +55 -0
@@ -0,0 +1,22 @@
1
+ declare const _default: ({
2
+ dimension_sub: string;
3
+ value_dict: boolean;
4
+ name: string;
5
+ id: number;
6
+ text: string;
7
+ category: string;
8
+ type: number;
9
+ alias_name: null;
10
+ subtype?: undefined;
11
+ } | {
12
+ dimension_sub: string;
13
+ subtype: number;
14
+ value_dict: boolean;
15
+ name: string;
16
+ id: number;
17
+ text: string;
18
+ category: string;
19
+ type: number;
20
+ alias_name: null;
21
+ })[];
22
+ export default _default;
@@ -0,0 +1,218 @@
1
+ export default [{
2
+ dimension_sub: 'name',
3
+ value_dict: false,
4
+ name: 'name',
5
+ id: 0,
6
+ text: '名称',
7
+ category: 'fixed',
8
+ type: 1,
9
+ alias_name: null
10
+ }, {
11
+ dimension_sub: 'is_anonymous',
12
+ value_dict: false,
13
+ name: 'is_anonymous',
14
+ id: 0,
15
+ text: '实名/匿名',
16
+ category: 'fixed',
17
+ type: 1,
18
+ alias_name: null
19
+ }, {
20
+ dimension_sub: 'app_user_id',
21
+ value_dict: false,
22
+ name: 'app_user_id',
23
+ id: -1,
24
+ text: '用户ID',
25
+ category: 'fixed',
26
+ type: 1,
27
+ alias_name: null
28
+ }, {
29
+ dimension_sub: 'zg_id',
30
+ value_dict: false,
31
+ name: 'zg_id',
32
+ id: 0,
33
+ text: '诸葛ID',
34
+ category: 'fixed',
35
+ type: 2,
36
+ alias_name: null
37
+ }, {
38
+ dimension_sub: 'first_visit_time',
39
+ value_dict: false,
40
+ name: 'first_visit_time',
41
+ id: 0,
42
+ text: '首次访问时间',
43
+ category: 'fixed',
44
+ type: 3,
45
+ alias_name: null
46
+ }, {
47
+ dimension_sub: 'last_visit_time',
48
+ value_dict: false,
49
+ name: 'last_visit_time',
50
+ id: 0,
51
+ text: '最后一次访问时间',
52
+ category: 'fixed',
53
+ type: 3,
54
+ alias_name: null
55
+ }, {
56
+ dimension_sub: 'visit_times',
57
+ value_dict: false,
58
+ name: 'visit_times',
59
+ id: 0,
60
+ text: '近30天访问次数',
61
+ category: 'fixed',
62
+ type: 2,
63
+ alias_name: null
64
+ }, {
65
+ dimension_sub: 'duration',
66
+ subtype: 2,
67
+ value_dict: false,
68
+ name: 'duration',
69
+ id: 0,
70
+ text: '近30天访问时长',
71
+ category: 'fixed',
72
+ type: 2,
73
+ alias_name: null
74
+ }, {
75
+ dimension_sub: 'current_country',
76
+ value_dict: false,
77
+ name: 'current_country',
78
+ id: 0,
79
+ text: '国家',
80
+ category: 'fixed',
81
+ type: 1,
82
+ alias_name: null
83
+ }, {
84
+ dimension_sub: 'current_area',
85
+ value_dict: false,
86
+ name: 'current_area',
87
+ id: 0,
88
+ text: '省份',
89
+ category: 'fixed',
90
+ type: 1,
91
+ alias_name: null
92
+ }, {
93
+ dimension_sub: 'current_city',
94
+ value_dict: false,
95
+ name: 'current_city',
96
+ id: 0,
97
+ text: '城市',
98
+ category: 'fixed',
99
+ type: 1,
100
+ alias_name: null
101
+ }, {
102
+ dimension_sub: 'user_referer_url',
103
+ value_dict: false,
104
+ name: 'user_referer_url',
105
+ id: 0,
106
+ text: '首次来源URL',
107
+ category: 'fixed',
108
+ type: 1,
109
+ alias_name: null
110
+ }, {
111
+ dimension_sub: 'first_website',
112
+ value_dict: false,
113
+ name: 'first_website',
114
+ id: 0,
115
+ text: '首次来源域名',
116
+ category: 'fixed',
117
+ type: 1,
118
+ alias_name: null
119
+ }, {
120
+ dimension_sub: 'first_utm_source',
121
+ value_dict: false,
122
+ name: 'first_utm_source',
123
+ id: 0,
124
+ text: '首次utm_source',
125
+ category: 'fixed',
126
+ type: 1,
127
+ alias_name: null
128
+ }, {
129
+ dimension_sub: 'first_utm_medium',
130
+ value_dict: false,
131
+ name: 'first_utm_medium',
132
+ id: 0,
133
+ text: '首次utm_medium',
134
+ category: 'fixed',
135
+ type: 1,
136
+ alias_name: null
137
+ }, {
138
+ dimension_sub: 'first_utm_campaign',
139
+ value_dict: false,
140
+ name: 'first_utm_campaign',
141
+ id: 0,
142
+ text: '首次utm_campaign',
143
+ category: 'fixed',
144
+ type: 1,
145
+ alias_name: null
146
+ }, {
147
+ dimension_sub: 'first_utm_content',
148
+ value_dict: false,
149
+ name: 'first_utm_content',
150
+ id: 0,
151
+ text: '首次utm_content',
152
+ category: 'fixed',
153
+ type: 1,
154
+ alias_name: null
155
+ }, {
156
+ dimension_sub: 'first_utm_term',
157
+ value_dict: false,
158
+ name: 'first_utm_term',
159
+ id: 0,
160
+ text: '首次utm_term',
161
+ category: 'fixed',
162
+ type: 1,
163
+ alias_name: null
164
+ }, {
165
+ dimension_sub: 'current_browser_brand',
166
+ value_dict: false,
167
+ name: 'current_browser_brand',
168
+ id: 0,
169
+ text: '浏览器品牌',
170
+ category: 'fixed',
171
+ type: 1,
172
+ alias_name: null
173
+ }, {
174
+ dimension_sub: 'current_browser_version',
175
+ value_dict: false,
176
+ name: 'current_browser_version',
177
+ id: 0,
178
+ text: '浏览器版本',
179
+ category: 'fixed',
180
+ type: 2,
181
+ alias_name: null
182
+ }, {
183
+ dimension_sub: 'current_os',
184
+ value_dict: false,
185
+ name: 'current_os',
186
+ id: 0,
187
+ text: '操作系统',
188
+ category: 'fixed',
189
+ type: 1,
190
+ alias_name: null
191
+ }, {
192
+ dimension_sub: 'current_ov',
193
+ value_dict: false,
194
+ name: 'current_ov',
195
+ id: 0,
196
+ text: '系统版本',
197
+ category: 'fixed',
198
+ type: 2,
199
+ alias_name: null
200
+ }, {
201
+ dimension_sub: 'current_resolution_h',
202
+ value_dict: false,
203
+ name: 'current_resolution_h',
204
+ id: 0,
205
+ text: '屏幕高度',
206
+ category: 'fixed',
207
+ type: 2,
208
+ alias_name: null
209
+ }, {
210
+ dimension_sub: 'current_resolution_l',
211
+ value_dict: false,
212
+ name: 'current_resolution_l',
213
+ id: 0,
214
+ text: '屏幕宽度',
215
+ category: 'fixed',
216
+ type: 2,
217
+ alias_name: null
218
+ }];
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,50 @@
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, { useState } from 'react';
14
+ import { BizGlobalAttributes } from 'business-lib';
15
+ import eventData from './data/event';
16
+ import envData from './data/env';
17
+ import userData from './data/user';
18
+ var attrsData = {
19
+ operator: 'and',
20
+ attrs: [{
21
+ attrId: 5461056,
22
+ attrName: '支付方式',
23
+ operator: 'equal',
24
+ params: ['白条'],
25
+ attrType: 'cont-string',
26
+ category: 'custom'
27
+ }]
28
+ };
29
+ var attrOption = {
30
+ event: eventData,
31
+ user: userData,
32
+ env: envData
33
+ };
34
+ export default (function () {
35
+ var _useState = useState(),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ globalAttrs = _useState2[0],
38
+ setGlobalAttrs = _useState2[1];
39
+
40
+ var handleChange = function handleChange(data) {
41
+ setGlobalAttrs(function () {
42
+ return JSON.stringify(data);
43
+ });
44
+ };
45
+
46
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizGlobalAttributes, {
47
+ options: attrOption,
48
+ onChange: handleChange
49
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", null, "\u5168\u5C40\u5C5E\u6027\uFF1A ", globalAttrs));
50
+ });
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ interface AttrType {
3
+ attrId?: string;
4
+ [props: string]: any;
5
+ }
6
+ interface ValueType {
7
+ operate?: string;
8
+ attrs?: Array<AttrType>;
9
+ }
10
+ interface GlobalAttributeProps {
11
+ /**
12
+ * @description 默认值
13
+ * @default {}
14
+ */
15
+ defaultValue?: ValueType;
16
+ /**
17
+ * @description 默认值
18
+ * @default {}
19
+ */
20
+ value?: ValueType;
21
+ /**
22
+ * @description 数据化配置选项内容
23
+ * @description.zh-CN
24
+ * @default -
25
+ */
26
+ options?: object;
27
+ /**
28
+ * @description 属性最多个数
29
+ * @description.zh-CN
30
+ * @default 3
31
+ */
32
+ max?: number;
33
+ /**
34
+ * @description 如果是事件属性,则传事件id,多个用逗号隔开
35
+ * @default -
36
+ */
37
+ eventIds?: string;
38
+ /**
39
+ * @description 参数改变回调
40
+ * @description.zh-CN
41
+ * @default
42
+ */
43
+ onChange?: (data: ValueType) => void;
44
+ }
45
+ declare const BizGlobalAttributes: React.FC<GlobalAttributeProps>;
46
+ export default BizGlobalAttributes;
@@ -0,0 +1,116 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+
9
+ 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; }
10
+
11
+ 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; }
12
+
13
+ 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; }
14
+
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+
17
+ 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."); }
18
+
19
+ 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); }
20
+
21
+ 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; }
22
+
23
+ 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; }
24
+
25
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
+
27
+ import React, { useEffect, useState } from 'react';
28
+ import { BizConditionGroup, IconFont } from '..';
29
+
30
+ var BizGlobalAttributes = function BizGlobalAttributes(props) {
31
+ var _props$defaultValue = props.defaultValue,
32
+ defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
33
+ _props$value = props.value,
34
+ value = _props$value === void 0 ? {} : _props$value,
35
+ options = props.options,
36
+ _props$max = props.max,
37
+ max = _props$max === void 0 ? 5 : _props$max,
38
+ eventIds = props.eventIds,
39
+ _onChange = props.onChange;
40
+
41
+ var _useState = useState({}),
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ attrsData = _useState2[0],
44
+ setAttrsData = _useState2[1];
45
+
46
+ useEffect(function () {
47
+ var defaultAttrs = Object.keys(defaultValue).length > 0 ? defaultValue : value;
48
+ var arr = [];
49
+ var operate = defaultAttrs.operate,
50
+ attrs = defaultAttrs.attrs;
51
+
52
+ if (attrs) {
53
+ arr = attrs.map(function (item) {
54
+ var data = _objectSpread({}, item);
55
+
56
+ var attrId = Math.random().toString();
57
+ return {
58
+ attrId: attrId,
59
+ data: data
60
+ };
61
+ });
62
+ } else {
63
+ arr = [{
64
+ attrId: Math.random().toString()
65
+ }];
66
+ }
67
+
68
+ setAttrsData(function (data) {
69
+ return {
70
+ operate: operate,
71
+ attrs: _toConsumableArray(arr)
72
+ };
73
+ });
74
+ }, []);
75
+
76
+ var _addAttribute = function _addAttribute() {
77
+ setAttrsData(function (data) {
78
+ var arr = [{
79
+ attrId: Math.random().toString()
80
+ }];
81
+
82
+ if (!data.attrs) {
83
+ data.attrs = arr;
84
+ } else {
85
+ data.attrs = data.attrs.concat(arr);
86
+ }
87
+
88
+ return _objectSpread({}, data);
89
+ });
90
+ };
91
+
92
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizConditionGroup, {
93
+ defaultValue: attrsData,
94
+ options: options,
95
+ eventIds: eventIds,
96
+ onChange: function onChange(data) {
97
+ setAttrsData(function () {
98
+ return _objectSpread({}, data);
99
+ });
100
+ _onChange && _onChange(_objectSpread({}, data));
101
+ }
102
+ }), attrsData.attrs && attrsData.attrs.length < max && /*#__PURE__*/React.createElement("div", {
103
+ className: "biz-icon-add",
104
+ style: {
105
+ marginTop: '16px'
106
+ },
107
+ onClick: _addAttribute
108
+ }, /*#__PURE__*/React.createElement(IconFont, {
109
+ className: "biz-icon",
110
+ type: 'icon-tianjia1'
111
+ }), /*#__PURE__*/React.createElement("span", {
112
+ className: "biz-icon-text"
113
+ }, "\u6DFB\u52A0\u5C5E\u6027")));
114
+ };
115
+
116
+ export default BizGlobalAttributes;
package/es/index.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ /// <reference types="react" />
3
+ import BizAnalysisLayout from './AnalysisLayout';
4
+ import BizUserGroup from './userGroup';
5
+ import BizUserCluster from './userGroup/userCluster';
6
+ import BizTargetSelector from './targetSelector';
7
+ import BizEventSelector from './eventSelector';
8
+ import BizAttributeSelector from './attributeSelector';
9
+ import BizGroupSelect from './attributeSelector/group';
10
+ import BizMultipleSelector from './multipleSelector';
11
+ import BizTargetCondition from './targetConditionGroup';
12
+ import BizConditionGroup from './targetConditionGroup/components/conditionGroup';
13
+ import BizDatePicker from './datePicker';
14
+ import BizGlobalAttributes from './globalAttributes';
15
+ import BizSelect from './select';
16
+ import BizDialog from './dialog';
17
+ import BizChart from './chart';
18
+ import BizTable from './table';
19
+ import { util, ajax } from './utils';
20
+ import { GlobalContextProps } from './utils/type';
21
+ declare const IconFont: import("react").FC<import("@ant-design/icons/lib/components/IconFont").IconFontProps<string>>;
22
+ declare const BizGlobalDataContext: import("react").Context<GlobalContextProps>;
23
+ export { BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, BizUserCluster, IconFont, BizTargetSelector, BizEventSelector, BizGroupSelect, BizAttributeSelector, BizGlobalDataContext, BizMultipleSelector, BizTargetCondition, BizDatePicker, BizConditionGroup, BizGlobalAttributes, ajax, util, };
package/es/index.js ADDED
@@ -0,0 +1,25 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import BizAnalysisLayout from './AnalysisLayout';
3
+ import BizUserGroup from './userGroup';
4
+ import BizUserCluster from './userGroup/userCluster';
5
+ import BizTargetSelector from './targetSelector';
6
+ import { createFromIconfontCN } from '@ant-design/icons';
7
+ import BizEventSelector from './eventSelector';
8
+ import BizAttributeSelector from './attributeSelector';
9
+ import { createContext } from 'react';
10
+ import BizGroupSelect from './attributeSelector/group';
11
+ import BizMultipleSelector from './multipleSelector';
12
+ import BizTargetCondition from './targetConditionGroup';
13
+ import BizConditionGroup from './targetConditionGroup/components/conditionGroup';
14
+ import BizDatePicker from './datePicker';
15
+ import BizGlobalAttributes from './globalAttributes';
16
+ import BizSelect from './select';
17
+ import BizDialog from './dialog';
18
+ import BizChart from './chart';
19
+ import BizTable from './table';
20
+ import { util, ajax } from './utils';
21
+ var IconFont = createFromIconfontCN({
22
+ scriptUrl: '//at.alicdn.com/t/font_422162_0fv3r3nvceb6.js'
23
+ });
24
+ var BizGlobalDataContext = /*#__PURE__*/createContext({});
25
+ export { BizSelect, BizDialog, BizChart, BizTable, BizAnalysisLayout, BizUserGroup, BizUserCluster, IconFont, BizTargetSelector, BizEventSelector, BizGroupSelect, BizAttributeSelector, BizGlobalDataContext, BizMultipleSelector, BizTargetCondition, BizDatePicker, BizConditionGroup, BizGlobalAttributes, ajax, util };
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;
@@ -0,0 +1,35 @@
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, { useState } from 'react';
14
+ import { BizMultipleSelector } from 'business-lib';
15
+ var options = ['CHROME48', 'FIREFOX37', 'CHROME21', 'Firefox', 'FIREFOX_MOBILE', 'BOT', 'FIREFOX9', 'MOBILE_SAFARI', 'MOBILE_SAFARI2', 'MOBILE_SAFARI4'];
16
+ export default (function () {
17
+ var _useState = useState(['CHROME48']),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ condition = _useState2[0],
20
+ setCondition = _useState2[1];
21
+
22
+ var handleChange = function handleChange(data) {
23
+ setCondition(data);
24
+ };
25
+
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ style: {
28
+ width: '400px'
29
+ }
30
+ }, /*#__PURE__*/React.createElement(BizMultipleSelector, {
31
+ options: options,
32
+ defaultValue: condition,
33
+ onChange: handleChange
34
+ }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("p", null, "\u9009\u62E9\u7684\u6761\u4EF6\u503C\u662F\uFF1A", JSON.stringify(condition)));
35
+ });
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface ConditionProps {
4
+ /**
5
+ * @description 若组件是表单选项,value就是form的initialValues,也是组件的默认选项
6
+ * @description.zh-CN
7
+ * @default -
8
+ */
9
+ value?: Array<string | number>;
10
+ /**
11
+ * @description 默认选项
12
+ * @description.zh-CN
13
+ * @default -
14
+ */
15
+ defaultValue?: Array<string | number>;
16
+ /**
17
+ * @description 数据化配置选项内容
18
+ * @description.zh-CN
19
+ * @default -
20
+ */
21
+ options: Array<string | number>;
22
+ /**
23
+ * @description 选择框默认文本
24
+ * @description.zh-CN
25
+ * @default 请选择
26
+ */
27
+ placeholder?: string;
28
+ /**
29
+ * @description 选中 option 时,调用此函数,返回value数组
30
+ * @description.zh-CN
31
+ * @default
32
+ */
33
+ onChange?: (value: Array<string | number>) => void;
34
+ }
35
+ declare const BizMultipleSelector: React.FC<ConditionProps>;
36
+ export default BizMultipleSelector;