@gingkoo/pandora-metabase 1.0.0-alpha.27 → 1.0.0-alpha.28
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/lib/es/common/Loading/index.d.ts +6 -0
- package/lib/es/common/Portal/index.d.ts +8 -0
- package/lib/es/common/SplitView/index.d.ts +17 -0
- package/lib/es/components/dialog/const.d.ts +4 -0
- package/lib/es/components/dialog/custom-column/config.d.ts +352 -0
- package/lib/es/components/dialog/custom-column/dialog/function-tip.d.ts +7 -0
- package/lib/es/components/dialog/custom-column/dialog/select-list.d.ts +14 -0
- package/lib/es/components/dialog/custom-column/expression-editor.d.ts +9 -0
- package/lib/es/components/dialog/custom-column/expressions/suggest.d.ts +69 -0
- package/lib/es/components/dialog/custom-column/expressions/tokenizer.d.ts +36 -0
- package/lib/es/components/dialog/custom-column/index.d.ts +10 -0
- package/lib/es/components/dialog/custom-column/keyboard.d.ts +11 -0
- package/lib/es/components/dialog/custom-column/tokenized-expression.d.ts +10 -0
- package/lib/es/components/dialog/custom-column/tokenizedI-input.d.ts +16 -0
- package/lib/es/components/dialog/custom-editor/enum.d.ts +43 -0
- package/lib/es/components/dialog/custom-editor/index.d.ts +10 -0
- package/lib/es/components/dialog/custom-editor/utils.d.ts +8 -0
- package/lib/es/components/dialog/index.d.ts +8 -0
- package/lib/es/components/dialog/select-column/index.d.ts +15 -0
- package/lib/es/components/dialog/select-filter/index.d.ts +16 -0
- package/lib/es/components/dialog/select-join/index.d.ts +13 -0
- package/lib/es/components/dialog/select-join-column/index.d.ts +56 -0
- package/lib/es/components/dialog/select-list/index.d.ts +10 -0
- package/lib/es/components/dialog/select-permission-table/index.d.ts +15 -0
- package/lib/es/components/dialog/select-summarize/index.d.ts +17 -0
- package/lib/es/components/dialog/select-table/index.d.ts +17 -0
- package/lib/es/components/icons.d.ts +35 -0
- package/lib/es/components/metabase/index.d.ts +4 -0
- package/lib/es/components/modules/components/Wrapper.d.ts +7 -0
- package/lib/es/components/modules/components/header.d.ts +7 -0
- package/lib/es/components/modules/components/meta-icon.d.ts +7 -0
- package/lib/es/components/modules/custom-column.d.ts +8 -0
- package/lib/es/components/modules/filter.d.ts +7 -0
- package/lib/es/components/modules/index.d.ts +4 -0
- package/lib/es/components/modules/join-data.d.ts +7 -0
- package/lib/es/components/modules/permission-table.d.ts +7 -0
- package/lib/es/components/modules/row-limit.d.ts +7 -0
- package/lib/es/components/modules/sort.d.ts +7 -0
- package/lib/es/components/modules/summarize/group-by.d.ts +12 -0
- package/lib/es/components/modules/summarize/index.d.ts +8 -0
- package/lib/es/components/modules/summarize/select-index.d.ts +8 -0
- package/lib/es/components/modules/table-data.d.ts +7 -0
- package/lib/es/components/modules/union.d.ts +9 -0
- package/lib/es/components/popup.d.ts +104 -0
- package/lib/es/constants/enum.d.ts +15 -0
- package/lib/es/constants/index.d.ts +1 -0
- package/lib/es/constants/storageKey.d.ts +1 -0
- package/lib/es/css.d.ts +10 -0
- package/lib/es/hooks/use-provider.d.ts +11 -0
- package/lib/es/hooks/use-state.d.ts +7 -0
- package/lib/es/hooks/winsize.d.ts +4 -0
- package/lib/es/index.d.ts +15 -0
- package/lib/es/index.js +9233 -0
- package/lib/es/index.js.map +1 -0
- package/lib/es/locale/en.d.ts +2 -0
- package/lib/es/locale/index.d.ts +3 -0
- package/lib/es/locale/zh.d.ts +2 -0
- package/lib/es/sql-formula.d.ts +19 -0
- package/lib/es/store/enum.d.ts +56 -0
- package/lib/es/store/helper.d.ts +10 -0
- package/lib/es/store/types.d.ts +298 -0
- package/lib/es/types.d.ts +45 -0
- package/lib/es/utils/cookies.d.ts +1 -0
- package/lib/es/utils/event.d.ts +20 -0
- package/lib/es/utils/helper-dom.d.ts +13 -0
- package/lib/es/utils/helper.d.ts +17 -0
- package/lib/es/utils/keydown.d.ts +21 -0
- package/lib/es/utils/platform.d.ts +12 -0
- package/lib/es/utils/selection.d.ts +7 -0
- package/lib/es/utils/storage.d.ts +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ParameterType {
|
|
2
|
+
key: string;
|
|
3
|
+
explain: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FunctionInfoType {
|
|
6
|
+
tip: string;
|
|
7
|
+
name: string;
|
|
8
|
+
desc: string;
|
|
9
|
+
case: string;
|
|
10
|
+
parameter: ParameterType[];
|
|
11
|
+
}
|
|
12
|
+
export interface FunctionsType {
|
|
13
|
+
[name: string]: FunctionInfoType;
|
|
14
|
+
}
|
|
15
|
+
export declare const functions: FunctionsType;
|
|
16
|
+
declare const _default: {
|
|
17
|
+
getFuncInfo(name: string): FunctionInfoType | null;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare enum SortEnum {
|
|
2
|
+
desc = "DESC",
|
|
3
|
+
asc = "ASC"
|
|
4
|
+
}
|
|
5
|
+
export declare enum TypeEnum {
|
|
6
|
+
data = "data",
|
|
7
|
+
joinData = "joinData",
|
|
8
|
+
permissionTable = "permissionTable",// 权限表
|
|
9
|
+
customColumn = "customColumn",
|
|
10
|
+
filter = "filter",
|
|
11
|
+
summarize = "summarize",
|
|
12
|
+
sort = "sort",
|
|
13
|
+
rowLimit = "rowLimit",
|
|
14
|
+
union = "union"
|
|
15
|
+
}
|
|
16
|
+
export declare enum JoinEnum {
|
|
17
|
+
left = "LEFT JOIN",
|
|
18
|
+
right = "RIGHT JOIN",
|
|
19
|
+
inner = "INNER JOIN"
|
|
20
|
+
}
|
|
21
|
+
export declare enum UnionEnum {
|
|
22
|
+
union = "UNION",
|
|
23
|
+
unionAll = "UNION ALL"
|
|
24
|
+
}
|
|
25
|
+
export declare enum ColumnsPopupThemeEnum {
|
|
26
|
+
skyBlue = "skyBlue",
|
|
27
|
+
greenGrass = "greenGrass",
|
|
28
|
+
purple = "purple"
|
|
29
|
+
}
|
|
30
|
+
export declare enum SpecialType {
|
|
31
|
+
PK = "pk",
|
|
32
|
+
FK = "fk"
|
|
33
|
+
}
|
|
34
|
+
export declare enum SQL_COLUMN_TYPE {
|
|
35
|
+
STRING = "STRING",
|
|
36
|
+
DATE = "DATE",
|
|
37
|
+
FLOAT = "FLOAT",
|
|
38
|
+
LONG = "LONG",
|
|
39
|
+
CURRENCY = "CURRENCY"
|
|
40
|
+
}
|
|
41
|
+
export declare enum SQL_GROUP_TYPE {
|
|
42
|
+
NUMBER = "number",
|
|
43
|
+
STRING = "string",
|
|
44
|
+
DATE = "date"
|
|
45
|
+
}
|
|
46
|
+
export declare enum DataTypeEnum {
|
|
47
|
+
float = "float",// 小数
|
|
48
|
+
string = "string",// 字符
|
|
49
|
+
date = "date",// 日期
|
|
50
|
+
long = "long",// 整数
|
|
51
|
+
currency = "currency"
|
|
52
|
+
}
|
|
53
|
+
export declare enum EleComponentEnum {
|
|
54
|
+
text = "text",// 文本框
|
|
55
|
+
select = "select"
|
|
56
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MetaListType, MetaFilter_Item, MetaSummarize_Group, ParamsStruct } from './types';
|
|
2
|
+
export declare const SummarizeAlias = "source";
|
|
3
|
+
export declare const filterToSql: (record: MetaFilter_Item) => string;
|
|
4
|
+
export declare const summarizeToSql: (arr: MetaSummarize_Group[], record: MetaSummarize_Group) => {
|
|
5
|
+
sql: string;
|
|
6
|
+
fieldAlias: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const handleSqlStruct: (list: MetaListType[]) => ParamsStruct;
|
|
9
|
+
export declare const compressionStructure: (data: MetaListType[]) => string;
|
|
10
|
+
export declare const restoreStructure: (data: string) => MetaListType[];
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import type { DatasourceType } from '../types';
|
|
2
|
+
import { TypeEnum, SpecialType, JoinEnum, SQL_COLUMN_TYPE, SortEnum } from './enum';
|
|
3
|
+
export type ToolbarType = TypeEnum | 'filter' | 'summarize' | 'joinData' | 'permissionTable' | 'customColumn' | 'sort' | 'rowLimit' | 'union';
|
|
4
|
+
export type MetaListType = MetaData | MetaJoin | MetaCustom | MetaFilter | MetaSummarize | MetaSort | MetaLimit | MetaPermissionTable;
|
|
5
|
+
export type initColumnsType = MetaData_ColumnsType;
|
|
6
|
+
interface ExpressionsType {
|
|
7
|
+
operator: string;
|
|
8
|
+
left_fieldAlias: string;
|
|
9
|
+
left_fieldUuid: string;
|
|
10
|
+
left_quotes: string;
|
|
11
|
+
left_string: string;
|
|
12
|
+
left_type: 'string' | 'constant' | 'field' | '' | null;
|
|
13
|
+
left_constant: string;
|
|
14
|
+
right_fieldAlias: string;
|
|
15
|
+
right_fieldUuid: string;
|
|
16
|
+
right_quotes: string;
|
|
17
|
+
right_string: string;
|
|
18
|
+
right_type: 'string' | 'constant' | 'field' | '' | null;
|
|
19
|
+
right_constant: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TableColumnsMapType {
|
|
22
|
+
[tableName: string]: initColumnsType[];
|
|
23
|
+
}
|
|
24
|
+
export interface TableType {
|
|
25
|
+
name: string;
|
|
26
|
+
id: string;
|
|
27
|
+
alias: string;
|
|
28
|
+
tableUuid: string;
|
|
29
|
+
}
|
|
30
|
+
export type MetaData_TableType = TableType & DatasourceType;
|
|
31
|
+
export interface MetaData_ColumnsType {
|
|
32
|
+
name: string;
|
|
33
|
+
id: string;
|
|
34
|
+
name_zh?: string;
|
|
35
|
+
fieldAlias: string;
|
|
36
|
+
fieldUuid: string;
|
|
37
|
+
realName?: string;
|
|
38
|
+
database_type: SQL_COLUMN_TYPE | '';
|
|
39
|
+
special_type: SpecialType | '';
|
|
40
|
+
datasourceId: string;
|
|
41
|
+
datasourceName: string;
|
|
42
|
+
select: boolean;
|
|
43
|
+
summarizeType?: MetaSummarize_Enum;
|
|
44
|
+
}
|
|
45
|
+
export interface MetaData {
|
|
46
|
+
metaKey: number;
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
hidden?: boolean;
|
|
49
|
+
type: TypeEnum.data;
|
|
50
|
+
table: MetaData_TableType;
|
|
51
|
+
columns: MetaData_ColumnsType[];
|
|
52
|
+
isSubquery?: boolean;
|
|
53
|
+
subquery?: MetaListType[];
|
|
54
|
+
}
|
|
55
|
+
export interface MetaJoin_TalbeType {
|
|
56
|
+
name: string;
|
|
57
|
+
id: string;
|
|
58
|
+
tableUuid: string;
|
|
59
|
+
alias: string;
|
|
60
|
+
datasourceName: string;
|
|
61
|
+
datasourceId: string;
|
|
62
|
+
column_id?: string;
|
|
63
|
+
column?: string;
|
|
64
|
+
fieldAlias: string;
|
|
65
|
+
fieldUuid: string;
|
|
66
|
+
groupSql?: string;
|
|
67
|
+
quotes?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface MetaJoin {
|
|
70
|
+
metaKey: number;
|
|
71
|
+
type: TypeEnum.joinData;
|
|
72
|
+
joinType: JoinEnum;
|
|
73
|
+
readonly?: boolean;
|
|
74
|
+
hidden?: boolean;
|
|
75
|
+
table1: MetaJoin_TalbeType;
|
|
76
|
+
table2: MetaJoin_TalbeType;
|
|
77
|
+
columns: MetaData_ColumnsType[];
|
|
78
|
+
expressions: ExpressionsType[];
|
|
79
|
+
isSubquery?: boolean;
|
|
80
|
+
subquery?: MetaListType[];
|
|
81
|
+
}
|
|
82
|
+
export interface MetaCustom_Item {
|
|
83
|
+
name: string;
|
|
84
|
+
type?: string;
|
|
85
|
+
formulaList?: any[];
|
|
86
|
+
}
|
|
87
|
+
export interface MetaCustom {
|
|
88
|
+
metaKey: number;
|
|
89
|
+
type: TypeEnum.customColumn;
|
|
90
|
+
customColumn: MetaCustom_Item[];
|
|
91
|
+
}
|
|
92
|
+
export interface Filter_Formula {
|
|
93
|
+
type?: string;
|
|
94
|
+
params?: string[] | number[];
|
|
95
|
+
}
|
|
96
|
+
export declare enum Filter_TypeEnum {
|
|
97
|
+
EXPRESSION = "expression",
|
|
98
|
+
NOT_EXISTS = "notExists"
|
|
99
|
+
}
|
|
100
|
+
export interface MetaFilter_Item {
|
|
101
|
+
table: string;
|
|
102
|
+
tableId: string;
|
|
103
|
+
tableUuid: string;
|
|
104
|
+
fieldUuid: string;
|
|
105
|
+
fieldAlias: string;
|
|
106
|
+
alias: string;
|
|
107
|
+
name: string;
|
|
108
|
+
id: string;
|
|
109
|
+
groupSql?: string;
|
|
110
|
+
database_type: SQL_COLUMN_TYPE | '';
|
|
111
|
+
val: string[];
|
|
112
|
+
condition: string;
|
|
113
|
+
quotes: string;
|
|
114
|
+
datasourceId: string;
|
|
115
|
+
datasourceName: string;
|
|
116
|
+
isField?: boolean;
|
|
117
|
+
valType?: 'field' | 'string' | 'constant' | '';
|
|
118
|
+
constantName?: string;
|
|
119
|
+
table2?: MetaJoin_TalbeType | null;
|
|
120
|
+
formula?: Filter_Formula;
|
|
121
|
+
subquery?: MetaListType[];
|
|
122
|
+
type?: Filter_TypeEnum;
|
|
123
|
+
summarizeType?: MetaSummarize_Enum;
|
|
124
|
+
sql?: string;
|
|
125
|
+
realName?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface MetaFilter {
|
|
128
|
+
metaKey: number;
|
|
129
|
+
type: TypeEnum.filter;
|
|
130
|
+
isPermanent?: boolean;
|
|
131
|
+
filter: MetaFilter_Item[];
|
|
132
|
+
}
|
|
133
|
+
export declare enum MetaSummarize_Enum {
|
|
134
|
+
GROUP = "group",
|
|
135
|
+
BY = "by"
|
|
136
|
+
}
|
|
137
|
+
export interface MetaSummarize_Group {
|
|
138
|
+
table: string;
|
|
139
|
+
tableId: string;
|
|
140
|
+
tableUuid: string;
|
|
141
|
+
alias?: string;
|
|
142
|
+
name: string;
|
|
143
|
+
id: string;
|
|
144
|
+
realName?: string;
|
|
145
|
+
database_type?: SQL_COLUMN_TYPE | '';
|
|
146
|
+
sql: string;
|
|
147
|
+
fieldAlias: string;
|
|
148
|
+
fieldUuid: string;
|
|
149
|
+
condition: string;
|
|
150
|
+
quotes: string;
|
|
151
|
+
datasourceId: string;
|
|
152
|
+
datasourceName: string;
|
|
153
|
+
summarizeType: MetaSummarize_Enum;
|
|
154
|
+
[params: string]: any;
|
|
155
|
+
}
|
|
156
|
+
export interface MetaSummarize_By {
|
|
157
|
+
table: string;
|
|
158
|
+
tableId: string;
|
|
159
|
+
tableUuid: string;
|
|
160
|
+
alias: string;
|
|
161
|
+
fieldAlias: string;
|
|
162
|
+
fieldUuid: string;
|
|
163
|
+
name: string;
|
|
164
|
+
id: string;
|
|
165
|
+
datasourceId: string;
|
|
166
|
+
datasourceName: string;
|
|
167
|
+
realName?: string;
|
|
168
|
+
sql: string;
|
|
169
|
+
database_type: SQL_COLUMN_TYPE | '';
|
|
170
|
+
condition: string;
|
|
171
|
+
quotes: string;
|
|
172
|
+
summarizeType: MetaSummarize_Enum;
|
|
173
|
+
}
|
|
174
|
+
export interface MetaSummarize {
|
|
175
|
+
metaKey: number;
|
|
176
|
+
type: TypeEnum.summarize;
|
|
177
|
+
alias: string;
|
|
178
|
+
tableUuid: string;
|
|
179
|
+
group: MetaSummarize_Group[];
|
|
180
|
+
by: MetaSummarize_By[];
|
|
181
|
+
}
|
|
182
|
+
export interface MetaSort_Item {
|
|
183
|
+
table: string;
|
|
184
|
+
tableId: string;
|
|
185
|
+
tableUuid: string;
|
|
186
|
+
alias: string;
|
|
187
|
+
name: string;
|
|
188
|
+
sql: string;
|
|
189
|
+
sort: SortEnum;
|
|
190
|
+
}
|
|
191
|
+
export interface MetaSort {
|
|
192
|
+
metaKey: number;
|
|
193
|
+
type: TypeEnum.sort;
|
|
194
|
+
sort: MetaSort_Item[];
|
|
195
|
+
}
|
|
196
|
+
export interface MetaLimit {
|
|
197
|
+
metaKey: number;
|
|
198
|
+
type: TypeEnum.rowLimit;
|
|
199
|
+
limit: string;
|
|
200
|
+
}
|
|
201
|
+
export interface MetaPermissionTable {
|
|
202
|
+
metaKey: number;
|
|
203
|
+
type: TypeEnum.permissionTable;
|
|
204
|
+
table: MetaData_TableType;
|
|
205
|
+
}
|
|
206
|
+
export interface LooseObject {
|
|
207
|
+
[TypeEnum.data]?: MetaData;
|
|
208
|
+
[TypeEnum.joinData]?: MetaJoin[];
|
|
209
|
+
[TypeEnum.permissionTable]?: MetaPermissionTable;
|
|
210
|
+
[TypeEnum.customColumn]?: MetaCustom;
|
|
211
|
+
[TypeEnum.filter]?: MetaFilter;
|
|
212
|
+
[TypeEnum.summarize]?: MetaSummarize;
|
|
213
|
+
[TypeEnum.sort]?: MetaSort;
|
|
214
|
+
[TypeEnum.rowLimit]?: MetaLimit;
|
|
215
|
+
children?: LooseObject;
|
|
216
|
+
}
|
|
217
|
+
interface ParamsCustomColumns {
|
|
218
|
+
alias: string;
|
|
219
|
+
}
|
|
220
|
+
interface ParamsJoinTables {
|
|
221
|
+
alias: string;
|
|
222
|
+
joinCondition: string;
|
|
223
|
+
joinType: string;
|
|
224
|
+
queryColumns: string[];
|
|
225
|
+
tableName: string;
|
|
226
|
+
datasourceId?: string;
|
|
227
|
+
}
|
|
228
|
+
export interface ParamsStruct {
|
|
229
|
+
alias?: string;
|
|
230
|
+
tableName?: string;
|
|
231
|
+
datasourceId?: string;
|
|
232
|
+
queryColumns?: string[];
|
|
233
|
+
customColumns?: ParamsCustomColumns[];
|
|
234
|
+
filters?: string;
|
|
235
|
+
groupBy?: {
|
|
236
|
+
calcColumns: string[];
|
|
237
|
+
groupColumns: string[];
|
|
238
|
+
};
|
|
239
|
+
joinTables?: ParamsJoinTables[];
|
|
240
|
+
limit?: number;
|
|
241
|
+
orderInfos?: string;
|
|
242
|
+
privilegeTable?: string;
|
|
243
|
+
hasInnerSql: boolean;
|
|
244
|
+
innerSqlStruct: ParamsStruct | null;
|
|
245
|
+
}
|
|
246
|
+
export interface ParamsType {
|
|
247
|
+
id: string;
|
|
248
|
+
code: string;
|
|
249
|
+
}
|
|
250
|
+
export interface PopupData {
|
|
251
|
+
visible: boolean;
|
|
252
|
+
node?: any;
|
|
253
|
+
content?: any;
|
|
254
|
+
}
|
|
255
|
+
export {};
|
|
256
|
+
/**
|
|
257
|
+
let a = {
|
|
258
|
+
"idxId": "string",
|
|
259
|
+
"sqlStruct": {
|
|
260
|
+
"alias": "string",// 主表别名 只有最外层可以没有
|
|
261
|
+
"tableName": "string",// 主表名 除了最内层 都可以没有
|
|
262
|
+
"queryColumns": [
|
|
263
|
+
"string"// 第一层放 主表选择的字段,其他的放 groupby 的两个字段别名
|
|
264
|
+
],
|
|
265
|
+
"groupBy": {// 聚合
|
|
266
|
+
"calcColumns": [// 左边
|
|
267
|
+
"string"
|
|
268
|
+
],
|
|
269
|
+
"groupColumns": [// 右边
|
|
270
|
+
"string"
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"customColumns": [// 自定义列
|
|
274
|
+
{
|
|
275
|
+
"alias": "string",
|
|
276
|
+
"formula": "string"
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"filters": "string",// filter 用 on 分隔
|
|
280
|
+
"hasInnerSql": false,// 是否有嵌套
|
|
281
|
+
"innerSqlStruct": {},// 嵌套内容
|
|
282
|
+
"joinTables": [// 关联
|
|
283
|
+
{
|
|
284
|
+
"alias": "string",
|
|
285
|
+
"joinCondition": "a.a = b.b",
|
|
286
|
+
"joinType": "string",
|
|
287
|
+
"queryColumns": [
|
|
288
|
+
"string"
|
|
289
|
+
],
|
|
290
|
+
"tableName": "string"
|
|
291
|
+
}
|
|
292
|
+
],
|
|
293
|
+
"limit": 0,
|
|
294
|
+
"orderInfos": "string",
|
|
295
|
+
|
|
296
|
+
},
|
|
297
|
+
}
|
|
298
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { MetaListType, ToolbarType } from './store/types';
|
|
2
|
+
import { UnionEnum } from './store/enum';
|
|
3
|
+
import { DataType } from './components/dialog/select-join-column';
|
|
4
|
+
export interface MetaListProps {
|
|
5
|
+
name: string;
|
|
6
|
+
type: 'group' | 'union';
|
|
7
|
+
union?: UnionEnum;
|
|
8
|
+
subquery?: MetaListType[];
|
|
9
|
+
list: MetaListType[];
|
|
10
|
+
}
|
|
11
|
+
export interface MetabaseProps {
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
btnText?: string;
|
|
14
|
+
showFields?: boolean;
|
|
15
|
+
readonly?: boolean;
|
|
16
|
+
getTables: (datasourceId: string) => Promise<any>;
|
|
17
|
+
getColumns: (table: {
|
|
18
|
+
name: string;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}, datasourceId: string) => Promise<any>;
|
|
21
|
+
toolbar?: ToolbarType[];
|
|
22
|
+
subToolbar?: ToolbarType[];
|
|
23
|
+
tableNameTpl?: string;
|
|
24
|
+
fieldNameTpl?: string;
|
|
25
|
+
onOk?: (params: any) => void;
|
|
26
|
+
value?: MetaListType[];
|
|
27
|
+
sourceList?: DatasourceType[];
|
|
28
|
+
showSubquery?: boolean;
|
|
29
|
+
subShowSubquery?: boolean;
|
|
30
|
+
constantList?: OptionItem[];
|
|
31
|
+
notExistsToolbar?: ToolbarType[];
|
|
32
|
+
notExistsColumns?: DataType[];
|
|
33
|
+
}
|
|
34
|
+
export interface OptionItem {
|
|
35
|
+
value?: string;
|
|
36
|
+
label: string;
|
|
37
|
+
icon?: React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
export interface DatasourceType {
|
|
40
|
+
datasourceId: string;
|
|
41
|
+
datasourceName: string;
|
|
42
|
+
}
|
|
43
|
+
export interface SqlVisionBuilderRef {
|
|
44
|
+
reset: () => void;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCookie(name: string): string | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type EventStackType = {
|
|
2
|
+
[propName: number]: Function;
|
|
3
|
+
};
|
|
4
|
+
interface ResetEvent {
|
|
5
|
+
eventStack: EventStackType;
|
|
6
|
+
funcId: number;
|
|
7
|
+
addEvent(a: Function, c: any): number;
|
|
8
|
+
removeEvent(a: number): void;
|
|
9
|
+
reset(): void;
|
|
10
|
+
}
|
|
11
|
+
declare class WinResetEvent implements ResetEvent {
|
|
12
|
+
eventStack: EventStackType;
|
|
13
|
+
funcId: number;
|
|
14
|
+
constructor();
|
|
15
|
+
addEvent(fn: Function, context?: any, delay?: number): number;
|
|
16
|
+
removeEvent(funcId: number): void;
|
|
17
|
+
reset(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const winResetEvent: WinResetEvent;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const getComputedTranslate: (obj: any) => {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
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;
|
|
9
|
+
export declare const getWindowSize: () => {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const getMaxZIndexInParents: (element: any) => number | "auto";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const throttle: (fn: Function, wait?: number) => Function;
|
|
2
|
+
export declare const debounce: (fn: Function, wait?: number) => () => void;
|
|
3
|
+
export type ScreenType = {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const getScreenInfo: () => ScreenType;
|
|
8
|
+
export declare const fullScreen: () => void;
|
|
9
|
+
export declare const exitFullscreen: () => void;
|
|
10
|
+
export declare const getUrlParams: () => any;
|
|
11
|
+
export declare const sleep: (wait?: number) => Promise<unknown>;
|
|
12
|
+
export declare const flatArray: (arr: any[]) => any[];
|
|
13
|
+
export declare const mobx2Object: (mobxObj: any, defaultType?: any) => any;
|
|
14
|
+
export declare const replaceTpl: (inputString: string, values: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}) => string;
|
|
17
|
+
export declare const uuidv4: (prefix?: string) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface SubscribeData {
|
|
2
|
+
type: KeydownEnum;
|
|
3
|
+
fn: Function;
|
|
4
|
+
}
|
|
5
|
+
interface FnsType {
|
|
6
|
+
[propsName: number]: SubscribeData;
|
|
7
|
+
}
|
|
8
|
+
export declare enum KeydownEnum {
|
|
9
|
+
save = "save",
|
|
10
|
+
entry = "entry"
|
|
11
|
+
}
|
|
12
|
+
declare class Keydown {
|
|
13
|
+
fns: FnsType;
|
|
14
|
+
constructor();
|
|
15
|
+
subscribe(data: SubscribeData): number;
|
|
16
|
+
remove(id: number): void;
|
|
17
|
+
handleEvent(type: KeydownEnum): void;
|
|
18
|
+
init(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const winKeydown: Keydown;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function getSelectionPosition(element: any): RangeType;
|
|
2
|
+
export declare function setSelectionPosition(element: any, [start, end]: RangeType): void;
|
|
3
|
+
export declare function getCaretPosition(element: any): number;
|
|
4
|
+
export declare function saveSelection(element: any): () => void;
|
|
5
|
+
export declare function setCaretPosition(element: any, position: number): void;
|
|
6
|
+
type RangeType = [number, number];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** 缓存方法集合 **/
|
|
2
|
+
export declare class Cache {
|
|
3
|
+
storage: any;
|
|
4
|
+
key: string;
|
|
5
|
+
constructor(storageKey: 'localStorage' | 'sessionStorage', key: string);
|
|
6
|
+
get(): string;
|
|
7
|
+
set(item: any): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
interface StorageType {
|
|
11
|
+
theme?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 便捷操作 localStorage & sessionStorage
|
|
15
|
+
* e.g.
|
|
16
|
+
* import storage from '@/utils/storage'
|
|
17
|
+
* storage.token =>> localStorage.getItem(APP_TOKEN)
|
|
18
|
+
* storage.token = 1 =>> localStorage.setItem(APP_TOKEN, 1)
|
|
19
|
+
* storage.token = '' =>> localStorage.clearItem(APP_TOKEN)
|
|
20
|
+
*/
|
|
21
|
+
declare const storage: StorageType;
|
|
22
|
+
export default storage;
|