@gingkoo/pandora-metabase 0.0.1-alpha.5 → 0.0.1-alpha.7

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.
@@ -10,9 +10,10 @@ export interface TableFieldsType {
10
10
  }
11
11
  declare class SqlVisionStore {
12
12
  constructor();
13
- showPermissionTable: boolean;
14
13
  showFields: boolean;
15
14
  toolbar: ToolbarType[];
15
+ fieldNameTpl: string;
16
+ tableNameTpl: string;
16
17
  sourceList: DatasourceType[];
17
18
  _cacheSource2TableMap: {
18
19
  [datasourceId: string]: TableType[];
@@ -22,6 +23,7 @@ declare class SqlVisionStore {
22
23
  popupData: PopupData;
23
24
  popupClosable: boolean;
24
25
  get showMainColumn(): boolean;
26
+ showToolbar(name: ToolbarType): boolean;
25
27
  fetchDatasetFn: (id: string) => Promise<any>;
26
28
  fetchColumnsFn: (tableName: string, id: string) => Promise<any>;
27
29
  setFetchDatasetFn(fn: (id: string) => Promise<any>): void;
@@ -39,12 +41,14 @@ declare class SqlVisionStore {
39
41
  getDataset(datasourceId: string): TableType[];
40
42
  setPopup(payload: PopupData): void;
41
43
  setClosable(payload: boolean): void;
42
- setShowPermissionTable(show: boolean): void;
43
44
  setShowFields(show: boolean): void;
44
45
  setToolbar(toolbar: ToolbarType[]): void;
46
+ setFieldNameTpl(tpl: string): void;
47
+ setTableNameTpl(tpl: string): void;
45
48
  }
46
49
  export declare const sqlVisionStore: SqlVisionStore;
47
50
  export declare const Store: React.Context<SqlVisionStore>;
51
+ export type SqlVisionStoreType = InstanceType<typeof SqlVisionStore>;
48
52
  declare const StoreProvide: React.FC<{
49
53
  children: React.ReactNode;
50
54
  }>;
@@ -13,7 +13,7 @@ export interface TableType {
13
13
  export type MetaData_TableType = TableType & DatasourceType;
14
14
  export interface MetaData_ColumnsType {
15
15
  name: string;
16
- name_zh: string;
16
+ name_zh?: string;
17
17
  realName?: string;
18
18
  database_type: SQL_COLUMN_TYPE | '';
19
19
  special_type: SpecialType | '';
@@ -74,6 +74,7 @@ export interface MetaSummarize_Group {
74
74
  sql: string;
75
75
  condition: string;
76
76
  quotes: string;
77
+ [params: string]: any;
77
78
  }
78
79
  export interface MetaSummarize_By {
79
80
  table: string;
package/lib/es/types.d.ts CHANGED
@@ -2,12 +2,13 @@ import type { MetaListType, ToolbarType } from './store/types';
2
2
  export interface MetabaseProps {
3
3
  loading?: boolean;
4
4
  btnText?: string;
5
- showPermissionTable?: boolean;
6
5
  showFields?: boolean;
7
6
  readonly?: boolean;
8
7
  getTables: (datasourceId: string) => Promise<any>;
9
8
  getColumns: (table: string, datasourceId: string) => Promise<any>;
10
9
  toolbar?: ToolbarType[] | false;
10
+ tableNameTpl?: string;
11
+ fieldNameTpl?: string;
11
12
  onOk: (params: any) => Promise<void>;
12
13
  }
13
14
  export interface DatasourceType {
@@ -17,4 +18,5 @@ export interface DatasourceType {
17
18
  export interface SqlVisionBuilderRef {
18
19
  setDatasource: (list: DatasourceType[]) => void;
19
20
  setPreData: (data: MetaListType[]) => void;
21
+ reset: () => void;
20
22
  }
@@ -11,3 +11,6 @@ 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 replaceTpl: (inputString: string, values: {
15
+ [key: string]: any;
16
+ }) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "0.0.1-alpha.5",
3
+ "version": "0.0.1-alpha.7",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",