@zgfe/business-lib 1.1.31-alpha.2 → 1.1.31

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 (59) hide show
  1. package/es/assets/colorIcon/demo.css +539 -0
  2. package/es/assets/colorIcon/demo_index.html +741 -0
  3. package/es/assets/colorIcon/iconfont.css +112 -0
  4. package/es/assets/colorIcon/iconfont.js +43 -0
  5. package/es/assets/colorIcon/iconfont.json +177 -0
  6. package/es/assets/colorIcon/iconfont.svg +67 -0
  7. package/es/assets/colorIcon/iconfont.ttf +0 -0
  8. package/es/assets/colorIcon/iconfont.woff +0 -0
  9. package/es/assets/colorIcon/iconfont.woff2 +0 -0
  10. package/es/assets/iconfont/demo_index.html +95 -3
  11. package/es/assets/iconfont/iconfont.css +19 -3
  12. package/es/assets/iconfont/iconfont.js +1 -1
  13. package/es/assets/iconfont/iconfont.json +28 -0
  14. package/es/assets/iconfont/iconfont.ttf +0 -0
  15. package/es/assets/iconfont/iconfont.woff +0 -0
  16. package/es/assets/iconfont/iconfont.woff2 +0 -0
  17. package/es/assets/styles/resetAntd.less +12 -36
  18. package/es/attrConditions/utils/operates.d.ts +0 -50
  19. package/es/attrConditions/utils/operates.js +0 -126
  20. package/es/colorIcon/demo/index.d.ts +3 -0
  21. package/es/colorIcon/demo/index.js +10 -0
  22. package/es/colorIcon/index.d.ts +9 -0
  23. package/es/colorIcon/index.js +19 -0
  24. package/es/constants/apis.d.ts +1 -0
  25. package/es/constants/apis.js +2 -1
  26. package/es/datePicker/index.d.ts +1 -1
  27. package/es/datePicker/index.js +1 -1
  28. package/es/datePicker/styles/index.less +1 -1
  29. package/es/demoWrapper/content.d.ts +2 -1
  30. package/es/demoWrapper/content.js +23 -12
  31. package/es/demoWrapper/demo/index.js +5 -3
  32. package/es/demoWrapper/head.d.ts +3 -1
  33. package/es/demoWrapper/head.js +17 -5
  34. package/es/demoWrapper/index.js +18 -10
  35. package/es/eventSelector/listPanel.js +11 -4
  36. package/es/index.d.ts +3 -1
  37. package/es/index.js +3 -1
  38. package/es/socket/demo/demo.d.ts +2 -0
  39. package/es/socket/demo/demo.js +145 -0
  40. package/es/socket/demo/index.less +27 -0
  41. package/es/socket/index.d.ts +31 -0
  42. package/es/socket/index.js +291 -0
  43. package/es/socket/types.d.ts +38 -0
  44. package/es/socket/types.js +28 -0
  45. package/es/userCondition/conditionTypeList.js +1 -17
  46. package/es/userCondition/conditions/constants.d.ts +0 -1
  47. package/es/userCondition/conditions/constants.js +1 -2
  48. package/es/userCondition/conditions/eventCondition.js +2 -77
  49. package/es/userCondition/orConditions.js +0 -15
  50. package/es/userCondition/types.d.ts +3 -34
  51. package/es/userCondition/util.d.ts +1 -1
  52. package/es/userCondition/util.js +0 -29
  53. package/package.json +61 -61
  54. package/es/userCondition/conditions/businessCondition.d.ts +0 -11
  55. package/es/userCondition/conditions/businessCondition.js +0 -413
  56. package/es/userCondition/conditions/dataAttribute.d.ts +0 -10
  57. package/es/userCondition/conditions/dataAttribute.js +0 -329
  58. package/es/userCondition/conditions/timeDimension.d.ts +0 -9
  59. package/es/userCondition/conditions/timeDimension.js +0 -200
@@ -9,11 +9,8 @@ import BizEventSelector from '../../eventSelector';
9
9
  import RunTimesCondition from './runTimesCondition';
10
10
  import PeriodCondition from './periodCondition';
11
11
  import PropCondition from './propCondition';
12
- import { DownOutlined } from '@ant-design/icons';
13
12
  import './styles/eventCondition.less';
14
13
  import { BizUserConditionContext, classPrefix } from '..';
15
- import { Dropdown, notification, Space } from 'antd';
16
- import TimeDimension from './timeDimension';
17
14
  import { Tooltip } from 'antd';
18
15
  import IconFont from '../../icon/iconFont';
19
16
  var EventCondition = function EventCondition(props) {
@@ -53,38 +50,7 @@ var EventCondition = function EventCondition(props) {
53
50
  }]
54
51
  }));
55
52
  }
56
- var onClick = function onClick(_ref) {
57
- var key = _ref.key;
58
- if (key === 'time dimension') {
59
- var obj = {
60
- frequencyValues: ['1'],
61
- frequencyOperator: '>',
62
- timeDimension: 1,
63
- timeOperator: 'all',
64
- timeValues: []
65
- };
66
- if (condition.timeDimensions.length < 3) {
67
- condition.timeDimensions.push(obj);
68
- } else {
69
- notification.info({
70
- message: '时间维度最多增加3条'
71
- });
72
- }
73
- }
74
- onChange(_objectSpread({}, condition));
75
- };
76
- var items = [{
77
- label: '时间维度',
78
- key: 'time dimension'
79
- }];
80
- function onTimeDimensionChange(condition) {
81
- onChange(_objectSpread({}, condition));
82
- }
83
- function onTimeDimensionsDelete(index) {
84
- condition.timeDimensions.splice(index, 1);
85
- onChange(_objectSpread({}, condition));
86
- }
87
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
53
+ return /*#__PURE__*/React.createElement("div", {
88
54
  className: "".concat(classPrefix, "-event-condition")
89
55
  }, /*#__PURE__*/React.createElement("div", {
90
56
  className: "".concat(classPrefix, "-event-condition-left")
@@ -138,47 +104,6 @@ var EventCondition = function EventCondition(props) {
138
104
  onChange: onPeriodChange,
139
105
  isEvent: true,
140
106
  isRealTime: isRealTime
141
- }))))), condition.timeDimensions.map(function (_item, index) {
142
- return /*#__PURE__*/React.createElement("div", {
143
- style: {
144
- margin: '10px 0 0 38px'
145
- },
146
- className: "".concat(classPrefix, "-item"),
147
- key: index
148
- }, /*#__PURE__*/React.createElement("div", {
149
- style: {
150
- display: 'flex',
151
- alignItems: 'center'
152
- }
153
- }, /*#__PURE__*/React.createElement("div", {
154
- className: "".concat(classPrefix, "-period-condition-label")
155
- }, "\u65F6\u95F4\u7EF4\u5EA6"), /*#__PURE__*/React.createElement(TimeDimension, {
156
- onChange: onTimeDimensionChange,
157
- condition: condition,
158
- index: index
159
- }), /*#__PURE__*/React.createElement("div", {
160
- className: "biz-user-condition-item-delete",
161
- onClick: function onClick() {
162
- return onTimeDimensionsDelete(index);
163
- }
164
- }, /*#__PURE__*/React.createElement(IconFont, {
165
- type: "qingchu"
166
- }))));
167
- }), condition.timeDimensions.length < 3 ? /*#__PURE__*/React.createElement("div", {
168
- style: {
169
- margin: '2px 0 0 38px',
170
- color: '#4075fd',
171
- fontSize: '12px'
172
- }
173
- }, /*#__PURE__*/React.createElement(Dropdown, {
174
- menu: {
175
- items: items,
176
- onClick: onClick
177
- }
178
- }, /*#__PURE__*/React.createElement("a", {
179
- onClick: function onClick(e) {
180
- return e.preventDefault();
181
- }
182
- }, /*#__PURE__*/React.createElement(Space, null, "\u9AD8\u7EA7\u7B5B\u9009", /*#__PURE__*/React.createElement(DownOutlined, null))))) : null);
107
+ })))));
183
108
  };
184
109
  export default EventCondition;
@@ -23,7 +23,6 @@ import TagsCondition from './conditions/tagsCondition';
23
23
  import { classPrefix } from '.';
24
24
  import Text from './conditions/textDesc';
25
25
  import CdpCondition from './conditions/cdpCondition';
26
- import BusinessCondition from './conditions/businessCondition';
27
26
  var OrConditions = function OrConditions(props) {
28
27
  var _useContext = useContext(BizUserConditionContext),
29
28
  orConditionNum = _useContext.orConditionNum,
@@ -192,20 +191,6 @@ var OrConditions = function OrConditions(props) {
192
191
  onChange: onChangeRunPeriod,
193
192
  runPeriod: conditionData.runPeriod
194
193
  });
195
- } else if (String(conditionData.eventId) === '-14') {
196
- conditionDom = /*#__PURE__*/React.createElement(BusinessCondition, {
197
- label: "\u4E1A\u52A1\u6570\u636E",
198
- dataId: id,
199
- onChange: onChangeEvent,
200
- condition: condition
201
- });
202
- } else if (String(conditionData.eventId) === '-13') {
203
- conditionDom = /*#__PURE__*/React.createElement(BusinessCondition, {
204
- label: "\u8BA2\u5355\u6570\u636E",
205
- dataId: id,
206
- onChange: onChangeEvent,
207
- condition: condition
208
- });
209
194
  } else if (util.isNumber(conditionData.eventId)) {
210
195
  conditionDom = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EventCondition, {
211
196
  dataId: id,
@@ -8,7 +8,7 @@ export interface RunPeriodI {
8
8
  values: string[];
9
9
  }
10
10
  export interface RunTimesI {
11
- operator: '>' | '=' | '<' | '>=' | '<=' | '>=' | 'not equal' | 'between';
11
+ operator: '>' | '=' | '<' | '>=' | '<=' | '>=' | 'not equal';
12
12
  values: string[];
13
13
  }
14
14
  export interface AllConditionBasePropsI<T> {
@@ -24,7 +24,7 @@ export declare enum PropType {
24
24
  DATE2 = "date"
25
25
  }
26
26
  export declare namespace BizUserConditionT {
27
- type ConditionType = 'add' | 'active' | 'event' | 'prop' | 'tag' | 'cdp' | 'order' | 'business';
27
+ type ConditionType = 'add' | 'active' | 'event' | 'prop' | 'tag' | 'cdp';
28
28
  interface PropsI {
29
29
  defaultValue: BizUserConditionT.Conditions;
30
30
  onChange: (value: any[]) => void;
@@ -71,25 +71,8 @@ export declare namespace BizUserConditionT {
71
71
  category: 'fixed' | 'custom';
72
72
  propCategory?: string;
73
73
  }
74
- interface AttrsCondition {
75
- attrId: number;
76
- attrName: string;
77
- operator: 'is not null' | 'is null' | 'not contains' | 'contains' | 'equal' | 'not equal' | 'begin with' | 'not begin with' | 'end with' | 'not end with' | Unpacked<RunTimesI, 'operator'>;
78
- params: string[];
79
- attrType: 'cont-string' | 'cont-num' | 'cont-date';
80
- category: 'fixed' | 'custom';
81
- computeType: string;
82
- }
83
- interface TimeDimensionsCondition {
84
- timeDimension: number;
85
- timeOperator: string;
86
- timeValues: number[];
87
- frequencyOperator: string;
88
- frequencyValues: string[];
89
- }
90
74
  interface EventCondition {
91
75
  attrs: AttrCondition[];
92
- timeDimensions: TimeDimensionsCondition[];
93
76
  runTimes: RunTimesI;
94
77
  runPeriod: RunPeriodI;
95
78
  eventId: number;
@@ -100,20 +83,6 @@ export declare namespace BizUserConditionT {
100
83
  runPeriod: RunPeriodI;
101
84
  runTimes: RunTimesI;
102
85
  }
103
- interface BusinessCondition {
104
- attrs: AttrsCondition[];
105
- timeDimensions: TimeDimensionsCondition[];
106
- runTimes: RunTimesI;
107
- runPeriod: RunPeriodI;
108
- eventId: -14;
109
- }
110
- interface OrderCondition {
111
- attrs: AttrsCondition[];
112
- timeDimensions: TimeDimensionsCondition[];
113
- runTimes: RunTimesI;
114
- runPeriod: RunPeriodI;
115
- eventId: -13;
116
- }
117
86
  interface ActiveCondition {
118
87
  eventId: '-4';
119
88
  attrs: [];
@@ -157,7 +126,7 @@ export declare namespace BizUserConditionT {
157
126
  interface CdpCondition {
158
127
  dataset: (BizUserConditionT.CdpConditionDetail | undefined)[];
159
128
  }
160
- type Condition = EventCondition | AddCondition | ActiveCondition | PropCondition | TagsCondition | BusinessCondition | CdpCondition;
129
+ type Condition = EventCondition | AddCondition | ActiveCondition | PropCondition | TagsCondition | CdpCondition;
161
130
  type Conditions = Condition[][];
162
131
  type OtherCondition = EventCondition | AddCondition | ActiveCondition | PropCondition;
163
132
  interface ShowItemI {
@@ -1,6 +1,6 @@
1
1
  import type { GlobalContextProps } from '../context';
2
2
  import type { BizUserConditionT, Unpacked } from './types';
3
- export declare function buildCondition(type: BizUserConditionT.ConditionType): BizUserConditionT.EventCondition | BizUserConditionT.AddCondition | BizUserConditionT.BusinessCondition | BizUserConditionT.OrderCondition | BizUserConditionT.ActiveCondition | BizUserConditionT.PropCondition | BizUserConditionT.CdpCondition;
3
+ export declare function buildCondition(type: BizUserConditionT.ConditionType): BizUserConditionT.EventCondition | BizUserConditionT.AddCondition | BizUserConditionT.ActiveCondition | BizUserConditionT.PropCondition | BizUserConditionT.CdpCondition;
4
4
  export declare function transformNumberOperate(key: string, output?: boolean): string;
5
5
  export declare function findEvent(eventId: number, eventGroupList: Unpacked<GlobalContextProps, 'eventGroupList'>): import("../attributeSelector/types").AnalysisEvent | null;
6
6
  export declare function findPropAndEnv(name: string, list: Unpacked<GlobalContextProps, 'userPropList' | 'eventEnvList'>): import("../attributeSelector/types").UserProp | import("../attributeSelector/types").EnvProp | null;
@@ -40,7 +40,6 @@ export function buildCondition(type) {
40
40
  operator: '>=',
41
41
  values: ['1']
42
42
  },
43
- timeDimensions: [],
44
43
  attrs: [],
45
44
  runPeriod: {
46
45
  operator: 'relative',
@@ -67,34 +66,6 @@ export function buildCondition(type) {
67
66
  return {
68
67
  dataset: [undefined]
69
68
  };
70
- case 'business':
71
- return {
72
- eventId: -14,
73
- runTimes: {
74
- operator: '>=',
75
- values: ['1']
76
- },
77
- attrs: [],
78
- timeDimensions: [],
79
- runPeriod: {
80
- operator: 'relative',
81
- values: ['30', '0']
82
- }
83
- };
84
- case 'order':
85
- return {
86
- eventId: -13,
87
- runTimes: {
88
- operator: '>=',
89
- values: ['1']
90
- },
91
- attrs: [],
92
- timeDimensions: [],
93
- runPeriod: {
94
- operator: 'relative',
95
- values: ['30', '0']
96
- }
97
- };
98
69
  }
99
70
  }
100
71
  export function transformNumberOperate(key) {
package/package.json CHANGED
@@ -1,63 +1,63 @@
1
1
  {
2
- "name": "@zgfe/business-lib",
3
- "version": "1.1.31-alpha.2",
4
- "scripts": {
5
- "start": "dumi dev",
6
- "docs:build": "dumi build",
7
- "docs:deploy": "gh-pages -d docs-dist",
8
- "build": "father-build",
9
- "deploy": "npm run docs:build && npm run docs:deploy",
10
- "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
11
- "test": "umi-test",
12
- "test:coverage": "umi-test --coverage",
13
- "prepublishOnly": "npm run build",
14
- "pub": "lerna publish"
15
- },
16
- "module": "es/index.js",
17
- "typings": "es/index.d.ts",
18
- "gitHooks": {
19
- "pre-commit": "lint-staged"
20
- },
21
- "files": [
22
- "es"
2
+ "name": "@zgfe/business-lib",
3
+ "version": "1.1.31",
4
+ "scripts": {
5
+ "start": "dumi dev",
6
+ "docs:build": "dumi build",
7
+ "docs:deploy": "gh-pages -d docs-dist",
8
+ "build": "father-build",
9
+ "deploy": "npm run docs:build && npm run docs:deploy",
10
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
11
+ "test": "umi-test",
12
+ "test:coverage": "umi-test --coverage",
13
+ "prepublishOnly": "npm run build",
14
+ "pub": "lerna publish"
15
+ },
16
+ "module": "es/index.js",
17
+ "typings": "es/index.d.ts",
18
+ "gitHooks": {
19
+ "pre-commit": "lint-staged"
20
+ },
21
+ "files": [
22
+ "es"
23
+ ],
24
+ "lint-staged": {
25
+ "*.{js,jsx,less,md,json}": [
26
+ "prettier --write"
23
27
  ],
24
- "lint-staged": {
25
- "*.{js,jsx,less,md,json}": [
26
- "prettier --write"
27
- ],
28
- "*.ts?(x)": [
29
- "prettier --parser=typescript --write"
30
- ]
31
- },
32
- "dependencies": {
33
- "@types/js-cookie": "^3.0.2",
34
- "@types/qs": "^6.9.7",
35
- "axios": "^0.26.1",
36
- "babel-plugin-import": "^1.13.3",
37
- "echarts": "^5.3.2",
38
- "echarts-for-react": "^3.0.2",
39
- "js-cookie": "^3.0.1",
40
- "lerna": "^4.0.0",
41
- "rc-virtual-list": "^3.4.8",
42
- "react-infinite-scroll-component": "^6.1.0",
43
- "umi-request": "^1.4.0"
44
- },
45
- "devDependencies": {
46
- "@testing-library/jest-dom": "^5.15.1",
47
- "@testing-library/react": "^12.1.2",
48
- "@types/jest": "^27.0.3",
49
- "@types/lodash": "^4.14.182",
50
- "@umijs/fabric": "^2.8.1",
51
- "@umijs/test": "^3.0.5",
52
- "antd": "^4.22.8",
53
- "dumi": "^1.1.0",
54
- "father-build": "^1.17.2",
55
- "gh-pages": "^3.0.0",
56
- "lint-staged": "^10.0.7",
57
- "lodash": "^4.17.21",
58
- "prettier": "^2.2.1",
59
- "react": "^16.12.0 || ^17.0.0",
60
- "yorkie": "^2.0.0"
61
- },
62
- "gitHead": "b2e287ebcfeaa841e1f4e10bd9891e58f3223e95"
63
- }
28
+ "*.ts?(x)": [
29
+ "prettier --parser=typescript --write"
30
+ ]
31
+ },
32
+ "dependencies": {
33
+ "@types/js-cookie": "^3.0.2",
34
+ "@types/qs": "^6.9.7",
35
+ "axios": "^0.26.1",
36
+ "babel-plugin-import": "^1.13.3",
37
+ "echarts": "^5.3.2",
38
+ "echarts-for-react": "^3.0.2",
39
+ "js-cookie": "^3.0.1",
40
+ "lerna": "^4.0.0",
41
+ "rc-virtual-list": "^3.4.8",
42
+ "react-infinite-scroll-component": "^6.1.0",
43
+ "umi-request": "^1.4.0"
44
+ },
45
+ "devDependencies": {
46
+ "@testing-library/jest-dom": "^5.15.1",
47
+ "@testing-library/react": "^12.1.2",
48
+ "@types/jest": "^27.0.3",
49
+ "@types/lodash": "^4.14.182",
50
+ "@umijs/fabric": "^2.8.1",
51
+ "@umijs/test": "^3.0.5",
52
+ "antd": "^4.22.8",
53
+ "dumi": "^1.1.0",
54
+ "father-build": "^1.17.2",
55
+ "gh-pages": "^3.0.0",
56
+ "lint-staged": "^10.0.7",
57
+ "lodash": "^4.17.21",
58
+ "prettier": "^2.2.1",
59
+ "react": "^16.12.0 || ^17.0.0",
60
+ "yorkie": "^2.0.0"
61
+ },
62
+ "gitHead": "8973d9ddc501b94d01f445eaebbd4e15d98638b2"
63
+ }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { AllConditionBasePropsI, BizUserConditionT } from '../types';
3
- import './styles/periodCondition.less';
4
- export interface BusinessConditionPropsI extends AllConditionBasePropsI<any> {
5
- condition: BizUserConditionT.BusinessCondition;
6
- label?: string | React.ReactDOM;
7
- isEvent?: boolean;
8
- isRealTime?: boolean;
9
- }
10
- declare const BusinessCondition: React.FC<BusinessConditionPropsI>;
11
- export default BusinessCondition;