@gingkoo/pandora-metabase 1.0.22 → 1.0.24

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/lib/cjs/components/dialog/custom-editor/index.js +2 -2
  2. package/lib/cjs/components/dialog/expression/index.js +1 -1
  3. package/lib/cjs/components/dialog/formula/index.d.ts +10 -0
  4. package/lib/cjs/components/dialog/formula/index.js +242 -0
  5. package/lib/cjs/components/dialog/formula/index.less +81 -0
  6. package/lib/cjs/components/dialog/formula/utils.d.ts +7 -0
  7. package/lib/cjs/components/dialog/formula/utils.js +45 -0
  8. package/lib/cjs/components/dialog/formula-list/index.d.ts +2 -2
  9. package/lib/cjs/components/dialog/formula-list/index.js +87 -29
  10. package/lib/cjs/components/dialog/formula-list/utils.d.ts +14 -1
  11. package/lib/cjs/components/dialog/formula-list/utils.js +159 -2
  12. package/lib/cjs/components/metabase/index.less +1 -0
  13. package/lib/cjs/components/modules/enum/filter-enum.d.ts +7 -2
  14. package/lib/cjs/components/modules/enum/filter-enum.js +8 -2
  15. package/lib/cjs/components/modules/join-data.js +27 -2
  16. package/lib/cjs/hooks/patch.js +81 -79
  17. package/lib/cjs/hooks/use-state.js +33 -27
  18. package/lib/cjs/index.js +3 -1
  19. package/lib/cjs/locale/en.js +4 -2
  20. package/lib/cjs/locale/zh.js +4 -2
  21. package/lib/cjs/store/helper.d.ts +1 -2
  22. package/lib/cjs/store/helper.js +1 -76
  23. package/lib/cjs/store/types.d.ts +36 -2
  24. package/lib/cjs/store/types.js +3 -0
  25. package/lib/cjs/types.d.ts +2 -1
  26. package/lib/cjs/utils.js +2 -1
  27. package/lib/es/components/dialog/custom-editor/index.js +2 -2
  28. package/lib/es/components/dialog/expression/index.js +1 -1
  29. package/lib/es/components/dialog/formula/index.d.ts +10 -0
  30. package/lib/es/components/dialog/formula/index.js +236 -0
  31. package/lib/es/components/dialog/formula/index.less +81 -0
  32. package/lib/es/components/dialog/formula/utils.d.ts +7 -0
  33. package/lib/es/components/dialog/formula/utils.js +37 -0
  34. package/lib/es/components/dialog/formula-list/index.d.ts +2 -2
  35. package/lib/es/components/dialog/formula-list/index.js +84 -26
  36. package/lib/es/components/dialog/formula-list/utils.d.ts +14 -1
  37. package/lib/es/components/dialog/formula-list/utils.js +160 -2
  38. package/lib/es/components/metabase/index.less +1 -0
  39. package/lib/es/components/modules/enum/filter-enum.d.ts +7 -2
  40. package/lib/es/components/modules/enum/filter-enum.js +8 -2
  41. package/lib/es/components/modules/join-data.js +27 -2
  42. package/lib/es/hooks/patch.js +81 -79
  43. package/lib/es/hooks/use-state.js +33 -27
  44. package/lib/es/index.js +3 -1
  45. package/lib/es/locale/en.js +4 -2
  46. package/lib/es/locale/zh.js +4 -2
  47. package/lib/es/store/helper.d.ts +1 -2
  48. package/lib/es/store/helper.js +0 -75
  49. package/lib/es/store/types.d.ts +36 -2
  50. package/lib/es/store/types.js +3 -0
  51. package/lib/es/types.d.ts +2 -1
  52. package/lib/es/types.js +18 -1
  53. package/lib/es/utils.js +2 -1
  54. package/package.json +1 -1
  55. package/lib/cjs/components/dialog/formula-list/enum.d.ts +0 -39
  56. package/lib/cjs/components/dialog/formula-list/enum.js +0 -123
  57. package/lib/es/components/dialog/formula-list/enum.d.ts +0 -39
  58. package/lib/es/components/dialog/formula-list/enum.js +0 -117
@@ -1,123 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.operatorList = exports.customTypes = exports.FunctionEnum = void 0;
7
- var _locale = require("../../../locale");
8
- var _types = require("../../../store/types");
9
- // export enum OptionsTypeEnum {
10
- // // CONSTANT = 'constant', // 常量
11
- // NOT_EXISTS = 'notExists', // 输入框
12
- // INPUT = 'input', // 输入框
13
- // FIELD = 'field', // 字段
14
- // OPERATOR = 'operator', // 运算符
15
- // EXPRESSION = 'expression', // 公式
16
- // OTHER = 'other', // 其他
17
- // }
18
- var FunctionEnum;
19
- (function (FunctionEnum) {
20
- FunctionEnum["LOWER"] = "lower";
21
- FunctionEnum["UPPER"] = "upper";
22
- FunctionEnum["SUBSTRING"] = "substring";
23
- FunctionEnum["REGEX_MATCH_FIRST"] = "regex-match-first";
24
- FunctionEnum["CONCAT"] = "concat";
25
- FunctionEnum["REPLACE"] = "replace";
26
- FunctionEnum["TRIM"] = "trim";
27
- FunctionEnum["RTRIM"] = "RTRIM";
28
- FunctionEnum["LTRIM"] = "rtrim";
29
- FunctionEnum["LENGTH"] = "length";
30
- // NUMBER
31
- FunctionEnum["ABS"] = "abs";
32
- FunctionEnum["FLOOR"] = "floor";
33
- FunctionEnum["CEIL"] = "ceil";
34
- FunctionEnum["ROUND"] = "round";
35
- FunctionEnum["SQRT"] = "sqrt";
36
- FunctionEnum["POWER"] = "power";
37
- FunctionEnum["LOG"] = "log";
38
- FunctionEnum["EXP"] = "exp";
39
- // BOOLEAN
40
- FunctionEnum["CONTAINS"] = "contains";
41
- FunctionEnum["ENDS_WITH"] = "ends-with";
42
- FunctionEnum["STARTS_WITH"] = "starts-with";
43
- FunctionEnum["BETWEEN"] = "between";
44
- FunctionEnum["TIME_INTERVAL"] = "time-interval";
45
- FunctionEnum["IS_NULL"] = "is-null";
46
- FunctionEnum["IS_EMPTY"] = "is-empty";
47
- // OTHER
48
- FunctionEnum["COALESCE"] = "coalesce";
49
- })(FunctionEnum || (exports.FunctionEnum = FunctionEnum = {}));
50
- var operatorList = exports.operatorList = ['and', 'or', '(', ')', ',', '+', '-', '*', '/', '!=', '<=', '>=', '<', '>', '=', 'case', 'when', 'then', 'else', 'end', 'DESC', 'ASC', 'OVER', 'PARTITION BY', 'ORDER BY', 'RANK()', 'DENSE_RANK()', 'ROW_NUMBER()'];
51
- // export const otherList = [
52
- // 'case',
53
- // 'when',
54
- // 'then',
55
- // 'else',
56
- // 'end',
57
- // 'RANK()',
58
- // 'DENSE_RANK()',
59
- // 'ROW_NUMBER()',
60
- // ];
61
- // export const functionList = [
62
- // 'lower',
63
- // 'upper',
64
- // 'substring',
65
- // 'regex-match-first',
66
- // 'concat',
67
- // 'replace',
68
- // 'trim',
69
- // 'rtrim',
70
- // 'ltrim',
71
- // 'length',
72
- // // number
73
- // 'abs',
74
- // 'floor',
75
- // 'ceil',
76
- // 'round',
77
- // 'sqrt',
78
- // 'power',
79
- // 'log',
80
- // 'exp',
81
- // // boolean
82
- // 'contains',
83
- // 'ends-with',
84
- // 'starts-with',
85
- // 'between',
86
- // 'time-interval',
87
- // 'is-null',
88
- // 'is-empty',
89
- // // other
90
- // 'coalesce',
91
- // ];
92
- var customTypes = exports.customTypes = [
93
- // 字段
94
- {
95
- value: _types.AtomsTypeEnum.FIELD,
96
- label: (0, _locale.__)('customColumn.field')
97
- },
98
- // 表达式
99
- {
100
- value: _types.AtomsTypeEnum.EXPRESSION,
101
- label: (0, _locale.__)('customColumn.expression')
102
- },
103
- // 输入框
104
- {
105
- value: _types.AtomsTypeEnum.INPUT_STRING,
106
- label: (0, _locale.__)('SqlQueryBuilder.input')
107
- },
108
- // 数字输入框
109
- {
110
- value: _types.AtomsTypeEnum.INPUT_NUMBER,
111
- label: (0, _locale.__)('SqlQueryBuilder.numberInput')
112
- },
113
- // 数字输入框
114
- {
115
- value: _types.AtomsTypeEnum.CONSTANT,
116
- label: (0, _locale.__)('customColumn.constant')
117
- },
118
- // 连接符
119
- {
120
- value: _types.AtomsTypeEnum.OPERATOR,
121
- label: (0, _locale.__)('customColumn.operator'),
122
- children: operatorList
123
- }];
@@ -1,39 +0,0 @@
1
- import { AtomsTypeEnum } from '../../../store/types';
2
- export declare enum FunctionEnum {
3
- LOWER = "lower",
4
- UPPER = "upper",
5
- SUBSTRING = "substring",
6
- REGEX_MATCH_FIRST = "regex-match-first",
7
- 'CONCAT' = "concat",
8
- 'REPLACE' = "replace",
9
- 'TRIM' = "trim",
10
- 'RTRIM' = "RTRIM",
11
- 'LTRIM' = "rtrim",
12
- 'LENGTH' = "length",
13
- 'ABS' = "abs",
14
- 'FLOOR' = "floor",
15
- 'CEIL' = "ceil",
16
- 'ROUND' = "round",
17
- 'SQRT' = "sqrt",
18
- 'POWER' = "power",
19
- 'LOG' = "log",
20
- 'EXP' = "exp",
21
- 'CONTAINS' = "contains",
22
- 'ENDS_WITH' = "ends-with",
23
- 'STARTS_WITH' = "starts-with",
24
- 'BETWEEN' = "between",
25
- 'TIME_INTERVAL' = "time-interval",
26
- 'IS_NULL' = "is-null",
27
- 'IS_EMPTY' = "is-empty",
28
- 'COALESCE' = "coalesce"
29
- }
30
- export declare const operatorList: string[];
31
- export declare const customTypes: ({
32
- value: AtomsTypeEnum;
33
- label: any;
34
- children?: undefined;
35
- } | {
36
- value: AtomsTypeEnum;
37
- label: any;
38
- children: string[];
39
- })[];
@@ -1,117 +0,0 @@
1
- import { __ } from '../../../locale';
2
- import { AtomsTypeEnum } from '../../../store/types';
3
- // export enum OptionsTypeEnum {
4
- // // CONSTANT = 'constant', // 常量
5
- // NOT_EXISTS = 'notExists', // 输入框
6
- // INPUT = 'input', // 输入框
7
- // FIELD = 'field', // 字段
8
- // OPERATOR = 'operator', // 运算符
9
- // EXPRESSION = 'expression', // 公式
10
- // OTHER = 'other', // 其他
11
- // }
12
- export var FunctionEnum;
13
- (function (FunctionEnum) {
14
- FunctionEnum["LOWER"] = "lower";
15
- FunctionEnum["UPPER"] = "upper";
16
- FunctionEnum["SUBSTRING"] = "substring";
17
- FunctionEnum["REGEX_MATCH_FIRST"] = "regex-match-first";
18
- FunctionEnum["CONCAT"] = "concat";
19
- FunctionEnum["REPLACE"] = "replace";
20
- FunctionEnum["TRIM"] = "trim";
21
- FunctionEnum["RTRIM"] = "RTRIM";
22
- FunctionEnum["LTRIM"] = "rtrim";
23
- FunctionEnum["LENGTH"] = "length";
24
- // NUMBER
25
- FunctionEnum["ABS"] = "abs";
26
- FunctionEnum["FLOOR"] = "floor";
27
- FunctionEnum["CEIL"] = "ceil";
28
- FunctionEnum["ROUND"] = "round";
29
- FunctionEnum["SQRT"] = "sqrt";
30
- FunctionEnum["POWER"] = "power";
31
- FunctionEnum["LOG"] = "log";
32
- FunctionEnum["EXP"] = "exp";
33
- // BOOLEAN
34
- FunctionEnum["CONTAINS"] = "contains";
35
- FunctionEnum["ENDS_WITH"] = "ends-with";
36
- FunctionEnum["STARTS_WITH"] = "starts-with";
37
- FunctionEnum["BETWEEN"] = "between";
38
- FunctionEnum["TIME_INTERVAL"] = "time-interval";
39
- FunctionEnum["IS_NULL"] = "is-null";
40
- FunctionEnum["IS_EMPTY"] = "is-empty";
41
- // OTHER
42
- FunctionEnum["COALESCE"] = "coalesce";
43
- })(FunctionEnum || (FunctionEnum = {}));
44
- export var operatorList = ['and', 'or', '(', ')', ',', '+', '-', '*', '/', '!=', '<=', '>=', '<', '>', '=', 'case', 'when', 'then', 'else', 'end', 'DESC', 'ASC', 'OVER', 'PARTITION BY', 'ORDER BY', 'RANK()', 'DENSE_RANK()', 'ROW_NUMBER()'];
45
- // export const otherList = [
46
- // 'case',
47
- // 'when',
48
- // 'then',
49
- // 'else',
50
- // 'end',
51
- // 'RANK()',
52
- // 'DENSE_RANK()',
53
- // 'ROW_NUMBER()',
54
- // ];
55
- // export const functionList = [
56
- // 'lower',
57
- // 'upper',
58
- // 'substring',
59
- // 'regex-match-first',
60
- // 'concat',
61
- // 'replace',
62
- // 'trim',
63
- // 'rtrim',
64
- // 'ltrim',
65
- // 'length',
66
- // // number
67
- // 'abs',
68
- // 'floor',
69
- // 'ceil',
70
- // 'round',
71
- // 'sqrt',
72
- // 'power',
73
- // 'log',
74
- // 'exp',
75
- // // boolean
76
- // 'contains',
77
- // 'ends-with',
78
- // 'starts-with',
79
- // 'between',
80
- // 'time-interval',
81
- // 'is-null',
82
- // 'is-empty',
83
- // // other
84
- // 'coalesce',
85
- // ];
86
- export var customTypes = [
87
- // 字段
88
- {
89
- value: AtomsTypeEnum.FIELD,
90
- label: __('customColumn.field')
91
- },
92
- // 表达式
93
- {
94
- value: AtomsTypeEnum.EXPRESSION,
95
- label: __('customColumn.expression')
96
- },
97
- // 输入框
98
- {
99
- value: AtomsTypeEnum.INPUT_STRING,
100
- label: __('SqlQueryBuilder.input')
101
- },
102
- // 数字输入框
103
- {
104
- value: AtomsTypeEnum.INPUT_NUMBER,
105
- label: __('SqlQueryBuilder.numberInput')
106
- },
107
- // 数字输入框
108
- {
109
- value: AtomsTypeEnum.CONSTANT,
110
- label: __('customColumn.constant')
111
- },
112
- // 连接符
113
- {
114
- value: AtomsTypeEnum.OPERATOR,
115
- label: __('customColumn.operator'),
116
- children: operatorList
117
- }];