@gingkoo/pandora-metabase 0.0.1-alpha.1 → 0.0.1-alpha.10
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 +110 -90
- package/lib/es/common/Loading/index.d.ts +6 -0
- package/lib/es/common/SplitView/index.d.ts +17 -0
- package/lib/es/{metaBase/components → components}/dialog/const.d.ts +1 -1
- package/lib/es/{metaBase/components → components}/dialog/custom-column/dialog/select-list.d.ts +0 -1
- package/lib/es/components/dialog/custom-column/expression-editor.d.ts +9 -0
- package/lib/es/{metaBase/components → components}/dialog/custom-column/expressions/suggest.d.ts +1 -1
- package/lib/es/{metaBase/components → components}/dialog/custom-column/index.d.ts +2 -4
- package/lib/es/components/dialog/custom-column/tokenizedI-input.d.ts +16 -0
- package/lib/es/components/dialog/index.d.ts +8 -0
- package/lib/es/{metaBase/components → components}/dialog/select-column/index.d.ts +1 -2
- package/lib/es/{metaBase/components → components}/dialog/select-join/index.d.ts +1 -1
- package/lib/es/{metaBase/components → components}/dialog/select-join-column/index.d.ts +13 -9
- package/lib/es/components/dialog/select-permission-table/index.d.ts +15 -0
- package/lib/es/{metaBase/components → components}/dialog/select-summarize/index.d.ts +2 -3
- package/lib/es/components/dialog/select-table/index.d.ts +17 -0
- package/lib/es/{metaBase/components → components}/icons.d.ts +2 -0
- package/lib/es/components/metabase/index.d.ts +4 -0
- package/lib/es/components/modules/components/meta-icon.d.ts +6 -0
- package/lib/es/components/modules/custom-column.d.ts +7 -0
- package/lib/es/components/modules/filter.d.ts +6 -0
- package/lib/es/components/modules/index.d.ts +4 -0
- package/lib/es/components/modules/join-data.d.ts +6 -0
- package/lib/es/components/modules/permission-table.d.ts +6 -0
- package/lib/es/components/modules/row-limit.d.ts +6 -0
- package/lib/es/components/modules/sort.d.ts +6 -0
- package/lib/es/components/modules/summarize/group-by.d.ts +11 -0
- package/lib/es/components/modules/summarize/index.d.ts +7 -0
- package/lib/es/components/modules/summarize/select-index.d.ts +7 -0
- package/lib/es/components/modules/table-data.d.ts +6 -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/hooks/winsize.d.ts +4 -0
- package/lib/es/index.d.ts +4 -2
- package/lib/es/index.js +2098 -1090
- package/lib/es/index.js.map +1 -1
- 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/metabase.d.ts +6 -0
- package/lib/es/store/{metabase/enum.d.ts → enum.d.ts} +1 -4
- package/lib/es/store/index.d.ts +63 -0
- package/lib/es/store/{metabase/types.d.ts → types.d.ts} +34 -25
- package/lib/es/types.d.ts +22 -35
- package/lib/es/utils/cookies.d.ts +1 -0
- package/lib/es/utils/helper.d.ts +4 -11
- package/lib/es/utils/keydown.d.ts +21 -0
- package/lib/es/utils/platform.d.ts +12 -0
- package/lib/es/utils/storage.d.ts +22 -0
- package/lib/es/{metaBase/utils.d.ts → utils.d.ts} +2 -2
- package/package.json +8 -20
- package/lib/es/constant.d.ts +0 -1
- package/lib/es/enum.d.ts +0 -17
- package/lib/es/helper.d.ts +0 -16
- package/lib/es/icons.d.ts +0 -2
- package/lib/es/metaBase/components/dialog/custom-column/expression-editor.d.ts +0 -11
- package/lib/es/metaBase/components/dialog/custom-column/tokenizedI-input.d.ts +0 -3
- package/lib/es/metaBase/components/dialog/index.d.ts +0 -7
- package/lib/es/metaBase/components/dialog/select-table/index.d.ts +0 -17
- package/lib/es/metaBase/components/modules/components/meta-icon.d.ts +0 -3
- package/lib/es/metaBase/components/modules/custom-column.d.ts +0 -3
- package/lib/es/metaBase/components/modules/filter.d.ts +0 -3
- package/lib/es/metaBase/components/modules/index.d.ts +0 -3
- package/lib/es/metaBase/components/modules/join-data.d.ts +0 -3
- package/lib/es/metaBase/components/modules/row-limit.d.ts +0 -3
- package/lib/es/metaBase/components/modules/sort.d.ts +0 -3
- package/lib/es/metaBase/components/modules/summarize/group-by.d.ts +0 -8
- package/lib/es/metaBase/components/modules/summarize/index.d.ts +0 -3
- package/lib/es/metaBase/components/modules/summarize/select-index.d.ts +0 -3
- package/lib/es/metaBase/components/modules/table-data.d.ts +0 -3
- package/lib/es/metaBase/enum.d.ts +0 -54
- package/lib/es/metaBase/index.d.ts +0 -7
- package/lib/es/metaBase/interface.d.ts +0 -11
- package/lib/es/metaBase/locale.d.ts +0 -1
- package/lib/es/request.d.ts +0 -23
- package/lib/es/store/metabase/index.d.ts +0 -51
- /package/lib/es/{components → common}/Portal/index.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/dialog/custom-column/config.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/dialog/custom-column/dialog/function-tip.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/dialog/custom-column/expressions/tokenizer.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/dialog/custom-column/keyboard.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/dialog/custom-column/tokenized-expression.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/dialog/select-filter/index.d.ts +0 -0
- /package/lib/es/{metaBase/components/modules/components/wrapper.d.ts → components/modules/components/Wrapper.d.ts} +0 -0
- /package/lib/es/{metaBase/components → components}/modules/components/header.d.ts +0 -0
- /package/lib/es/{metaBase/components → components}/popup.d.ts +0 -0
- /package/lib/es/{metaBase/sql-formula.d.ts → sql-formula.d.ts} +0 -0
- /package/lib/es/store/{metabase/helper.d.ts → helper.d.ts} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './locale/en';
|
|
3
|
+
import './locale/zh';
|
|
4
|
+
import type { MetabaseProps, SqlVisionBuilderRef } from './types';
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<MetabaseProps & React.RefAttributes<SqlVisionBuilderRef>>;
|
|
6
|
+
export default _default;
|
|
@@ -5,6 +5,7 @@ export declare enum SortEnum {
|
|
|
5
5
|
export declare enum TypeEnum {
|
|
6
6
|
data = "data",
|
|
7
7
|
joinData = "joinData",
|
|
8
|
+
permissionTable = "permissionTable",// 权限表
|
|
8
9
|
customColumn = "customColumn",
|
|
9
10
|
filter = "filter",
|
|
10
11
|
summarize = "summarize",
|
|
@@ -48,7 +49,3 @@ export declare enum EleComponentEnum {
|
|
|
48
49
|
text = "text",// 文本框
|
|
49
50
|
select = "select"
|
|
50
51
|
}
|
|
51
|
-
export declare enum TabEnum {
|
|
52
|
-
RESULT = "RESULT",
|
|
53
|
-
FIELD = "FIELD"
|
|
54
|
-
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToolbarType, MetaJoin_TalbeType } from './types';
|
|
3
|
+
import type { MetaListType, TableColumnsMapType, initColumnsType, TableType, MetaData_TableType, MetaData_ColumnsType, PopupData } from './types';
|
|
4
|
+
import type { DatasourceType } from '../types';
|
|
5
|
+
export { observer } from 'mobx-react';
|
|
6
|
+
export declare const SummarizeAlias = "source";
|
|
7
|
+
export interface TableFieldsType {
|
|
8
|
+
dataId: string;
|
|
9
|
+
[name: string]: any;
|
|
10
|
+
}
|
|
11
|
+
declare class SqlVisionStore {
|
|
12
|
+
constructor();
|
|
13
|
+
showFields: boolean;
|
|
14
|
+
toolbar: ToolbarType[];
|
|
15
|
+
fieldNameTpl: string;
|
|
16
|
+
tableNameTpl: string;
|
|
17
|
+
sourceList: DatasourceType[];
|
|
18
|
+
_cacheSource2TableMap: {
|
|
19
|
+
[datasourceId: string]: TableType[];
|
|
20
|
+
};
|
|
21
|
+
_cacheColumnsMap: TableColumnsMapType;
|
|
22
|
+
metaList: MetaListType[];
|
|
23
|
+
popupData: PopupData;
|
|
24
|
+
popupClosable: boolean;
|
|
25
|
+
get showMainColumn(): boolean;
|
|
26
|
+
showToolbar(name: ToolbarType): boolean;
|
|
27
|
+
fetchDatasetFn: (id: string) => Promise<any>;
|
|
28
|
+
fetchColumnsFn: (table: {
|
|
29
|
+
name: string;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}, id: string) => Promise<any>;
|
|
32
|
+
setFetchDatasetFn(fn: (id: string) => Promise<any>): void;
|
|
33
|
+
setFetchColumnsFn(fn: (table: {
|
|
34
|
+
name: string;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}, id: string) => Promise<any>): void;
|
|
37
|
+
fetchDataset(datasourceId: string): Promise<any>;
|
|
38
|
+
fetchColumns(table: MetaJoin_TalbeType | MetaData_TableType, datasourceId: string, callback: (record: MetaData_ColumnsType[]) => void): Promise<any>;
|
|
39
|
+
setPreData(data: MetaListType[]): Promise<void>;
|
|
40
|
+
setSourceList(list: DatasourceType[]): void;
|
|
41
|
+
addMeta(type: string, index: number): void;
|
|
42
|
+
delMeta(meta: any): void;
|
|
43
|
+
setMeta(payload: any): void;
|
|
44
|
+
setColumns(tableId: string, columns: initColumnsType[]): void;
|
|
45
|
+
getColumns(tableId: string): MetaData_ColumnsType[];
|
|
46
|
+
setDataset(datasourceId: string, tables: TableType[]): void;
|
|
47
|
+
getDataset(datasourceId: string): TableType[];
|
|
48
|
+
setPopup(payload: PopupData): void;
|
|
49
|
+
setClosable(payload: boolean): void;
|
|
50
|
+
setShowFields(show: boolean): void;
|
|
51
|
+
setToolbar(toolbar: ToolbarType[]): void;
|
|
52
|
+
setFieldNameTpl(tpl: string): void;
|
|
53
|
+
setTableNameTpl(tpl: string): void;
|
|
54
|
+
reset(): void;
|
|
55
|
+
}
|
|
56
|
+
export declare const sqlVisionStore: SqlVisionStore;
|
|
57
|
+
export declare const Store: React.Context<SqlVisionStore>;
|
|
58
|
+
export type SqlVisionStoreType = InstanceType<typeof SqlVisionStore>;
|
|
59
|
+
declare const StoreProvide: React.FC<{
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
}>;
|
|
62
|
+
export default StoreProvide;
|
|
63
|
+
export declare const useStore: () => SqlVisionStore;
|
|
@@ -1,41 +1,28 @@
|
|
|
1
|
+
import type { DatasourceType } from '../types';
|
|
1
2
|
import { TypeEnum, SpecialType, JoinEnum, SQL_COLUMN_TYPE, SortEnum } from './enum';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
content?: any;
|
|
6
|
-
}
|
|
7
|
-
export interface ModulesPropsType<T extends MetaListType = MetaListType> {
|
|
8
|
-
meta: T;
|
|
9
|
-
fetchColumns: (tableName: string, fn: Function) => void;
|
|
10
|
-
popupData: PopupData;
|
|
11
|
-
setPopupData: Function;
|
|
12
|
-
tableData: MetaData_TableType[];
|
|
13
|
-
metaList: MetaListType[];
|
|
14
|
-
addMeta: (type: string, index: number) => void;
|
|
15
|
-
delMeta: (meta: any) => void;
|
|
16
|
-
onChangeValue: (value: MetaListType[]) => void;
|
|
17
|
-
popupClosable: boolean;
|
|
18
|
-
setPopupClosable?: (val: boolean) => void;
|
|
19
|
-
showMainColumn?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export type MetaListType = MetaData | MetaJoin | MetaCustom | MetaFilter | MetaSummarize | MetaSort | MetaLimit;
|
|
22
|
-
export type initColumnsType = Omit<MetaData_ColumnsType, 'select'>;
|
|
3
|
+
export type ToolbarType = TypeEnum | 'filter' | 'summarize' | 'joinData' | 'permissionTable' | 'customColumn' | 'sort' | 'rowLimit';
|
|
4
|
+
export type MetaListType = MetaData | MetaJoin | MetaCustom | MetaFilter | MetaSummarize | MetaSort | MetaLimit | MetaPermissionTable;
|
|
5
|
+
export type initColumnsType = MetaData_ColumnsType;
|
|
23
6
|
export interface TableColumnsMapType {
|
|
24
7
|
[tableName: string]: initColumnsType[];
|
|
25
8
|
}
|
|
26
|
-
export interface
|
|
9
|
+
export interface TableType {
|
|
27
10
|
name: string;
|
|
28
11
|
alias: string;
|
|
29
12
|
}
|
|
13
|
+
export type MetaData_TableType = TableType & DatasourceType;
|
|
30
14
|
export interface MetaData_ColumnsType {
|
|
31
15
|
name: string;
|
|
32
|
-
name_zh
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
name_zh?: string;
|
|
17
|
+
realName?: string;
|
|
18
|
+
database_type: SQL_COLUMN_TYPE | '';
|
|
19
|
+
special_type: SpecialType | '';
|
|
35
20
|
select: boolean;
|
|
36
21
|
}
|
|
37
22
|
export interface MetaData {
|
|
38
23
|
metaKey: number;
|
|
24
|
+
readonly?: boolean;
|
|
25
|
+
hidden?: boolean;
|
|
39
26
|
type: TypeEnum.data;
|
|
40
27
|
table: MetaData_TableType;
|
|
41
28
|
columns: MetaData_ColumnsType[];
|
|
@@ -43,13 +30,18 @@ export interface MetaData {
|
|
|
43
30
|
export interface MetaJoin_TalbeType {
|
|
44
31
|
name: string;
|
|
45
32
|
alias: string;
|
|
33
|
+
datasourceName: string;
|
|
34
|
+
datasourceId: string;
|
|
46
35
|
column: string;
|
|
47
36
|
groupSql?: string;
|
|
37
|
+
[name: string]: any;
|
|
48
38
|
}
|
|
49
39
|
export interface MetaJoin {
|
|
50
40
|
metaKey: number;
|
|
51
41
|
type: TypeEnum.joinData;
|
|
52
42
|
joinType: JoinEnum;
|
|
43
|
+
readonly?: boolean;
|
|
44
|
+
hidden?: boolean;
|
|
53
45
|
table1: MetaJoin_TalbeType;
|
|
54
46
|
table2: MetaJoin_TalbeType;
|
|
55
47
|
columns: MetaData_ColumnsType[];
|
|
@@ -82,15 +74,18 @@ export interface MetaSummarize_Group {
|
|
|
82
74
|
table?: string;
|
|
83
75
|
alias?: string;
|
|
84
76
|
name?: string;
|
|
77
|
+
realName?: string;
|
|
85
78
|
database_type?: SQL_COLUMN_TYPE | '';
|
|
86
79
|
sql: string;
|
|
87
80
|
condition: string;
|
|
88
81
|
quotes: string;
|
|
82
|
+
[params: string]: any;
|
|
89
83
|
}
|
|
90
84
|
export interface MetaSummarize_By {
|
|
91
85
|
table: string;
|
|
92
86
|
alias: string;
|
|
93
87
|
name: string;
|
|
88
|
+
realName?: string;
|
|
94
89
|
sql: string;
|
|
95
90
|
database_type: SQL_COLUMN_TYPE | '';
|
|
96
91
|
condition: string;
|
|
@@ -120,9 +115,15 @@ export interface MetaLimit {
|
|
|
120
115
|
type: TypeEnum.rowLimit;
|
|
121
116
|
limit: string;
|
|
122
117
|
}
|
|
118
|
+
export interface MetaPermissionTable {
|
|
119
|
+
metaKey: number;
|
|
120
|
+
type: TypeEnum.permissionTable;
|
|
121
|
+
table: MetaData_TableType;
|
|
122
|
+
}
|
|
123
123
|
export interface LooseObject {
|
|
124
124
|
[TypeEnum.data]?: MetaData;
|
|
125
125
|
[TypeEnum.joinData]?: MetaJoin[];
|
|
126
|
+
[TypeEnum.permissionTable]?: MetaPermissionTable;
|
|
126
127
|
[TypeEnum.customColumn]?: MetaCustom;
|
|
127
128
|
[TypeEnum.filter]?: MetaFilter;
|
|
128
129
|
[TypeEnum.summarize]?: MetaSummarize;
|
|
@@ -140,10 +141,12 @@ interface ParamsJoinTables {
|
|
|
140
141
|
joinType: string;
|
|
141
142
|
queryColumns: string[];
|
|
142
143
|
tableName: string;
|
|
144
|
+
datasourceId?: string;
|
|
143
145
|
}
|
|
144
146
|
export interface ParamsStruct {
|
|
145
147
|
alias?: string;
|
|
146
148
|
tableName?: string;
|
|
149
|
+
datasourceId?: string;
|
|
147
150
|
queryColumns?: string[];
|
|
148
151
|
customColumns?: ParamsCustomColumns[];
|
|
149
152
|
filters?: string;
|
|
@@ -154,6 +157,7 @@ export interface ParamsStruct {
|
|
|
154
157
|
joinTables?: ParamsJoinTables[];
|
|
155
158
|
limit?: number;
|
|
156
159
|
orderInfos?: string;
|
|
160
|
+
privilegeTable?: string;
|
|
157
161
|
hasInnerSql: boolean;
|
|
158
162
|
innerSqlStruct: ParamsStruct | null;
|
|
159
163
|
}
|
|
@@ -161,6 +165,11 @@ export interface ParamsType {
|
|
|
161
165
|
id: string;
|
|
162
166
|
code: string;
|
|
163
167
|
}
|
|
168
|
+
export interface PopupData {
|
|
169
|
+
visible: boolean;
|
|
170
|
+
node?: any;
|
|
171
|
+
content?: any;
|
|
172
|
+
}
|
|
164
173
|
export {};
|
|
165
174
|
/**
|
|
166
175
|
let a = {
|
package/lib/es/types.d.ts
CHANGED
|
@@ -1,38 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { MetaListType, ToolbarType } from './store/types';
|
|
2
|
+
export interface MetabaseProps {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
btnText?: string;
|
|
5
|
+
showFields?: boolean;
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
getTables: (datasourceId: string) => Promise<any>;
|
|
8
|
+
getColumns: (table: {
|
|
9
|
+
name: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}, datasourceId: string) => Promise<any>;
|
|
12
|
+
toolbar?: ToolbarType[] | false;
|
|
13
|
+
tableNameTpl?: string;
|
|
14
|
+
fieldNameTpl?: string;
|
|
15
|
+
onOk: (params: any) => Promise<void>;
|
|
7
16
|
}
|
|
8
|
-
export interface
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
params?: any;
|
|
12
|
-
headers?: any;
|
|
13
|
-
noCode?: any;
|
|
14
|
-
isRaw?: boolean;
|
|
17
|
+
export interface DatasourceType {
|
|
18
|
+
datasourceId: string;
|
|
19
|
+
datasourceName: string;
|
|
15
20
|
}
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
headers: RequestConfigItem[];
|
|
21
|
-
body: {
|
|
22
|
-
select: ContentTypeEnum;
|
|
23
|
-
none: [];
|
|
24
|
-
'form-data': RequestConfigItem[];
|
|
25
|
-
'x-www-form-urlencoded': RequestConfigItem[];
|
|
26
|
-
raw: string;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export interface PostmanProps {
|
|
30
|
-
requestConfig?: RequestConfig;
|
|
31
|
-
autoSend?: boolean;
|
|
32
|
-
height?: number;
|
|
33
|
-
baseUrl?: string;
|
|
34
|
-
onBeforeSend?: (res: any) => boolean;
|
|
35
|
-
onSend?: (res: any) => void;
|
|
36
|
-
onSuccess?: (res: any) => void;
|
|
37
|
-
onError?: (res: any) => void;
|
|
21
|
+
export interface SqlVisionBuilderRef {
|
|
22
|
+
setDatasource: (list: DatasourceType[]) => void;
|
|
23
|
+
setPreData: (data: MetaListType[]) => void;
|
|
24
|
+
reset: () => void;
|
|
38
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCookie(name: string): string | null;
|
package/lib/es/utils/helper.d.ts
CHANGED
|
@@ -7,17 +7,10 @@ export type ScreenType = {
|
|
|
7
7
|
export declare const getScreenInfo: () => ScreenType;
|
|
8
8
|
export declare const fullScreen: () => void;
|
|
9
9
|
export declare const exitFullscreen: () => void;
|
|
10
|
-
export declare const getUrlParams: (
|
|
10
|
+
export declare const getUrlParams: () => any;
|
|
11
11
|
export declare const sleep: (wait?: number) => Promise<unknown>;
|
|
12
12
|
export declare const flatArray: (arr: any[]) => any[];
|
|
13
13
|
export declare const mobx2Object: (mobxObj: any, defaultType?: any) => any;
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* 切换主题
|
|
19
|
-
* @param {string} theme * 主题
|
|
20
|
-
* @param {function} successFn 切换成功的回调
|
|
21
|
-
* @param {function} errorFn 切换失败的回调
|
|
22
|
-
*/
|
|
23
|
-
export declare const changeTheme: (theme: string, successFn?: Function, errorFn?: Function) => false | undefined;
|
|
14
|
+
export declare const replaceTpl: (inputString: string, values: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}) => 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,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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TypeEnum } from '
|
|
2
|
-
import { MetaListType, MetaSummarize } from '
|
|
1
|
+
import { TypeEnum } from './store/enum';
|
|
2
|
+
import { MetaListType, MetaSummarize } from './store/types';
|
|
3
3
|
export declare const findIndex: <T>(arr: T[], item: T) => number;
|
|
4
4
|
interface HelperResultType {
|
|
5
5
|
ExistAboveGroupBy: boolean;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gingkoo/pandora-metabase",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/es/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
7
7
|
"types": "lib/es/index.d.ts",
|
|
8
8
|
"unpkg": "lib/umd/index.min.js",
|
|
9
9
|
"scripts": {
|
|
10
|
+
"clean": "rimraf lib",
|
|
10
11
|
"dev": "cd example && yarn dev",
|
|
11
12
|
"build": "yarn clean && cross-env BABEL_ENV=esm rollup -c --bundleConfigAsCjs",
|
|
12
|
-
"clean": "rimraf lib",
|
|
13
13
|
"prettier": "prettier --write .",
|
|
14
14
|
"prepublishOnly": "npm run build"
|
|
15
15
|
},
|
|
@@ -25,27 +25,18 @@
|
|
|
25
25
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@emoji-mart/data": "^1.1.2",
|
|
29
|
-
"@emoji-mart/react": "^1.1.0",
|
|
30
28
|
"@gingkoo/pandora": "^1.0.0-alpha.71",
|
|
31
29
|
"@gingkoo/pandora-icons": "^0.0.1-alpha.28",
|
|
32
30
|
"@gingkoo/pandora-hooks": "^1.0.5",
|
|
33
|
-
"@types/react-scroll": "^1.8.10",
|
|
34
|
-
"@types/underscore": "^1.11.15",
|
|
35
|
-
"codemirror": "^5.63.3",
|
|
36
|
-
"date-fns": "^3.6.0",
|
|
37
31
|
"dayjs": "^1.11.11",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
32
|
+
"@ant-design/icons": "^4.8.0",
|
|
33
|
+
"lodash": "^4.17.21",
|
|
34
|
+
"antd": "^5.0.7",
|
|
40
35
|
"mobx": "^6.7.0",
|
|
41
36
|
"mobx-react": "^7.6.0",
|
|
42
|
-
"react-codemirror2": "^7.3.0",
|
|
43
37
|
"react-scroll": "^1.9.0",
|
|
44
|
-
"slate": "0.100.0",
|
|
45
|
-
"slate-history": "0.66.0",
|
|
46
|
-
"slate-react": "0.100.0",
|
|
47
38
|
"styled-components": "^5.3.6",
|
|
48
|
-
"underscore": "^1.13.
|
|
39
|
+
"underscore": "^1.13.6"
|
|
49
40
|
},
|
|
50
41
|
"devDependencies": {
|
|
51
42
|
"@babel/core": "^7.23.9",
|
|
@@ -53,28 +44,25 @@
|
|
|
53
44
|
"@babel/preset-modules": "^0.1.6",
|
|
54
45
|
"@babel/preset-react": "^7.23.3",
|
|
55
46
|
"@babel/preset-typescript": "^7.23.3",
|
|
56
|
-
"@emotion/css": "^11.11.2",
|
|
57
47
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
58
48
|
"@rollup/plugin-image": "^3.0.3",
|
|
59
49
|
"@rollup/plugin-json": "^6.1.0",
|
|
60
50
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
61
51
|
"@rollup/plugin-replace": "^5.0.5",
|
|
62
52
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
63
|
-
"@types/
|
|
53
|
+
"@types/underscore": "^1.11.4",
|
|
64
54
|
"@types/lodash": "^4.14.202",
|
|
65
|
-
"@types/nprogress": "^0.2.3",
|
|
66
55
|
"@types/react": "^18.2.49",
|
|
67
56
|
"@types/react-dom": "^18.2.18",
|
|
68
|
-
"@types/react-transition-group": "^4.4.10",
|
|
69
57
|
"@types/styled-components": "^5.1.12",
|
|
70
58
|
"babel-plugin-dev-expression": "^0.2.3",
|
|
71
59
|
"cross-env": "^7.0.2",
|
|
72
60
|
"fs-extra": "^11.2.0",
|
|
73
61
|
"less": "^4.2.0",
|
|
74
|
-
"lodash": "^4.17.21",
|
|
75
62
|
"postcss": "^8.4.33",
|
|
76
63
|
"postcss-url": "^10.1.3",
|
|
77
64
|
"prettier": "^3.2.4",
|
|
65
|
+
"@emotion/css": "^11.11.2",
|
|
78
66
|
"react": "^18.2.0",
|
|
79
67
|
"react-dom": "^18.2.0",
|
|
80
68
|
"rimraf": "^5.0.5",
|
package/lib/es/constant.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const IMGS: never[];
|
package/lib/es/enum.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare enum MethodEnum {
|
|
2
|
-
get = "GET",
|
|
3
|
-
post = "POST"
|
|
4
|
-
}
|
|
5
|
-
export declare enum ContentTypeEnum {
|
|
6
|
-
'none' = "none",
|
|
7
|
-
'form-data' = "form-data",
|
|
8
|
-
'x-www-form-urlencoded' = "x-www-form-urlencoded",
|
|
9
|
-
'raw' = "raw"
|
|
10
|
-
}
|
|
11
|
-
export declare enum ApiStatus {
|
|
12
|
-
FIRST_OPEN = "first_open",
|
|
13
|
-
LOADING = "loading",
|
|
14
|
-
ERROR = "error",
|
|
15
|
-
NO_DATA = "no_data",
|
|
16
|
-
SUCCESS = "success"
|
|
17
|
-
}
|
package/lib/es/helper.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const throttle: (fn: Function, wait?: number) => Function;
|
|
2
|
-
export declare const debounce: (fn: Function, wait?: number) => (() => void);
|
|
3
|
-
export declare const convertBytesToSize: (bytes?: number) => string;
|
|
4
|
-
export declare const dateFormatTime: (dateStr: string, _len?: number) => string;
|
|
5
|
-
export declare const dateFormat: (date?: Date | number | string, formatStr?: string) => string;
|
|
6
|
-
export declare const downloadFile: (filePath: string, filename?: string) => undefined;
|
|
7
|
-
/**
|
|
8
|
-
* 平滑滚动到指定位置的 Promise
|
|
9
|
-
* @param element 滚动容器
|
|
10
|
-
* @param targetY 目标滚动位置
|
|
11
|
-
* @param duration 滚动持续时间(毫秒)
|
|
12
|
-
* @returns Promise,滚动结束时解析
|
|
13
|
-
*/
|
|
14
|
-
export declare function smoothScrollToPromise(element: HTMLElement, targetY: number, duration: number): Promise<void>;
|
|
15
|
-
export declare const mobx2Object: (mobxObj: any, defaultType?: any) => any;
|
|
16
|
-
export declare const getKey: (length?: number) => string;
|
package/lib/es/icons.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MetaData_ColumnsType } from '../../../../store/metabase/types';
|
|
2
|
-
interface PropsType {
|
|
3
|
-
store?: any;
|
|
4
|
-
data: MetaData_ColumnsType[];
|
|
5
|
-
expression: string;
|
|
6
|
-
onChange: (formula: string) => void;
|
|
7
|
-
popupClosable: boolean;
|
|
8
|
-
setPopupClosable: Function;
|
|
9
|
-
}
|
|
10
|
-
declare const ExpressionEditor: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default ExpressionEditor;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { default as CustomColumnPopup } from '../../../metaBase/components/dialog/custom-column/index';
|
|
2
|
-
export { default as SelectColumn } from '../../../metaBase/components/dialog/select-column/index';
|
|
3
|
-
export { default as SelectJoinColumn } from '../../../metaBase/components/dialog/select-join-column/index';
|
|
4
|
-
export { default as SelectFilter } from '../../../metaBase/components/dialog/select-filter/index';
|
|
5
|
-
export { default as SelectSummarize } from '../../../metaBase/components/dialog/select-summarize/index';
|
|
6
|
-
export { default as SelectJoin } from '../../../metaBase/components/dialog/select-join/index';
|
|
7
|
-
export { default as SelectTable } from '../../../metaBase/components/dialog/select-table/index';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 选择表弹框
|
|
3
|
-
* 谁在用?
|
|
4
|
-
* 1、数据模块
|
|
5
|
-
* 2、关联模块
|
|
6
|
-
*/
|
|
7
|
-
import './index.less';
|
|
8
|
-
import { MetaData_TableType } from '../../../../store/metabase/types';
|
|
9
|
-
interface PropsType {
|
|
10
|
-
data: MetaData_TableType[];
|
|
11
|
-
value: MetaData_TableType;
|
|
12
|
-
onChange: (reocrd: MetaData_TableType) => void;
|
|
13
|
-
didUpdate?: Function;
|
|
14
|
-
setPopupClosable?: Function;
|
|
15
|
-
}
|
|
16
|
-
declare const SelectTable: ({ data, value, onChange, didUpdate }: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default SelectTable;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TypeEnum } from '../../../store/metabase/enum';
|
|
2
|
-
declare const _default: Map<TypeEnum, (props: import("../../../store/metabase/types").ModulesPropsType<import("../../../store/metabase/types").MetaData>) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MetaSummarize, ModulesPropsType } from '../../../../store/metabase/types';
|
|
2
|
-
import { ColumnType } from '../../dialog/select-join-column';
|
|
3
|
-
export type ValueType = ColumnType & {
|
|
4
|
-
condition: string;
|
|
5
|
-
quotes: string;
|
|
6
|
-
};
|
|
7
|
-
declare const GroupBy: (props: ModulesPropsType<MetaSummarize>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default GroupBy;
|