@gingkoo/pandora-metabase 1.0.146 → 1.0.147

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 (115) hide show
  1. package/lib/cjs/common/Loading/index.d.ts +2 -1
  2. package/lib/cjs/components/dialog/custom-column/dialog/function-tip.d.ts +2 -1
  3. package/lib/cjs/components/dialog/custom-column/dialog/select-list.d.ts +2 -1
  4. package/lib/cjs/components/dialog/custom-column/expression-editor.d.ts +2 -1
  5. package/lib/cjs/components/dialog/custom-column/index.d.ts +2 -1
  6. package/lib/cjs/components/dialog/custom-column/tokenized-expression.d.ts +1 -1
  7. package/lib/cjs/components/dialog/custom-editor/index.d.ts +2 -1
  8. package/lib/cjs/components/dialog/expression/index.d.ts +2 -1
  9. package/lib/cjs/components/dialog/formula/index.js +15 -0
  10. package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +1 -1
  11. package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +1 -1
  12. package/lib/cjs/components/dialog/formula-list/index.js +13 -8
  13. package/lib/cjs/components/dialog/select-column/index.d.ts +2 -1
  14. package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +2 -1
  15. package/lib/cjs/components/dialog/select-join/index.d.ts +2 -1
  16. package/lib/cjs/components/dialog/select-join-column/index.d.ts +2 -1
  17. package/lib/cjs/components/dialog/select-join-column-multiple/index.d.ts +2 -1
  18. package/lib/cjs/components/dialog/select-list/index.d.ts +2 -1
  19. package/lib/cjs/components/dialog/select-permission-table/index.d.ts +2 -1
  20. package/lib/cjs/components/dialog/select-summarize/index.d.ts +2 -1
  21. package/lib/cjs/components/dialog/select-table/index.d.ts +2 -1
  22. package/lib/cjs/components/icons.d.ts +30 -29
  23. package/lib/cjs/components/metabase/index.d.ts +2 -1
  24. package/lib/cjs/components/metabase/index.js +16 -1
  25. package/lib/cjs/components/metabase/index.less +34 -0
  26. package/lib/cjs/components/modules/components/Wrapper.d.ts +1 -1
  27. package/lib/cjs/components/modules/components/header.d.ts +2 -1
  28. package/lib/cjs/components/modules/components/item-name.d.ts +1 -1
  29. package/lib/cjs/components/modules/components/item-wrapper.d.ts +1 -1
  30. package/lib/cjs/components/modules/components/meta-icon.d.ts +2 -1
  31. package/lib/cjs/components/modules/custom-column.d.ts +2 -1
  32. package/lib/cjs/components/modules/custom-column.js +16 -12
  33. package/lib/cjs/components/modules/filter.d.ts +2 -1
  34. package/lib/cjs/components/modules/join-data.d.ts +2 -1
  35. package/lib/cjs/components/modules/join-data.js +132 -113
  36. package/lib/cjs/components/modules/permission-table.d.ts +2 -1
  37. package/lib/cjs/components/modules/row-limit.d.ts +2 -1
  38. package/lib/cjs/components/modules/sort.d.ts +2 -1
  39. package/lib/cjs/components/modules/sort.js +18 -14
  40. package/lib/cjs/components/modules/summarize/group-by.d.ts +2 -1
  41. package/lib/cjs/components/modules/summarize/group-by.js +32 -28
  42. package/lib/cjs/components/modules/summarize/index.d.ts +2 -1
  43. package/lib/cjs/components/modules/summarize/select-index.d.ts +2 -1
  44. package/lib/cjs/components/modules/summarize/select-index.js +32 -28
  45. package/lib/cjs/components/modules/table-data.d.ts +2 -1
  46. package/lib/cjs/components/modules/table-data.js +53 -46
  47. package/lib/cjs/components/modules/union.d.ts +2 -1
  48. package/lib/cjs/components/popup.d.ts +1 -1
  49. package/lib/cjs/components/right-click-menu.d.ts +16 -0
  50. package/lib/cjs/components/right-click-menu.js +179 -0
  51. package/lib/cjs/components/right-click-value.d.ts +8 -0
  52. package/lib/cjs/components/right-click-value.js +33 -0
  53. package/lib/cjs/hooks/use-provider.d.ts +1 -1
  54. package/lib/cjs/hooks/use-state.js +62 -22
  55. package/lib/cjs/index.d.ts +2 -2
  56. package/lib/cjs/index.js +4 -1
  57. package/lib/cjs/types.d.ts +17 -0
  58. package/lib/es/common/Loading/index.d.ts +2 -1
  59. package/lib/es/components/dialog/custom-column/dialog/function-tip.d.ts +2 -1
  60. package/lib/es/components/dialog/custom-column/dialog/select-list.d.ts +2 -1
  61. package/lib/es/components/dialog/custom-column/expression-editor.d.ts +2 -1
  62. package/lib/es/components/dialog/custom-column/index.d.ts +2 -1
  63. package/lib/es/components/dialog/custom-column/tokenized-expression.d.ts +1 -1
  64. package/lib/es/components/dialog/custom-editor/index.d.ts +2 -1
  65. package/lib/es/components/dialog/expression/index.d.ts +2 -1
  66. package/lib/es/components/dialog/formula/index.js +15 -0
  67. package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +1 -1
  68. package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +1 -1
  69. package/lib/es/components/dialog/formula-list/index.js +13 -8
  70. package/lib/es/components/dialog/select-column/index.d.ts +2 -1
  71. package/lib/es/components/dialog/select-column-multiple/index.d.ts +2 -1
  72. package/lib/es/components/dialog/select-join/index.d.ts +2 -1
  73. package/lib/es/components/dialog/select-join-column/index.d.ts +2 -1
  74. package/lib/es/components/dialog/select-join-column-multiple/index.d.ts +2 -1
  75. package/lib/es/components/dialog/select-list/index.d.ts +2 -1
  76. package/lib/es/components/dialog/select-permission-table/index.d.ts +2 -1
  77. package/lib/es/components/dialog/select-summarize/index.d.ts +2 -1
  78. package/lib/es/components/dialog/select-table/index.d.ts +2 -1
  79. package/lib/es/components/icons.d.ts +30 -29
  80. package/lib/es/components/metabase/index.d.ts +2 -1
  81. package/lib/es/components/metabase/index.js +15 -2
  82. package/lib/es/components/metabase/index.less +34 -0
  83. package/lib/es/components/modules/components/Wrapper.d.ts +1 -1
  84. package/lib/es/components/modules/components/header.d.ts +2 -1
  85. package/lib/es/components/modules/components/item-name.d.ts +1 -1
  86. package/lib/es/components/modules/components/item-wrapper.d.ts +1 -1
  87. package/lib/es/components/modules/components/meta-icon.d.ts +2 -1
  88. package/lib/es/components/modules/custom-column.d.ts +2 -1
  89. package/lib/es/components/modules/custom-column.js +16 -12
  90. package/lib/es/components/modules/filter.d.ts +2 -1
  91. package/lib/es/components/modules/join-data.d.ts +2 -1
  92. package/lib/es/components/modules/join-data.js +132 -113
  93. package/lib/es/components/modules/permission-table.d.ts +2 -1
  94. package/lib/es/components/modules/row-limit.d.ts +2 -1
  95. package/lib/es/components/modules/sort.d.ts +2 -1
  96. package/lib/es/components/modules/sort.js +18 -14
  97. package/lib/es/components/modules/summarize/group-by.d.ts +2 -1
  98. package/lib/es/components/modules/summarize/group-by.js +32 -28
  99. package/lib/es/components/modules/summarize/index.d.ts +2 -1
  100. package/lib/es/components/modules/summarize/select-index.d.ts +2 -1
  101. package/lib/es/components/modules/summarize/select-index.js +32 -28
  102. package/lib/es/components/modules/table-data.d.ts +2 -1
  103. package/lib/es/components/modules/table-data.js +53 -46
  104. package/lib/es/components/modules/union.d.ts +2 -1
  105. package/lib/es/components/popup.d.ts +1 -1
  106. package/lib/es/components/right-click-menu.d.ts +16 -0
  107. package/lib/es/components/right-click-menu.js +172 -0
  108. package/lib/es/components/right-click-value.d.ts +8 -0
  109. package/lib/es/components/right-click-value.js +25 -0
  110. package/lib/es/hooks/use-provider.d.ts +1 -1
  111. package/lib/es/hooks/use-state.js +62 -22
  112. package/lib/es/index.d.ts +2 -2
  113. package/lib/es/index.js +4 -1
  114. package/lib/es/types.d.ts +17 -0
  115. package/package.json +2 -2
@@ -5,6 +5,6 @@ interface PropsType {
5
5
  source: string;
6
6
  }
7
7
  export default class TokenizedExpression extends React.Component<PropsType> {
8
- render(): import("react/jsx-runtime").JSX.Element;
8
+ render(): React.JSX.Element;
9
9
  }
10
10
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './index.less';
2
3
  import { MetaCustom_Item } from '../../../store/types';
3
4
  interface PropsType {
@@ -7,5 +8,5 @@ interface PropsType {
7
8
  onOk: Function;
8
9
  onCancel: Function;
9
10
  }
10
- declare const CaseEditor: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
11
+ declare const CaseEditor: (props: PropsType) => React.JSX.Element;
11
12
  export default CaseEditor;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { AtomsExpression } from '../../../store/types';
3
4
  import { DataType } from '../select-column-multiple';
4
5
  interface PropsType {
@@ -11,5 +12,5 @@ interface PropsType {
11
12
  filterCustomType?: boolean;
12
13
  parentPopupChannel?: 'primary' | 'secondary';
13
14
  }
14
- declare const _default: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
15
+ declare const _default: (props: PropsType) => React.JSX.Element;
15
16
  export default _default;
@@ -19,6 +19,8 @@ import { Select, Button } from '@gingkoo/pandora';
19
19
  import cloneDeep from 'lodash/cloneDeep';
20
20
  import { useStore } from '../../../hooks/use-provider';
21
21
  import { getTopLayerZIndex } from '../../../utils/helper-dom';
22
+ import { useRightClickValue } from '../../right-click-value';
23
+ import SqbRightClickMenu, { openSqbRightClickMenu } from '../../right-click-menu';
22
24
  var VisualBox = Styled.div.attrs({
23
25
  className: 'visual-box scroller'
24
26
  })(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
@@ -71,6 +73,11 @@ var CaseEditor = React.forwardRef(function (props, ref) {
71
73
  });
72
74
  }, [currentFormulaKey, currentFormulaTemplate, effectiveArity]);
73
75
  var _ref = useRef(null);
76
+ var formulaRightClickValueId = useRightClickValue(fun);
77
+ var _useState5 = useState(null),
78
+ _useState6 = _slicedToArray(_useState5, 2),
79
+ rightClickMenuState = _useState6[0],
80
+ setRightClickMenuState = _useState6[1];
74
81
  var usable = useMemo(function () {
75
82
  return fun.name && isOk(fun.args);
76
83
  }, [fun]);
@@ -119,6 +126,9 @@ var CaseEditor = React.forwardRef(function (props, ref) {
119
126
  className: cx(props.className, 'function-box'),
120
127
  ref: ref,
121
128
  children: [_jsx(VisualBox, {
129
+ onContextMenu: function onContextMenu(e) {
130
+ return openSqbRightClickMenu(store, e, setRightClickMenuState);
131
+ },
122
132
  children: _jsx("div", {
123
133
  className: "Sqb-item Sqb-case-editor mb-2 mt-2",
124
134
  children: _jsxs("div", {
@@ -150,6 +160,7 @@ var CaseEditor = React.forwardRef(function (props, ref) {
150
160
  className: cx("Sqb-TableName Sqb-TableName-OPERATOR", {
151
161
  notSelected: !fun.name
152
162
  }),
163
+ "data-right-click-id": formulaRightClickValueId,
153
164
  children: formulaName(fun, formulaList) || __('customColumn.selectFormula')
154
165
  });
155
166
  },
@@ -237,6 +248,10 @@ var CaseEditor = React.forwardRef(function (props, ref) {
237
248
  })]
238
249
  })
239
250
  })
251
+ }), _jsx(SqbRightClickMenu, {
252
+ popupZIndex: getTopLayerZIndex() + 10,
253
+ state: rightClickMenuState,
254
+ setState: setRightClickMenuState
240
255
  }), _jsx("div", {
241
256
  className: "btns p-4",
242
257
  children: _jsxs("div", {
@@ -24,5 +24,5 @@ type Props = {
24
24
  activeRegionKey?: string | null;
25
25
  onActivateRegion?: (key: string) => void;
26
26
  };
27
- declare const CaseWhenGroup: ({ caseAtomsContent, whenClauses, elseContent, onAddBranch, onAddElse, onRemoveElse, onZoomCase, onDeleteCase, showTools, isNested, useBranchScrollInner, caseRegionKey, elseRegionKey, activeRegionKey, onActivateRegion, }: Props) => import("react/jsx-runtime").JSX.Element;
27
+ declare const CaseWhenGroup: ({ caseAtomsContent, whenClauses, elseContent, onAddBranch, onAddElse, onRemoveElse, onZoomCase, onDeleteCase, showTools, isNested, useBranchScrollInner, caseRegionKey, elseRegionKey, activeRegionKey, onActivateRegion, }: Props) => React.JSX.Element;
28
28
  export default CaseWhenGroup;
@@ -9,5 +9,5 @@ type Props = {
9
9
  onDeleteItem: (operatorIndex: number, side: 'left' | 'right') => void;
10
10
  onDelete: (e: any) => void;
11
11
  };
12
- declare const LogicGroup: ({ items, onChangeOperator, onAddItem, onDeleteItem, onDelete, }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ declare const LogicGroup: ({ items, onChangeOperator, onAddItem, onDeleteItem, onDelete, }: Props) => React.JSX.Element;
13
13
  export default LogicGroup;
@@ -32,6 +32,7 @@ import SelectList from '../../dialog/select-list';
32
32
  import arrow from './arrow.svg';
33
33
  import { useStore, Provider } from '../../../hooks/use-provider';
34
34
  import ItemName from '../../modules/components/item-name';
35
+ import RightClickValue from '../../right-click-value';
35
36
  import DiffViewer from '../diff-viewer';
36
37
  import storage from '../../../utils/storage';
37
38
  import { getTopLayerZIndex } from '../../../utils/helper-dom';
@@ -586,7 +587,8 @@ var FormulaList = forwardRef(function (props, ref) {
586
587
  height: '100%',
587
588
  fullscreen: true,
588
589
  value: sql,
589
- showLanguage: false
590
+ showLanguage: false,
591
+ matchBrackets: store.matchBrackets
590
592
  })
591
593
  }),
592
594
  onClose: function onClose() {}
@@ -2170,13 +2172,16 @@ var FormulaList = forwardRef(function (props, ref) {
2170
2172
  openCheck: isCheck && !isCompositeAtom
2171
2173
  }),
2172
2174
  children: itemContent.raw ? itemContent.node : _jsx(ItemName, _objectSpread(_objectSpread({}, getItemNameProps(v)), {}, {
2173
- children: _jsx("div", _objectSpread(_objectSpread({
2174
- className: cx('Sqb-TableName', itemContent.className),
2175
- onClick: itemContent.onClick,
2176
- style: getTokenStyleByClassName(itemContent.className, itemContent.style)
2177
- }, itemContent.attrs || {}), {}, {
2178
- children: itemContent.node
2179
- }))
2175
+ children: _jsx(RightClickValue, {
2176
+ value: v,
2177
+ children: _jsx("div", _objectSpread(_objectSpread({
2178
+ className: cx('Sqb-TableName', itemContent.className),
2179
+ onClick: itemContent.onClick,
2180
+ style: getTokenStyleByClassName(itemContent.className, itemContent.style)
2181
+ }, itemContent.attrs || {}), {}, {
2182
+ children: itemContent.node
2183
+ }))
2184
+ })
2180
2185
  }))
2181
2186
  }), showAfterArrow && selectOperator({
2182
2187
  triggerElement: function triggerElement(value) {
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { MetaData_ColumnsType, MetaData_TableType } from '../../../store/types';
3
4
  interface PropsType {
4
5
  data: MetaData_ColumnsType[];
@@ -7,5 +8,5 @@ interface PropsType {
7
8
  groupIndex: number;
8
9
  onChange: (record: MetaData_ColumnsType[], newMetaList?: any[]) => void;
9
10
  }
10
- declare const SelectColumn: ({ data, table, metaIndex, groupIndex, onChange }: PropsType) => import("react/jsx-runtime").JSX.Element;
11
+ declare const SelectColumn: ({ data, table, metaIndex, groupIndex, onChange }: PropsType) => React.JSX.Element;
11
12
  export default SelectColumn;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { ColumnsPopupThemeEnum, SQL_COLUMN_TYPE } from '../../../store/enum';
3
4
  import { MetaData_ColumnsType, MetaJoin_TalbeType, AtomsField } from '../../../store/types';
4
5
  import { DatasourceType } from '../../../types';
@@ -42,5 +43,5 @@ interface PropsType {
42
43
  nextBtnText?: string;
43
44
  onNextStep?: () => void;
44
45
  }
45
- declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, showNextBtn, nextBtnText, onNextStep, }: PropsType) => import("react/jsx-runtime").JSX.Element;
46
+ declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, showNextBtn, nextBtnText, onNextStep, }: PropsType) => React.JSX.Element;
46
47
  export default SelectJoinColumn;
@@ -1,8 +1,9 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { JoinEnum } from '../../../store/enum';
3
4
  interface PropsType {
4
5
  value: JoinEnum;
5
6
  onChange: (type: JoinEnum) => void;
6
7
  }
7
- declare const SelectJoin: ({ value, onChange }: PropsType) => import("react/jsx-runtime").JSX.Element;
8
+ declare const SelectJoin: ({ value, onChange }: PropsType) => React.JSX.Element;
8
9
  export default SelectJoin;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { ColumnsPopupThemeEnum, SQL_COLUMN_TYPE } from '../../../store/enum';
3
4
  import { MetaData_ColumnsType, MetaJoin_TalbeType } from '../../../store/types';
4
5
  import { DatasourceType } from '../../../types';
@@ -45,5 +46,5 @@ interface PropsType {
45
46
  didUpdate?: Function;
46
47
  multiple?: boolean;
47
48
  }
48
- declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, }: PropsType) => import("react/jsx-runtime").JSX.Element;
49
+ declare const SelectJoinColumn: ({ data, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, }: PropsType) => React.JSX.Element;
49
50
  export default SelectJoinColumn;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { ColumnsPopupThemeEnum, SQL_COLUMN_TYPE } from '../../../store/enum';
3
4
  import { MetaData_ColumnsType, MetaJoin_TalbeType, MetaJoin_Field } from '../../../store/types';
4
5
  import { DatasourceType } from '../../../types';
@@ -44,5 +45,5 @@ interface PropsType {
44
45
  didUpdate?: Function;
45
46
  multiple?: boolean;
46
47
  }
47
- declare const SelectJoinColumn: ({ data, tableInfo: tableInfo, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, }: PropsType) => import("react/jsx-runtime").JSX.Element;
48
+ declare const SelectJoinColumn: ({ data, tableInfo: tableInfo, value: _value, theme, onSelect, isGroup, onGroup, didUpdate, multiple, }: PropsType) => React.JSX.Element;
48
49
  export default SelectJoinColumn;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './index.less';
2
3
  import { OptionItem } from '../../../types';
3
4
  interface PropsType {
@@ -6,5 +7,5 @@ interface PropsType {
6
7
  list: OptionItem[];
7
8
  onChange: (type: any) => void;
8
9
  }
9
- declare const SelectList: ({ value, onChange, list, className }: PropsType) => import("react/jsx-runtime").JSX.Element;
10
+ declare const SelectList: ({ value, onChange, list, className }: PropsType) => React.JSX.Element;
10
11
  export default SelectList;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { MetaData_TableType } from '../../../store/types';
3
4
  interface PropsType {
4
5
  data: MetaData_TableType[];
@@ -7,5 +8,5 @@ interface PropsType {
7
8
  didUpdate?: Function;
8
9
  tableEnableAlias: boolean;
9
10
  }
10
- declare const SelectPermissionTable: ({ data, value, onChange, didUpdate, tableEnableAlias, }: PropsType) => import("react/jsx-runtime").JSX.Element;
11
+ declare const SelectPermissionTable: ({ data, value, onChange, didUpdate, tableEnableAlias, }: PropsType) => React.JSX.Element;
11
12
  export default SelectPermissionTable;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { DataType, ColumnType } from '../select-column-multiple';
3
4
  import { AtomsItem } from '../../../store/types';
4
5
  export type ValueType = Partial<ColumnType> & {
@@ -17,5 +18,5 @@ interface PropsType {
17
18
  didUpdate?: Function;
18
19
  ignoreGroupByType?: boolean;
19
20
  }
20
- declare const SelectSummarize: ({ data, value, onChange, didUpdate, ignoreGroupByType }: PropsType) => import("react/jsx-runtime").JSX.Element;
21
+ declare const SelectSummarize: ({ data, value, onChange, didUpdate, ignoreGroupByType }: PropsType) => React.JSX.Element;
21
22
  export default SelectSummarize;
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import { MetaData_TableType } from '../../../store/types';
3
4
  import { DatasourceType } from '../../../types';
4
5
  interface PropsType {
@@ -9,5 +10,5 @@ interface PropsType {
9
10
  didUpdate?: Function;
10
11
  tableFlat?: boolean;
11
12
  }
12
- declare const SelectTable: ({ data, sourceTable, value, onChange, didUpdate, tableFlat, }: PropsType) => import("react/jsx-runtime").JSX.Element;
13
+ declare const SelectTable: ({ data, sourceTable, value, onChange, didUpdate, tableFlat, }: PropsType) => React.JSX.Element;
13
14
  export default SelectTable;
@@ -1,35 +1,36 @@
1
+ import React from 'react';
1
2
  type IconProps = {
2
3
  width?: number;
3
4
  height?: number;
4
5
  style?: object;
5
6
  };
6
- export declare const CloseIcon2: (reset: any) => import("react/jsx-runtime").JSX.Element;
7
- export declare const FilterIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
8
- export declare const SummarizeIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
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;
11
- export declare const PermissionTableIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
12
- export declare const CustomColumnIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
13
- export declare const SortIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
14
- export declare const RowLimitIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
15
- export declare const LeftJoinIcon: ({ width, height, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
16
- export declare const InnerJoinIcon: ({ width, height, style }: IconProps) => import("react/jsx-runtime").JSX.Element;
17
- export declare const UpArrowIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
18
- export declare const DownArrowIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
19
- export declare const CloseIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
20
- export declare const AddIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
21
- export declare const TableIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
22
- export declare const SearchIcon: ({ width, height }: IconProps) => import("react/jsx-runtime").JSX.Element;
23
- export declare const NotSelectIcon: () => import("react/jsx-runtime").JSX.Element;
24
- export declare const SelectIcon: () => import("react/jsx-runtime").JSX.Element;
25
- export declare const CircleIcon: () => import("react/jsx-runtime").JSX.Element;
26
- export declare const LetterAaIcon: () => import("react/jsx-runtime").JSX.Element;
27
- export declare const CalendarIcon: () => import("react/jsx-runtime").JSX.Element;
28
- export declare const WellIcon: () => import("react/jsx-runtime").JSX.Element;
29
- export declare const ForeignKeyIcon: () => import("react/jsx-runtime").JSX.Element;
30
- export declare const UpArrowIcon2: () => import("react/jsx-runtime").JSX.Element;
31
- export declare const DownArrowIcon2: () => import("react/jsx-runtime").JSX.Element;
32
- export declare const LeftArrowIcon: () => import("react/jsx-runtime").JSX.Element;
33
- export declare const RightArrowIcon: () => import("react/jsx-runtime").JSX.Element;
34
- export declare const DataSourceIcon: () => import("react/jsx-runtime").JSX.Element;
7
+ export declare const CloseIcon2: (reset: any) => React.JSX.Element;
8
+ export declare const FilterIcon: ({ width, height }: IconProps) => React.JSX.Element;
9
+ export declare const SummarizeIcon: ({ width, height }: IconProps) => React.JSX.Element;
10
+ export declare const JoinDataIcon: ({ width, height }: IconProps) => React.JSX.Element;
11
+ export declare const GroupIcon: ({ width, height }: IconProps) => React.JSX.Element;
12
+ export declare const PermissionTableIcon: ({ width, height }: IconProps) => React.JSX.Element;
13
+ export declare const CustomColumnIcon: ({ width, height }: IconProps) => React.JSX.Element;
14
+ export declare const SortIcon: ({ width, height }: IconProps) => React.JSX.Element;
15
+ export declare const RowLimitIcon: ({ width, height }: IconProps) => React.JSX.Element;
16
+ export declare const LeftJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
17
+ export declare const InnerJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
18
+ export declare const UpArrowIcon: ({ width, height }: IconProps) => React.JSX.Element;
19
+ export declare const DownArrowIcon: ({ width, height }: IconProps) => React.JSX.Element;
20
+ export declare const CloseIcon: ({ width, height }: IconProps) => React.JSX.Element;
21
+ export declare const AddIcon: ({ width, height }: IconProps) => React.JSX.Element;
22
+ export declare const TableIcon: ({ width, height }: IconProps) => React.JSX.Element;
23
+ export declare const SearchIcon: ({ width, height }: IconProps) => React.JSX.Element;
24
+ export declare const NotSelectIcon: () => React.JSX.Element;
25
+ export declare const SelectIcon: () => React.JSX.Element;
26
+ export declare const CircleIcon: () => React.JSX.Element;
27
+ export declare const LetterAaIcon: () => React.JSX.Element;
28
+ export declare const CalendarIcon: () => React.JSX.Element;
29
+ export declare const WellIcon: () => React.JSX.Element;
30
+ export declare const ForeignKeyIcon: () => React.JSX.Element;
31
+ export declare const UpArrowIcon2: () => React.JSX.Element;
32
+ export declare const DownArrowIcon2: () => React.JSX.Element;
33
+ export declare const LeftArrowIcon: () => React.JSX.Element;
34
+ export declare const RightArrowIcon: () => React.JSX.Element;
35
+ export declare const DataSourceIcon: () => React.JSX.Element;
35
36
  export {};
@@ -1,4 +1,5 @@
1
1
  import './index.less';
2
+ import React from 'react';
2
3
  import type { MetabaseProps } from '../../types';
3
- declare const Metabase: (props: MetabaseProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const Metabase: (props: MetabaseProps) => React.JSX.Element;
4
5
  export default Metabase;
@@ -5,7 +5,7 @@ var _templateObject;
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import './index.less';
8
- import { useMemo, useState } from 'react';
8
+ import { useEffect, useMemo, useState } from 'react';
9
9
  import cx from 'classnames';
10
10
  import { Button, Modal, Toast, Space, Tooltip } from '@gingkoo/pandora';
11
11
  import Styled from 'styled-components';
@@ -16,6 +16,7 @@ import modulesMap from '../modules';
16
16
  import Popup from '../popup';
17
17
  import { useStore } from '../../hooks/use-provider';
18
18
  import storage from '../../utils/storage';
19
+ import SqbRightClickMenu, { openSqbRightClickMenu } from '../right-click-menu';
19
20
  var VisualBox = Styled.div.attrs({
20
21
  className: 'visual-box scroller'
21
22
  })(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
@@ -27,7 +28,10 @@ var Metabase = function Metabase(props) {
27
28
  onOk = props.onOk,
28
29
  metabaseCopy = props.metabaseCopy,
29
30
  moduleCopy = props.moduleCopy,
30
- popupZIndex = props.popupZIndex;
31
+ popupZIndex = props.popupZIndex,
32
+ _props$rightClickMenu = props.rightClickMenu,
33
+ rightClickMenu = _props$rightClickMenu === void 0 ? [] : _props$rightClickMenu,
34
+ onRightClickMenuClick = props.onRightClickMenuClick;
31
35
  var store = useStore();
32
36
  var _useState = useState(false),
33
37
  _useState2 = _slicedToArray(_useState, 2),
@@ -144,6 +148,10 @@ var Metabase = function Metabase(props) {
144
148
  return _ref.apply(this, arguments);
145
149
  };
146
150
  }();
151
+ useEffect(function () {
152
+ store.setRightClickMenu(rightClickMenu || []);
153
+ store.setRightClickMenuClick(onRightClickMenuClick);
154
+ }, [rightClickMenu, onRightClickMenuClick]);
147
155
  var copy = function copy() {
148
156
  return _jsxs(Space, {
149
157
  children: [moduleCopy && _jsx(_Fragment, {
@@ -206,6 +214,9 @@ var Metabase = function Metabase(props) {
206
214
  };
207
215
  return _jsx(VisualBox, {
208
216
  ref: store.popupContainer,
217
+ onContextMenu: function onContextMenu(e) {
218
+ return openSqbRightClickMenu(store, e);
219
+ },
209
220
  children: _jsxs("div", {
210
221
  className: 'Sqb',
211
222
  children: [_jsx("div", {
@@ -267,6 +278,8 @@ var Metabase = function Metabase(props) {
267
278
  });
268
279
  },
269
280
  children: popupContent2
281
+ }), _jsx(SqbRightClickMenu, {
282
+ popupZIndex: popupZIndex
270
283
  })]
271
284
  })
272
285
  });
@@ -13,6 +13,40 @@
13
13
  .Sqb {
14
14
  padding: 0 20px 50px;
15
15
  position: relative;
16
+ &-right-click-menu {
17
+ position: fixed;
18
+ min-width: 140px;
19
+ padding: 4px;
20
+ border: 1px solid #d9dee8;
21
+ border-radius: 6px;
22
+ background: #fff;
23
+ box-shadow: 0 8px 24px rgba(31, 35, 41, 0.16);
24
+ }
25
+ &-right-click-menu-item {
26
+ display: block;
27
+ width: 100%;
28
+ min-height: 32px;
29
+ padding: 6px 10px;
30
+ border: 0;
31
+ border-radius: 4px;
32
+ background: transparent;
33
+ color: #1f2329;
34
+ font-size: 14px;
35
+ line-height: 20px;
36
+ text-align: left;
37
+ cursor: pointer;
38
+
39
+ &:hover {
40
+ background: #f4f6f8;
41
+ }
42
+
43
+ &.disabled,
44
+ &:disabled {
45
+ color: #b8bbc3;
46
+ cursor: not-allowed;
47
+ background: transparent;
48
+ }
49
+ }
16
50
  &-fun-btns {
17
51
  position: absolute;
18
52
  left: 0;
@@ -3,5 +3,5 @@ interface WrapperType {
3
3
  children: React.ReactElement;
4
4
  className: string;
5
5
  }
6
- declare const Wrapper: ({ children, className }: WrapperType) => import("react/jsx-runtime").JSX.Element;
6
+ declare const Wrapper: ({ children, className }: WrapperType) => React.JSX.Element;
7
7
  export default Wrapper;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  interface HeaderProps {
2
3
  title: string;
3
4
  className?: string;
@@ -8,5 +9,5 @@ interface HeaderProps {
8
9
  meta?: any;
9
10
  isDataModule?: boolean;
10
11
  }
11
- declare const Header: (props: HeaderProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const Header: (props: HeaderProps) => React.JSX.Element;
12
13
  export default Header;
@@ -4,5 +4,5 @@ interface HeaderProps {
4
4
  isError: boolean;
5
5
  message?: string;
6
6
  }
7
- declare const ItemName: (props: HeaderProps) => import("react/jsx-runtime").JSX.Element;
7
+ declare const ItemName: (props: HeaderProps) => React.JSX.Element;
8
8
  export default ItemName;
@@ -5,5 +5,5 @@ interface HeaderProps {
5
5
  meta?: any;
6
6
  children?: React.ReactNode;
7
7
  }
8
- declare const ItemWrapper: (props: HeaderProps) => string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
8
+ declare const ItemWrapper: (props: HeaderProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
9
9
  export default ItemWrapper;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { TypeEnum } from '../../../store/enum';
2
3
  import { MetaListType } from '../../../store/types';
3
4
  interface PropsType {
@@ -11,5 +12,5 @@ type IconInfoType = {
11
12
  };
12
13
  export declare const IconTypeMap: Map<TypeEnum, IconInfoType>;
13
14
  export declare const findNextIcon: (store: any, props: PropsType) => TypeEnum[];
14
- declare const NextDom: (props: PropsType) => import("react/jsx-runtime").JSX.Element | null;
15
+ declare const NextDom: (props: PropsType) => React.JSX.Element | null;
15
16
  export default NextDom;
@@ -1,8 +1,9 @@
1
+ import React from 'react';
1
2
  import { MetaCustom } from '../../store/types';
2
3
  interface PropsType {
3
4
  store?: any;
4
5
  meta: MetaCustom;
5
6
  groupIndex: number;
6
7
  }
7
- declare const CustomColumn: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
8
+ declare const CustomColumn: (props: PropsType) => React.JSX.Element;
8
9
  export default CustomColumn;
@@ -21,6 +21,7 @@ import NextDom from './components/meta-icon';
21
21
  import Header from './components/header';
22
22
  import ItemWrapper from './components/item-wrapper';
23
23
  import ItemName from './components/item-name';
24
+ import RightClickValue from '../right-click-value';
24
25
  import { getTopLayerZIndex } from '../../utils/helper-dom';
25
26
  import { useStore } from '../../hooks/use-provider';
26
27
  var CustomColumn = function CustomColumn(props) {
@@ -310,20 +311,23 @@ var CustomColumn = function CustomColumn(props) {
310
311
  children: [meta.customColumn.map(function (v, i) {
311
312
  return _jsx(ItemName, {
312
313
  isError: isError(v.formulaList, getColumns()) || isExistsError(v.formulaList, store.existsError),
313
- children: _jsxs("div", {
314
- className: cx("Sqb-TableName gray-name"),
315
- onClick: function onClick(e) {
316
- return showSubQuery(e, i);
317
- },
318
- children: [v.name, _jsx("span", {
319
- style: {
320
- fontSize: 0
321
- },
314
+ children: _jsx(RightClickValue, {
315
+ value: v,
316
+ children: _jsxs("div", {
317
+ className: cx("Sqb-TableName gray-name"),
322
318
  onClick: function onClick(e) {
323
- return handleDel(e, i);
319
+ return showSubQuery(e, i);
324
320
  },
325
- children: _jsx(CloseIcon, {})
326
- })]
321
+ children: [v.name, _jsx("span", {
322
+ style: {
323
+ fontSize: 0
324
+ },
325
+ onClick: function onClick(e) {
326
+ return handleDel(e, i);
327
+ },
328
+ children: _jsx(CloseIcon, {})
329
+ })]
330
+ })
327
331
  })
328
332
  }, i);
329
333
  }), _jsx("div", {
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  import { MetaFilter } from '../../store/types';
2
3
  interface PropsType {
3
4
  meta: MetaFilter;
4
5
  groupIndex: number;
5
6
  }
6
- declare const Filter: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
7
+ declare const Filter: (props: PropsType) => React.JSX.Element;
7
8
  export default Filter;
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  import { MetaJoin } from '../../store/types';
2
3
  interface PropsType {
3
4
  meta: MetaJoin;
4
5
  groupIndex: number;
5
6
  }
6
- declare const JoinData: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
7
+ declare const JoinData: (props: PropsType) => React.JSX.Element;
7
8
  export default JoinData;