@gingkoo/pandora-metabase 0.0.30 → 1.0.0-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.
Files changed (32) hide show
  1. package/README.md +25 -11
  2. package/lib/es/components/dialog/custom-editor/enum.d.ts +43 -0
  3. package/lib/es/components/dialog/custom-editor/index.d.ts +10 -0
  4. package/lib/es/components/dialog/custom-editor/utils.d.ts +8 -0
  5. package/lib/es/components/dialog/select-column/index.d.ts +2 -1
  6. package/lib/es/components/dialog/select-filter/index.d.ts +11 -1
  7. package/lib/es/components/dialog/select-join-column/index.d.ts +5 -0
  8. package/lib/es/components/dialog/select-list/index.d.ts +10 -0
  9. package/lib/es/components/icons.d.ts +1 -0
  10. package/lib/es/components/modules/components/meta-icon.d.ts +1 -0
  11. package/lib/es/components/modules/custom-column.d.ts +1 -0
  12. package/lib/es/components/modules/filter.d.ts +1 -0
  13. package/lib/es/components/modules/join-data.d.ts +1 -0
  14. package/lib/es/components/modules/permission-table.d.ts +1 -0
  15. package/lib/es/components/modules/row-limit.d.ts +1 -0
  16. package/lib/es/components/modules/sort.d.ts +1 -0
  17. package/lib/es/components/modules/summarize/group-by.d.ts +1 -0
  18. package/lib/es/components/modules/summarize/index.d.ts +1 -0
  19. package/lib/es/components/modules/summarize/select-index.d.ts +1 -0
  20. package/lib/es/components/modules/table-data.d.ts +1 -0
  21. package/lib/es/components/modules/union.d.ts +9 -0
  22. package/lib/es/components/popup.d.ts +8 -2
  23. package/lib/es/index.js +4988 -3789
  24. package/lib/es/index.js.map +1 -1
  25. package/lib/es/store/enum.d.ts +6 -1
  26. package/lib/es/store/helper.d.ts +4 -1
  27. package/lib/es/store/types.d.ts +51 -16
  28. package/lib/es/types.d.ts +16 -1
  29. package/lib/es/utils/helper-dom.d.ts +4 -3
  30. package/lib/es/utils/helper.d.ts +1 -0
  31. package/lib/es/utils.d.ts +5 -1
  32. package/package.json +2 -4
package/README.md CHANGED
@@ -37,23 +37,37 @@ export type ToolbarType =
37
37
  | 'permissionTable'
38
38
  | 'customColumn'
39
39
  | 'sort'
40
- | 'rowLimit';
40
+ | 'rowLimit'
41
+ | 'union'; //展示合并结果集,会变为多个数组
41
42
 
42
43
  export interface MetaBaseProps {
43
- loading?: boolean; // 加载状态
44
- btnText?: string; //按钮文字
45
- showFields?:boolean ; //是否显示字段
46
- tableNameTpl?: string; //表名
47
- fieldNameTpl?: string; //字段名
48
44
  /**
49
45
  * 工具栏列表
50
46
  * 默认 ['filter','summarize','joinData','permissionTable','customColumn','sort','rowLimit']
51
47
  */
52
- toolbar?:ToolbarType[]|false;
53
- readonly?: boolean; //是否只读
54
- getTables: (datasourceId: string) => Promise<any>; //获取表
55
- getColumns: (table: string, datasourceId: string) => Promise<any>;//获取数据源
56
- onOk: (params: any) => Promise<void>;
48
+ loading?: boolean;
49
+ btnText?: string;
50
+ showFields?: boolean; // 显示字段
51
+ readonly?: boolean;
52
+ getTables: (datasourceId: string) => Promise<any>;
53
+ getColumns: (table: { name: string; [key: string]: any }, datasourceId: string) => Promise<any>;
54
+ toolbar?: ToolbarType[];
55
+ subToolbar?: ToolbarType[]; //子查询功能菜单 默认取toolbar
56
+ tableNameTpl?: string; //表名
57
+ fieldNameTpl?: string; //字段名
58
+ onOk?: (params: any) => void;
59
+ value?: MetaListType[]; //默认值
60
+ sourceList?: DatasourceType[];
61
+ showSubquery?: boolean; //是否展示子查询
62
+ subShowSubquery?: boolean; //子查询是否展示子查询
63
+ constantList?: OptionItem[]; //常量下拉框
64
+ notExistsToolbar?: ToolbarType[]; // notExists的功能菜单 默认取toolbar
65
+ }
66
+
67
+ export interface OptionItem {
68
+ value?: string;
69
+ label: string;
70
+ icon?: React.ReactNode;
57
71
  }
58
72
 
59
73
  export interface SqlVisionBuilderRef {
@@ -0,0 +1,43 @@
1
+ export declare enum OptionsTypeEnum {
2
+ CONSTANT = "constant",// 常量
3
+ INPUT = "input",// 输入框
4
+ FIELD = "field",// 字段
5
+ OPERATOR = "operator",// 运算符
6
+ EXPRESSION = "expression",// 公式
7
+ OTHER = "other"
8
+ }
9
+ export declare enum FunctionEnum {
10
+ LOWER = "lower",
11
+ UPPER = "upper",
12
+ SUBSTRING = "substring",
13
+ REGEX_MATCH_FIRST = "regex-match-first",
14
+ 'CONCAT' = "concat",
15
+ 'REPLACE' = "replace",
16
+ 'TRIM' = "trim",
17
+ 'RTRIM' = "RTRIM",
18
+ 'LTRIM' = "rtrim",
19
+ 'LENGTH' = "length",
20
+ 'ABS' = "abs",
21
+ 'FLOOR' = "floor",
22
+ 'CEIL' = "ceil",
23
+ 'ROUND' = "round",
24
+ 'SQRT' = "sqrt",
25
+ 'POWER' = "power",
26
+ 'LOG' = "log",
27
+ 'EXP' = "exp",
28
+ 'CONTAINS' = "contains",
29
+ 'ENDS_WITH' = "ends-with",
30
+ 'STARTS_WITH' = "starts-with",
31
+ 'BETWEEN' = "between",
32
+ 'TIME_INTERVAL' = "time-interval",
33
+ 'IS_NULL' = "is-null",
34
+ 'IS_EMPTY' = "is-empty",
35
+ 'COALESCE' = "coalesce"
36
+ }
37
+ export declare const operatorList: string[];
38
+ export declare const otherList: string[];
39
+ export declare const functionList: string[];
40
+ export declare const customTypes: {
41
+ value: OptionsTypeEnum;
42
+ label: any;
43
+ }[];
@@ -0,0 +1,10 @@
1
+ import './index.less';
2
+ import { MetaCustom_Item } from '../../../store/types';
3
+ interface PropsType {
4
+ value: MetaCustom_Item;
5
+ data: any;
6
+ onOk: Function;
7
+ onCancel: Function;
8
+ }
9
+ declare const CaseEditor: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
10
+ export default CaseEditor;
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param type 当前选择的类型
4
+ * @param list 当前数组
5
+ * @param index 需要讲模版插入的位置
6
+ * @returns
7
+ */
8
+ export declare const getTemplate: (type: string, list: any[], index: number) => any[];
@@ -8,7 +8,8 @@ import './index.less';
8
8
  import { MetaData_ColumnsType } from '../../../store/types';
9
9
  interface PropsType {
10
10
  data: MetaData_ColumnsType[];
11
+ groupIndex: number;
11
12
  onChange: (record: MetaData_ColumnsType[]) => void;
12
13
  }
13
- declare const SelectColumn: ({ data, onChange }: PropsType) => import("react/jsx-runtime").JSX.Element;
14
+ declare const SelectColumn: ({ data, groupIndex, onChange }: PropsType) => import("react/jsx-runtime").JSX.Element;
14
15
  export default SelectColumn;
@@ -2,5 +2,15 @@
2
2
  * 关联模块 选择表字段
3
3
  */
4
4
  import './index.less';
5
- declare const _default: (props: any) => import("react/jsx-runtime").JSX.Element;
5
+ import { MetaFilter_Item } from '../../../store/types';
6
+ import { DataType } from '../select-join-column';
7
+ interface PropsType {
8
+ data: DataType[];
9
+ value: MetaFilter_Item;
10
+ onChange: (reocrd: MetaFilter_Item) => void;
11
+ didUpdate?: Function;
12
+ isCustom?: boolean;
13
+ container?: any;
14
+ }
15
+ declare const _default: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
16
  export default _default;
@@ -15,6 +15,9 @@ export declare const NUMBER_GROUP_MAP: Map<string, string>;
15
15
  export interface ColumnType {
16
16
  table: string;
17
17
  tableId: string;
18
+ tableUuid: string;
19
+ fieldUuid: string;
20
+ fieldAlias: string;
18
21
  alias: string;
19
22
  name: string;
20
23
  database_type: SQL_COLUMN_TYPE | '';
@@ -22,6 +25,7 @@ export interface ColumnType {
22
25
  id: string;
23
26
  datasourceId: string;
24
27
  datasourceName: string;
28
+ quotes?: string;
25
29
  table2?: Omit<MetaJoin_TalbeType, 'column' | 'column_id'> | null;
26
30
  }
27
31
  export interface ColumnGroupType {
@@ -31,6 +35,7 @@ export interface ColumnGroupType {
31
35
  export type DataType = Partial<DatasourceType> & {
32
36
  table: string;
33
37
  tableId: string;
38
+ tableUuid: string;
34
39
  alias: string;
35
40
  columns: MetaData_ColumnsType[];
36
41
  };
@@ -0,0 +1,10 @@
1
+ import './index.less';
2
+ import { OptionItem } from '../../../types';
3
+ interface PropsType {
4
+ className?: string;
5
+ value?: any;
6
+ list: OptionItem[];
7
+ onChange: (type: any) => void;
8
+ }
9
+ declare const SelectList: ({ value, onChange, list, className }: PropsType) => import("react/jsx-runtime").JSX.Element;
10
+ export default SelectList;
@@ -7,6 +7,7 @@ export declare const CloseIcon2: (reset: any) => import("react/jsx-runtime").JSX
7
7
  export declare const FilterIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const SummarizeIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export declare const JoinDataIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const GroupIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const PermissionTableIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
11
12
  export declare const CustomColumnIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export declare const SortIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { MetaListType } from '../../../store/types';
2
2
  interface PropsType {
3
3
  meta: MetaListType;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const NextDom: (props: PropsType) => import("react/jsx-runtime").JSX.Element | null;
6
7
  export default NextDom;
@@ -2,6 +2,7 @@ import { MetaCustom } from '../../store/types';
2
2
  interface PropsType {
3
3
  store?: any;
4
4
  meta: MetaCustom;
5
+ groupIndex: number;
5
6
  }
6
7
  declare const CustomColumn: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
7
8
  export default CustomColumn;
@@ -1,6 +1,7 @@
1
1
  import { MetaFilter } from '../../store/types';
2
2
  interface PropsType {
3
3
  meta: MetaFilter;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const Filter: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
7
  export default Filter;
@@ -1,6 +1,7 @@
1
1
  import { MetaJoin } from '../../store/types';
2
2
  interface PropsType {
3
3
  meta: MetaJoin;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const JoinData: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
7
  export default JoinData;
@@ -1,6 +1,7 @@
1
1
  import { MetaData } from '../../store/types';
2
2
  interface PropsType {
3
3
  meta: MetaData;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const PermissionTable: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
7
  export default PermissionTable;
@@ -1,6 +1,7 @@
1
1
  interface PropsType {
2
2
  store?: any;
3
3
  meta: any;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const RowLimit: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
7
  export default RowLimit;
@@ -1,6 +1,7 @@
1
1
  import { MetaSort } from '../../store/types';
2
2
  interface PropsType {
3
3
  meta: MetaSort;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const Sort: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
7
  export default Sort;
@@ -6,6 +6,7 @@ export type ValueType = ColumnType & {
6
6
  };
7
7
  interface PropsType {
8
8
  meta: MetaSummarize;
9
+ groupIndex: number;
9
10
  }
10
11
  declare const GroupBy: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
11
12
  export default GroupBy;
@@ -2,6 +2,7 @@ import { MetaSummarize } from '../../../store/types';
2
2
  interface PropsType {
3
3
  store?: any;
4
4
  meta: MetaSummarize;
5
+ groupIndex: number;
5
6
  }
6
7
  declare const Summarize: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
7
8
  export default Summarize;
@@ -2,6 +2,7 @@ import { MetaSummarize } from '../../../store/types';
2
2
  interface PropsType {
3
3
  store?: any;
4
4
  meta: MetaSummarize;
5
+ groupIndex: number;
5
6
  }
6
7
  declare const SelectIndex: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
7
8
  export default SelectIndex;
@@ -1,6 +1,7 @@
1
1
  import { MetaData } from '../../store/types';
2
2
  interface PropsType {
3
3
  meta: MetaData;
4
+ groupIndex: number;
4
5
  }
5
6
  declare const TableData: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
6
7
  export default TableData;
@@ -0,0 +1,9 @@
1
+ import { UnionEnum } from '../../store/enum';
2
+ interface PropsType {
3
+ store?: any;
4
+ meta: any;
5
+ union: UnionEnum;
6
+ groupIndex: number;
7
+ }
8
+ declare const RowLimit: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
9
+ export default RowLimit;
@@ -1,16 +1,20 @@
1
1
  import * as React from 'react';
2
2
  export declare function generateTrigger(PortalComponent: any): {
3
3
  new (props: PropsType): {
4
+ resizeObserver: ResizeObserver | null;
4
5
  resetId: number;
5
6
  ref: any;
6
7
  componentDidMount(): void;
8
+ componentDidUpdate(prevProps: PropsType): void;
7
9
  componentWillUnmount(): void;
10
+ initResizeObserver: () => void;
8
11
  bindEvent: () => void;
9
12
  closePopup: () => void;
10
13
  attachParent: (popupContainer: HTMLSpanElement) => void;
11
14
  getCurrentNodePos: () => {
12
15
  x: number;
13
16
  y: number;
17
+ t: number;
14
18
  h: any;
15
19
  };
16
20
  getContainer: () => HTMLSpanElement;
@@ -28,7 +32,6 @@ export declare function generateTrigger(PortalComponent: any): {
28
32
  shouldComponentUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<{}>, nextContext: any): boolean;
29
33
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
30
34
  getSnapshotBeforeUpdate?(prevProps: Readonly<PropsType>, prevState: Readonly<{}>): any;
31
- componentDidUpdate?(prevProps: Readonly<PropsType>, prevState: Readonly<{}>, snapshot?: any): void;
32
35
  componentWillMount?(): void;
33
36
  UNSAFE_componentWillMount?(): void;
34
37
  componentWillReceiveProps?(nextProps: Readonly<PropsType>, nextContext: any): void;
@@ -44,16 +47,20 @@ export declare function generateTrigger(PortalComponent: any): {
44
47
  };
45
48
  declare const _default: {
46
49
  new (props: PropsType): {
50
+ resizeObserver: ResizeObserver | null;
47
51
  resetId: number;
48
52
  ref: any;
49
53
  componentDidMount(): void;
54
+ componentDidUpdate(prevProps: PropsType): void;
50
55
  componentWillUnmount(): void;
56
+ initResizeObserver: () => void;
51
57
  bindEvent: () => void;
52
58
  closePopup: () => void;
53
59
  attachParent: (popupContainer: HTMLSpanElement) => void;
54
60
  getCurrentNodePos: () => {
55
61
  x: number;
56
62
  y: number;
63
+ t: number;
57
64
  h: any;
58
65
  };
59
66
  getContainer: () => HTMLSpanElement;
@@ -71,7 +78,6 @@ declare const _default: {
71
78
  shouldComponentUpdate?(nextProps: Readonly<PropsType>, nextState: Readonly<{}>, nextContext: any): boolean;
72
79
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
73
80
  getSnapshotBeforeUpdate?(prevProps: Readonly<PropsType>, prevState: Readonly<{}>): any;
74
- componentDidUpdate?(prevProps: Readonly<PropsType>, prevState: Readonly<{}>, snapshot?: any): void;
75
81
  componentWillMount?(): void;
76
82
  UNSAFE_componentWillMount?(): void;
77
83
  componentWillReceiveProps?(nextProps: Readonly<PropsType>, nextContext: any): void;