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

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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './locale/en';
3
3
  import './locale/zh';
4
- import type { MetabaseProps } from './types';
5
- declare const _default: React.ForwardRefExoticComponent<MetabaseProps & React.RefAttributes<unknown>>;
4
+ import type { MetabaseProps, SqlVisionBuilderRef } from './types';
5
+ declare const _default: React.ForwardRefExoticComponent<MetabaseProps & React.RefAttributes<SqlVisionBuilderRef>>;
6
6
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { ToolbarType } from './types';
2
3
  import type { MetaListType, TableColumnsMapType, initColumnsType, TableType, MetaData_ColumnsType, PopupData } from './types';
3
4
  import type { DatasourceType } from '../types';
4
5
  export { observer } from 'mobx-react';
@@ -10,6 +11,8 @@ export interface TableFieldsType {
10
11
  declare class SqlVisionStore {
11
12
  constructor();
12
13
  showPermissionTable: boolean;
14
+ showFields: boolean;
15
+ toolbar: ToolbarType[];
13
16
  sourceList: DatasourceType[];
14
17
  _cacheSource2TableMap: {
15
18
  [datasourceId: string]: TableType[];
@@ -37,6 +40,8 @@ declare class SqlVisionStore {
37
40
  setPopup(payload: PopupData): void;
38
41
  setClosable(payload: boolean): void;
39
42
  setShowPermissionTable(show: boolean): void;
43
+ setShowFields(show: boolean): void;
44
+ setToolbar(toolbar: ToolbarType[]): void;
40
45
  }
41
46
  export declare const sqlVisionStore: SqlVisionStore;
42
47
  export declare const Store: React.Context<SqlVisionStore>;
@@ -1,5 +1,6 @@
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
4
  export type MetaListType = MetaData | MetaJoin | MetaJoin | MetaCustom | MetaFilter | MetaSummarize | MetaSort | MetaLimit | MetaPermissionTable;
4
5
  export type initColumnsType = MetaData_ColumnsType;
5
6
  export interface TableColumnsMapType {
package/lib/es/types.d.ts CHANGED
@@ -1,12 +1,20 @@
1
+ import type { MetaListType, ToolbarType } from './store/types';
1
2
  export interface MetabaseProps {
2
3
  loading?: boolean;
3
4
  btnText?: string;
4
5
  showPermissionTable?: boolean;
6
+ showFields?: boolean;
7
+ readonly?: boolean;
5
8
  getTables: (datasourceId: string) => Promise<any>;
6
9
  getColumns: (table: string, datasourceId: string) => Promise<any>;
10
+ toolbar?: ToolbarType[] | false;
7
11
  onOk: (params: any) => Promise<void>;
8
12
  }
9
13
  export interface DatasourceType {
10
14
  datasourceId: string;
11
15
  datasourceName: string;
12
16
  }
17
+ export interface SqlVisionBuilderRef {
18
+ setDatasource: (list: DatasourceType[]) => void;
19
+ setPreData: (data: MetaListType[]) => void;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.5",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",