@zgfe/business-lib 1.0.1-beta.0 → 1.0.3-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 (58) hide show
  1. package/es/analysisLayout/index.js +11 -9
  2. package/es/attrConditions/components/stringList.js +1 -0
  3. package/es/attrConditions/components/valuesList.js +4 -2
  4. package/es/attrConditions/group.js +1 -2
  5. package/es/attributeSelector/index.js +6 -4
  6. package/es/attributeSelector/listPanel.js +11 -9
  7. package/es/chart/index.js +12 -10
  8. package/es/components/iconFont.js +4 -2
  9. package/es/dialog/components/itemNode.d.ts +1 -0
  10. package/es/dialog/components/itemNode.js +15 -13
  11. package/es/dialog/components/list.js +7 -5
  12. package/es/dialog/components/selectToInput.js +8 -6
  13. package/es/dialog/index.js +14 -11
  14. package/es/dialog/types.d.ts +1 -1
  15. package/es/eventSelector/listPanel.js +4 -2
  16. package/es/index.d.ts +2 -1
  17. package/es/index.js +2 -1
  18. package/es/select/handle.d.ts +2 -2
  19. package/es/select/handle.js +8 -8
  20. package/es/select/index.js +6 -4
  21. package/es/table/index.js +12 -10
  22. package/es/targetConditionGroup/index.js +5 -2
  23. package/es/targetSelector/index.js +6 -4
  24. package/es/userCondition/conditionTypeList.d.ts +10 -0
  25. package/es/userCondition/conditionTypeList.js +43 -0
  26. package/es/userCondition/conditionWrap.d.ts +7 -0
  27. package/es/userCondition/conditionWrap.js +18 -0
  28. package/es/userCondition/conditions/eventCondition.d.ts +8 -0
  29. package/es/userCondition/conditions/eventCondition.js +104 -0
  30. package/es/userCondition/conditions/periodCondition.d.ts +11 -0
  31. package/es/userCondition/conditions/periodCondition.js +156 -0
  32. package/es/userCondition/conditions/propCondition.d.ts +11 -0
  33. package/es/userCondition/conditions/propCondition.js +147 -0
  34. package/es/userCondition/conditions/runTimesCondition.d.ts +9 -0
  35. package/es/userCondition/conditions/runTimesCondition.js +78 -0
  36. package/es/userCondition/conditions/styles/eventCondition.less +49 -0
  37. package/es/userCondition/conditions/styles/periodCondition.less +14 -0
  38. package/es/userCondition/conditions/styles/propCondition.less +36 -0
  39. package/es/userCondition/conditions/styles/runTimesCondition.less +16 -0
  40. package/es/userCondition/demo/index.d.ts +2 -0
  41. package/es/userCondition/demo/index.js +97 -0
  42. package/es/userCondition/index.d.ts +7 -0
  43. package/es/userCondition/index.js +146 -0
  44. package/es/userCondition/orConditions.d.ts +5 -0
  45. package/es/userCondition/orConditions.js +202 -0
  46. package/es/userCondition/relationLabel.d.ts +6 -0
  47. package/es/userCondition/relationLabel.js +12 -0
  48. package/es/userCondition/styles/conditionTypeList.less +31 -0
  49. package/es/userCondition/styles/conditionWrap.less +14 -0
  50. package/es/userCondition/styles/index.less +13 -0
  51. package/es/userCondition/styles/orConditions.less +16 -0
  52. package/es/userCondition/styles/relationLabel.less +18 -0
  53. package/es/userCondition/types.d.ts +79 -0
  54. package/es/userCondition/types.js +1 -0
  55. package/es/userCondition/util.d.ts +2 -0
  56. package/es/userCondition/util.js +54 -0
  57. package/es/userGroup/index.js +6 -4
  58. package/package.json +2 -2
@@ -0,0 +1,79 @@
1
+ export interface RunPeriodI {
2
+ operator: 'relative' | 'unlimited_time' | 'join_time' | 'absolute';
3
+ values: string[];
4
+ }
5
+ export interface RunTimesI {
6
+ operator: '>' | '=' | '<' | '>=' | '<=' | '>=' | 'not equal';
7
+ values: string[];
8
+ }
9
+ export interface AllConditionBasePropsI<T> {
10
+ dataId: number;
11
+ onChange: (dataId: number, newData: T) => void;
12
+ }
13
+ export declare namespace BizUserConditionT {
14
+ type ConditionType = 'add' | 'active' | 'event' | 'prop';
15
+ interface PropsI {
16
+ defaultValue: BizUserConditionT.Conditions;
17
+ onChange: (value: any[]) => void;
18
+ andConditionNum?: number;
19
+ orConditionNum?: number;
20
+ eventAttrNum?: number;
21
+ }
22
+ interface AttrCondition {
23
+ attrId: number;
24
+ attrName: string;
25
+ operator: 'is not null' | 'is null' | 'not contains' | 'contains' | 'equal' | 'not equal' | 'begin with' | 'not begin with' | 'end with' | 'not end with';
26
+ params: string[];
27
+ attrType: 'cont-string' | 'cont-num' | 'cont-date';
28
+ category: 'fixed' | 'custom';
29
+ propCategory?: string;
30
+ }
31
+ interface EventCondition {
32
+ attrs: AttrCondition[];
33
+ runTimes: RunTimesI;
34
+ runPeriod: RunPeriodI;
35
+ eventId: number;
36
+ }
37
+ interface AddCondition {
38
+ eventId: '-3';
39
+ attrs: [];
40
+ runPeriod: RunPeriodI;
41
+ runTimes: RunTimesI;
42
+ }
43
+ interface ActiveCondition {
44
+ eventId: '-4';
45
+ attrs: [];
46
+ runPeriod: RunPeriodI;
47
+ runTimes: RunTimesI;
48
+ }
49
+ interface PropCondition {
50
+ attrs: AttrCondition[];
51
+ eventId: undefined;
52
+ }
53
+ type Condition = EventCondition | AddCondition | ActiveCondition | PropCondition;
54
+ type Conditions = Condition[][];
55
+ interface ShowItemI {
56
+ id: number;
57
+ orConditions: Conditions[number];
58
+ }
59
+ type ShowListT = ShowItemI[];
60
+ }
61
+ export declare namespace OrConditionsT {
62
+ interface PropI {
63
+ onChange: (value: any[]) => void;
64
+ orConditions: BizUserConditionT.Conditions[number];
65
+ }
66
+ interface ShowItemI {
67
+ id: number;
68
+ condition: BizUserConditionT.Conditions[number][number];
69
+ }
70
+ type ShowListT = ShowItemI[];
71
+ }
72
+ export declare namespace RunTimesConditionTypes {
73
+ type Options = {
74
+ text: string;
75
+ value: RunTimesI extends {
76
+ operator: infer U;
77
+ } ? U : never;
78
+ }[];
79
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { BizUserConditionT } from './types';
2
+ export declare function buildCondition(type: BizUserConditionT.ConditionType): BizUserConditionT.EventCondition | BizUserConditionT.AddCondition | BizUserConditionT.ActiveCondition | BizUserConditionT.PropCondition;
@@ -0,0 +1,54 @@
1
+ export function buildCondition(type) {
2
+ switch (type) {
3
+ case 'add':
4
+ var condition = {
5
+ eventId: '-3',
6
+ runPeriod: {
7
+ operator: 'relative',
8
+ values: ['30', '0']
9
+ },
10
+ runTimes: {
11
+ operator: '>=',
12
+ values: ['1']
13
+ },
14
+ attrs: []
15
+ };
16
+ return condition;
17
+
18
+ case 'active':
19
+ return {
20
+ eventId: '-4',
21
+ runPeriod: {
22
+ operator: 'relative',
23
+ values: ['30', '0']
24
+ },
25
+ runTimes: {
26
+ operator: '>=',
27
+ values: ['1']
28
+ },
29
+ attrs: []
30
+ };
31
+
32
+ case 'event':
33
+ return {
34
+ eventId: 0,
35
+ runTimes: {
36
+ operator: '>=',
37
+ values: ['1']
38
+ },
39
+ attrs: [],
40
+ runPeriod: {
41
+ operator: 'relative',
42
+ values: ['30', '0']
43
+ }
44
+ };
45
+
46
+ case 'prop':
47
+ return {
48
+ eventId: undefined,
49
+ attrs: [{
50
+ attrId: 0
51
+ }]
52
+ };
53
+ }
54
+ }
@@ -18,10 +18,8 @@ import { Skeleton } from 'antd';
18
18
 
19
19
  var BizUserGroup = function BizUserGroup(props) {
20
20
  var enableDelete = props.enableDelete,
21
- _props$keyField = props.keyField,
22
- keyField = _props$keyField === void 0 ? 'id' : _props$keyField,
23
- _props$labelField = props.labelField,
24
- labelField = _props$labelField === void 0 ? 'name' : _props$labelField;
21
+ keyField = props.keyField,
22
+ labelField = props.labelField;
25
23
 
26
24
  var _useState = useState(),
27
25
  _useState2 = _slicedToArray(_useState, 2),
@@ -80,4 +78,8 @@ var BizUserGroup = function BizUserGroup(props) {
80
78
  })));
81
79
  };
82
80
 
81
+ BizUserGroup.defaultProps = {
82
+ keyField: 'id',
83
+ labelField: 'name'
84
+ };
83
85
  export default BizUserGroup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.1-beta.0",
3
+ "version": "1.0.3-beta.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -58,5 +58,5 @@
58
58
  "prettier": "^2.2.1",
59
59
  "yorkie": "^2.0.0"
60
60
  },
61
- "gitHead": "559dc4dacce4682df696e0da5e8940f5949a8c9d"
61
+ "gitHead": "26072bd42bf1399d13c21c4bab91890d17580b9b"
62
62
  }