@gingkoo/pandora-metabase 0.0.1-alpha.16 → 0.0.1-alpha.18

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.
@@ -1,4 +1,5 @@
1
1
  import { MetaListType, MetaFilter_Item, MetaSummarize_Group, ParamsStruct } from './types';
2
+ export declare const SummarizeAlias = "source";
2
3
  export declare const filterToSql: (record: MetaFilter_Item) => string;
3
4
  export declare const summarizeToSql: (arr: MetaSummarize_Group[], record: MetaSummarize_Group) => string;
4
5
  export declare const handleSqlStruct: (list: MetaListType[]) => ParamsStruct;
@@ -57,6 +57,8 @@ export interface MetaJoin {
57
57
  table2: MetaJoin_TalbeType;
58
58
  columns: MetaData_ColumnsType[];
59
59
  expressions: ExpressionsType[];
60
+ isSubquery?: boolean;
61
+ subquery?: any[];
60
62
  }
61
63
  export interface MetaCustom_Item {
62
64
  name: string;
package/lib/es/types.d.ts CHANGED
@@ -9,17 +9,19 @@ export interface MetabaseProps {
9
9
  name: string;
10
10
  [key: string]: any;
11
11
  }, datasourceId: string) => Promise<any>;
12
- toolbar?: ToolbarType[] | false;
12
+ toolbar?: ToolbarType[];
13
13
  tableNameTpl?: string;
14
14
  fieldNameTpl?: string;
15
- onOk: (params: any) => Promise<void>;
15
+ onOk?: (params: any) => void;
16
+ value?: MetaListType[];
17
+ sourceList?: DatasourceType[];
18
+ showSubquery?: boolean;
19
+ _showSubquery?: boolean;
16
20
  }
17
21
  export interface DatasourceType {
18
22
  datasourceId: string;
19
23
  datasourceName: string;
20
24
  }
21
25
  export interface SqlVisionBuilderRef {
22
- setDatasource: (list: DatasourceType[]) => void;
23
- setPreData: (data: MetaListType[]) => void;
24
26
  reset: () => void;
25
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "0.0.1-alpha.16",
3
+ "version": "0.0.1-alpha.18",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",
@@ -25,13 +25,14 @@
25
25
  "react-dom": "^17.0.0 || ^18.0.0"
26
26
  },
27
27
  "dependencies": {
28
+ "@ant-design/icons": "^4.8.0",
28
29
  "@gingkoo/pandora": "^1.0.0-alpha.71",
29
- "@gingkoo/pandora-icons": "^0.0.1-alpha.28",
30
30
  "@gingkoo/pandora-hooks": "^1.0.5",
31
+ "@gingkoo/pandora-icons": "^0.0.1-alpha.28",
32
+ "@gingkoo/pandora-viewer": "^0.0.1-alpha.43",
33
+ "antd": "5.0.7",
31
34
  "dayjs": "^1.11.11",
32
- "@ant-design/icons": "^4.8.0",
33
35
  "lodash": "^4.17.21",
34
- "antd": "5.0.7",
35
36
  "mobx": "^6.7.0",
36
37
  "mobx-react": "^7.6.0",
37
38
  "react-scroll": "^1.9.0",
@@ -44,17 +45,18 @@
44
45
  "@babel/preset-modules": "^0.1.6",
45
46
  "@babel/preset-react": "^7.23.3",
46
47
  "@babel/preset-typescript": "^7.23.3",
48
+ "@emotion/css": "^11.11.2",
47
49
  "@rollup/plugin-commonjs": "^25.0.7",
48
50
  "@rollup/plugin-image": "^3.0.3",
49
51
  "@rollup/plugin-json": "^6.1.0",
50
52
  "@rollup/plugin-node-resolve": "^15.2.3",
51
53
  "@rollup/plugin-replace": "^5.0.5",
52
54
  "@rollup/plugin-typescript": "^11.1.6",
53
- "@types/underscore": "^1.11.4",
54
55
  "@types/lodash": "^4.14.202",
55
56
  "@types/react": "^18.2.49",
56
57
  "@types/react-dom": "^18.2.18",
57
58
  "@types/styled-components": "^5.1.12",
59
+ "@types/underscore": "^1.11.4",
58
60
  "babel-plugin-dev-expression": "^0.2.3",
59
61
  "cross-env": "^7.0.2",
60
62
  "fs-extra": "^11.2.0",
@@ -62,7 +64,6 @@
62
64
  "postcss": "^8.4.33",
63
65
  "postcss-url": "^10.1.3",
64
66
  "prettier": "^3.2.4",
65
- "@emotion/css": "^11.11.2",
66
67
  "react": "^18.2.0",
67
68
  "react-dom": "^18.2.0",
68
69
  "rimraf": "^5.0.5",
@@ -1,6 +0,0 @@
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;
@@ -1,63 +0,0 @@
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;