@gingkoo/pandora-metabase 1.0.0-alpha.2 → 1.0.0-alpha.21
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.
- package/README.md +20 -11
- package/lib/es/components/dialog/select-filter/index.d.ts +1 -0
- package/lib/es/components/dialog/select-join-column/index.d.ts +1 -0
- package/lib/es/components/modules/{group.d.ts → union.d.ts} +1 -1
- package/lib/es/components/popup.d.ts +8 -2
- package/lib/es/index.js +723 -270
- package/lib/es/index.js.map +1 -1
- package/lib/es/store/enum.d.ts +1 -1
- package/lib/es/store/types.d.ts +18 -19
- package/lib/es/types.d.ts +4 -2
- package/lib/es/utils/helper-dom.d.ts +4 -3
- package/lib/es/utils.d.ts +4 -1
- package/package.json +1 -1
package/lib/es/store/enum.d.ts
CHANGED
package/lib/es/store/types.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { DatasourceType } from '../types';
|
|
2
2
|
import { TypeEnum, SpecialType, JoinEnum, SQL_COLUMN_TYPE, SortEnum } from './enum';
|
|
3
|
-
export type ToolbarType = TypeEnum | 'filter' | 'summarize' | 'joinData' | 'permissionTable' | 'customColumn' | 'sort' | 'rowLimit' | '
|
|
3
|
+
export type ToolbarType = TypeEnum | 'filter' | 'summarize' | 'joinData' | 'permissionTable' | 'customColumn' | 'sort' | 'rowLimit' | 'union';
|
|
4
4
|
export type MetaListType = MetaData | MetaJoin | MetaCustom | MetaFilter | MetaSummarize | MetaSort | MetaLimit | MetaPermissionTable;
|
|
5
5
|
export type initColumnsType = MetaData_ColumnsType;
|
|
6
6
|
interface ExpressionsType {
|
|
7
7
|
operator: string;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
left_fieldAlias: string;
|
|
9
|
+
left_fieldUuid: string;
|
|
10
|
+
left_quotes: string;
|
|
10
11
|
left_string: string;
|
|
11
|
-
left_isString: boolean;
|
|
12
12
|
left_type: 'string' | 'constant' | 'field' | '' | null;
|
|
13
13
|
left_constant: string;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
right_fieldAlias: string;
|
|
15
|
+
right_fieldUuid: string;
|
|
16
|
+
right_quotes: string;
|
|
16
17
|
right_string: string;
|
|
17
18
|
right_type: 'string' | 'constant' | 'field' | '' | null;
|
|
18
19
|
right_constant: string;
|
|
19
|
-
right_isString: boolean;
|
|
20
20
|
}
|
|
21
21
|
export interface TableColumnsMapType {
|
|
22
22
|
[tableName: string]: initColumnsType[];
|
|
@@ -40,6 +40,7 @@ export interface MetaData_ColumnsType {
|
|
|
40
40
|
datasourceId: string;
|
|
41
41
|
datasourceName: string;
|
|
42
42
|
select: boolean;
|
|
43
|
+
summarizeType?: MetaSummarize_Enum;
|
|
43
44
|
}
|
|
44
45
|
export interface MetaData {
|
|
45
46
|
metaKey: number;
|
|
@@ -48,6 +49,8 @@ export interface MetaData {
|
|
|
48
49
|
type: TypeEnum.data;
|
|
49
50
|
table: MetaData_TableType;
|
|
50
51
|
columns: MetaData_ColumnsType[];
|
|
52
|
+
isSubquery?: boolean;
|
|
53
|
+
subquery?: MetaListType[];
|
|
51
54
|
}
|
|
52
55
|
export interface MetaJoin_TalbeType {
|
|
53
56
|
name: string;
|
|
@@ -56,10 +59,12 @@ export interface MetaJoin_TalbeType {
|
|
|
56
59
|
alias: string;
|
|
57
60
|
datasourceName: string;
|
|
58
61
|
datasourceId: string;
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
column_id?: string;
|
|
63
|
+
column?: string;
|
|
64
|
+
fieldAlias: string;
|
|
65
|
+
fieldUuid: string;
|
|
61
66
|
groupSql?: string;
|
|
62
|
-
|
|
67
|
+
quotes?: string;
|
|
63
68
|
}
|
|
64
69
|
export interface MetaJoin {
|
|
65
70
|
metaKey: number;
|
|
@@ -72,11 +77,10 @@ export interface MetaJoin {
|
|
|
72
77
|
columns: MetaData_ColumnsType[];
|
|
73
78
|
expressions: ExpressionsType[];
|
|
74
79
|
isSubquery?: boolean;
|
|
75
|
-
subquery?:
|
|
80
|
+
subquery?: MetaListType[];
|
|
76
81
|
}
|
|
77
82
|
export interface MetaCustom_Item {
|
|
78
83
|
name: string;
|
|
79
|
-
formula: string;
|
|
80
84
|
type?: string;
|
|
81
85
|
formulaList?: any[];
|
|
82
86
|
}
|
|
@@ -112,9 +116,9 @@ export interface MetaFilter_Item {
|
|
|
112
116
|
isField?: boolean;
|
|
113
117
|
valType?: 'field' | 'string' | 'constant' | '';
|
|
114
118
|
constantName?: string;
|
|
115
|
-
table2?:
|
|
119
|
+
table2?: MetaJoin_TalbeType | null;
|
|
116
120
|
formula?: Filter_Formula;
|
|
117
|
-
subquery?:
|
|
121
|
+
subquery?: MetaListType[];
|
|
118
122
|
type?: Filter_TypeEnum;
|
|
119
123
|
summarizeType?: MetaSummarize_Enum;
|
|
120
124
|
sql?: string;
|
|
@@ -146,8 +150,6 @@ export interface MetaSummarize_Group {
|
|
|
146
150
|
quotes: string;
|
|
147
151
|
datasourceId: string;
|
|
148
152
|
datasourceName: string;
|
|
149
|
-
column: string;
|
|
150
|
-
column_id: string;
|
|
151
153
|
summarizeType: MetaSummarize_Enum;
|
|
152
154
|
[params: string]: any;
|
|
153
155
|
}
|
|
@@ -162,8 +164,6 @@ export interface MetaSummarize_By {
|
|
|
162
164
|
id: string;
|
|
163
165
|
datasourceId: string;
|
|
164
166
|
datasourceName: string;
|
|
165
|
-
column: string;
|
|
166
|
-
column_id: string;
|
|
167
167
|
realName?: string;
|
|
168
168
|
sql: string;
|
|
169
169
|
database_type: SQL_COLUMN_TYPE | '';
|
|
@@ -216,7 +216,6 @@ export interface LooseObject {
|
|
|
216
216
|
}
|
|
217
217
|
interface ParamsCustomColumns {
|
|
218
218
|
alias: string;
|
|
219
|
-
formula: string;
|
|
220
219
|
}
|
|
221
220
|
interface ParamsJoinTables {
|
|
222
221
|
alias: string;
|
package/lib/es/types.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import type { MetaListType, ToolbarType } from './store/types';
|
|
|
2
2
|
import { UnionEnum } from './store/enum';
|
|
3
3
|
export interface MetaListProps {
|
|
4
4
|
name: string;
|
|
5
|
-
type: 'group' | '
|
|
6
|
-
|
|
5
|
+
type: 'group' | 'union';
|
|
6
|
+
union?: UnionEnum;
|
|
7
|
+
subquery?: MetaListType[];
|
|
7
8
|
list: MetaListType[];
|
|
8
9
|
}
|
|
9
10
|
export interface MetabaseProps {
|
|
@@ -26,6 +27,7 @@ export interface MetabaseProps {
|
|
|
26
27
|
showSubquery?: boolean;
|
|
27
28
|
subShowSubquery?: boolean;
|
|
28
29
|
constantList?: OptionItem[];
|
|
30
|
+
notExistsToolbar?: ToolbarType[];
|
|
29
31
|
}
|
|
30
32
|
export interface OptionItem {
|
|
31
33
|
value?: string;
|
|
@@ -2,9 +2,10 @@ export declare const getComputedTranslate: (obj: any) => {
|
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
};
|
|
5
|
-
export declare const getElementTop: (elem
|
|
6
|
-
export declare const getElementLeft: (elem
|
|
7
|
-
export declare const
|
|
5
|
+
export declare const getElementTop: (elem?: HTMLElement) => number;
|
|
6
|
+
export declare const getElementLeft: (elem?: HTMLElement) => number;
|
|
7
|
+
export declare const getContainerVisibleHeight: (container?: HTMLElement) => number;
|
|
8
|
+
export declare const getScrollTop: (elem?: HTMLElement) => number;
|
|
8
9
|
export declare const getWindowSize: () => {
|
|
9
10
|
width: number;
|
|
10
11
|
height: number;
|
package/lib/es/utils.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ interface HelperResultType {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const getHelper: (list: MetaListType[], item: MetaListType) => HelperResultType;
|
|
16
16
|
export declare const getSubColumns: (metaList: any) => DataType[];
|
|
17
|
-
export declare const changeTableAlias: (list: MetaListType[], curObj: MetaData_TableType) => MetaListType[];
|
|
17
|
+
export declare const changeTableAlias: (list: MetaListType[] | [], curObj: MetaData_TableType) => [] | MetaListType[];
|
|
18
18
|
export declare const changeFieldAlias: (list: MetaListType[], curObj: MetaData_ColumnsType) => MetaListType[];
|
|
19
|
+
export declare function splitByUnion(data: any): any[];
|
|
20
|
+
export declare function reassembleByUnion(target?: any[]): any[];
|
|
21
|
+
export declare const buildSqlQuery: (data?: MetaListType[]) => string;
|
|
19
22
|
export {};
|