@gingkoo/pandora-metabase 1.0.145 → 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.
- package/lib/cjs/common/Loading/index.d.ts +2 -1
- package/lib/cjs/components/dialog/custom-column/dialog/function-tip.d.ts +2 -1
- package/lib/cjs/components/dialog/custom-column/dialog/select-list.d.ts +2 -1
- package/lib/cjs/components/dialog/custom-column/expression-editor.d.ts +2 -1
- package/lib/cjs/components/dialog/custom-column/index.d.ts +2 -1
- package/lib/cjs/components/dialog/custom-column/tokenized-expression.d.ts +1 -1
- package/lib/cjs/components/dialog/custom-editor/index.d.ts +2 -1
- package/lib/cjs/components/dialog/expression/index.d.ts +2 -1
- package/lib/cjs/components/dialog/formula/index.js +15 -0
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +1 -1
- package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +1 -1
- package/lib/cjs/components/dialog/formula-list/index.js +21 -11
- package/lib/cjs/components/dialog/formula-list/index.less +8 -2
- package/lib/cjs/components/dialog/select-column/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-join/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-join-column/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-join-column-multiple/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-list/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-permission-table/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-summarize/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-table/index.d.ts +2 -1
- package/lib/cjs/components/icons.d.ts +30 -29
- package/lib/cjs/components/metabase/index.d.ts +2 -1
- package/lib/cjs/components/metabase/index.js +16 -1
- package/lib/cjs/components/metabase/index.less +34 -0
- package/lib/cjs/components/modules/components/Wrapper.d.ts +1 -1
- package/lib/cjs/components/modules/components/header.d.ts +2 -1
- package/lib/cjs/components/modules/components/item-name.d.ts +1 -1
- package/lib/cjs/components/modules/components/item-wrapper.d.ts +1 -1
- package/lib/cjs/components/modules/components/meta-icon.d.ts +2 -1
- package/lib/cjs/components/modules/custom-column.d.ts +2 -1
- package/lib/cjs/components/modules/custom-column.js +16 -12
- package/lib/cjs/components/modules/filter.d.ts +2 -1
- package/lib/cjs/components/modules/join-data.d.ts +2 -1
- package/lib/cjs/components/modules/join-data.js +132 -113
- package/lib/cjs/components/modules/permission-table.d.ts +2 -1
- package/lib/cjs/components/modules/row-limit.d.ts +2 -1
- package/lib/cjs/components/modules/sort.d.ts +2 -1
- package/lib/cjs/components/modules/sort.js +18 -14
- package/lib/cjs/components/modules/summarize/group-by.d.ts +2 -1
- package/lib/cjs/components/modules/summarize/group-by.js +32 -28
- package/lib/cjs/components/modules/summarize/index.d.ts +2 -1
- package/lib/cjs/components/modules/summarize/select-index.d.ts +2 -1
- package/lib/cjs/components/modules/summarize/select-index.js +32 -28
- package/lib/cjs/components/modules/table-data.d.ts +2 -1
- package/lib/cjs/components/modules/table-data.js +53 -46
- package/lib/cjs/components/modules/union.d.ts +2 -1
- package/lib/cjs/components/popup.d.ts +1 -1
- package/lib/cjs/components/right-click-menu.d.ts +16 -0
- package/lib/cjs/components/right-click-menu.js +179 -0
- package/lib/cjs/components/right-click-value.d.ts +8 -0
- package/lib/cjs/components/right-click-value.js +33 -0
- package/lib/cjs/hooks/use-provider.d.ts +1 -1
- package/lib/cjs/hooks/use-state.js +62 -22
- package/lib/cjs/index.d.ts +2 -2
- package/lib/cjs/index.js +4 -1
- package/lib/cjs/types.d.ts +17 -0
- package/lib/es/common/Loading/index.d.ts +2 -1
- package/lib/es/components/dialog/custom-column/dialog/function-tip.d.ts +2 -1
- package/lib/es/components/dialog/custom-column/dialog/select-list.d.ts +2 -1
- package/lib/es/components/dialog/custom-column/expression-editor.d.ts +2 -1
- package/lib/es/components/dialog/custom-column/index.d.ts +2 -1
- package/lib/es/components/dialog/custom-column/tokenized-expression.d.ts +1 -1
- package/lib/es/components/dialog/custom-editor/index.d.ts +2 -1
- package/lib/es/components/dialog/expression/index.d.ts +2 -1
- package/lib/es/components/dialog/formula/index.js +15 -0
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +1 -1
- package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +1 -1
- package/lib/es/components/dialog/formula-list/index.js +22 -12
- package/lib/es/components/dialog/formula-list/index.less +8 -2
- package/lib/es/components/dialog/select-column/index.d.ts +2 -1
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +2 -1
- package/lib/es/components/dialog/select-join/index.d.ts +2 -1
- package/lib/es/components/dialog/select-join-column/index.d.ts +2 -1
- package/lib/es/components/dialog/select-join-column-multiple/index.d.ts +2 -1
- package/lib/es/components/dialog/select-list/index.d.ts +2 -1
- package/lib/es/components/dialog/select-permission-table/index.d.ts +2 -1
- package/lib/es/components/dialog/select-summarize/index.d.ts +2 -1
- package/lib/es/components/dialog/select-table/index.d.ts +2 -1
- package/lib/es/components/icons.d.ts +30 -29
- package/lib/es/components/metabase/index.d.ts +2 -1
- package/lib/es/components/metabase/index.js +15 -2
- package/lib/es/components/metabase/index.less +34 -0
- package/lib/es/components/modules/components/Wrapper.d.ts +1 -1
- package/lib/es/components/modules/components/header.d.ts +2 -1
- package/lib/es/components/modules/components/item-name.d.ts +1 -1
- package/lib/es/components/modules/components/item-wrapper.d.ts +1 -1
- package/lib/es/components/modules/components/meta-icon.d.ts +2 -1
- package/lib/es/components/modules/custom-column.d.ts +2 -1
- package/lib/es/components/modules/custom-column.js +16 -12
- package/lib/es/components/modules/filter.d.ts +2 -1
- package/lib/es/components/modules/join-data.d.ts +2 -1
- package/lib/es/components/modules/join-data.js +132 -113
- package/lib/es/components/modules/permission-table.d.ts +2 -1
- package/lib/es/components/modules/row-limit.d.ts +2 -1
- package/lib/es/components/modules/sort.d.ts +2 -1
- package/lib/es/components/modules/sort.js +18 -14
- package/lib/es/components/modules/summarize/group-by.d.ts +2 -1
- package/lib/es/components/modules/summarize/group-by.js +32 -28
- package/lib/es/components/modules/summarize/index.d.ts +2 -1
- package/lib/es/components/modules/summarize/select-index.d.ts +2 -1
- package/lib/es/components/modules/summarize/select-index.js +32 -28
- package/lib/es/components/modules/table-data.d.ts +2 -1
- package/lib/es/components/modules/table-data.js +53 -46
- package/lib/es/components/modules/union.d.ts +2 -1
- package/lib/es/components/popup.d.ts +1 -1
- package/lib/es/components/right-click-menu.d.ts +16 -0
- package/lib/es/components/right-click-menu.js +172 -0
- package/lib/es/components/right-click-value.d.ts +8 -0
- package/lib/es/components/right-click-value.js +25 -0
- package/lib/es/hooks/use-provider.d.ts +1 -1
- package/lib/es/hooks/use-state.js +62 -22
- package/lib/es/index.d.ts +2 -2
- package/lib/es/index.js +4 -1
- package/lib/es/types.d.ts +17 -0
- package/package.json +2 -2
package/lib/cjs/types.d.ts
CHANGED
|
@@ -26,6 +26,20 @@ export interface FormulaDiffCodeParams {
|
|
|
26
26
|
oldCode: AtomsItem[];
|
|
27
27
|
newCode: AtomsItem[];
|
|
28
28
|
}
|
|
29
|
+
export interface MetabaseRightClickMenuItem {
|
|
30
|
+
label: React.ReactNode;
|
|
31
|
+
value: React.Key;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface MetabaseRightClickMenuClickParams {
|
|
36
|
+
item: any;
|
|
37
|
+
itemText: string;
|
|
38
|
+
menuValue: React.Key;
|
|
39
|
+
menuItem: MetabaseRightClickMenuItem;
|
|
40
|
+
data: MetaListType[];
|
|
41
|
+
target?: HTMLElement;
|
|
42
|
+
}
|
|
29
43
|
export interface MetabaseProps {
|
|
30
44
|
loading?: boolean;
|
|
31
45
|
btnText?: string;
|
|
@@ -69,6 +83,9 @@ export interface MetabaseProps {
|
|
|
69
83
|
moduleCopy?: boolean;
|
|
70
84
|
showFormulaSql?: boolean;
|
|
71
85
|
showFormulaDiff?: boolean;
|
|
86
|
+
matchBrackets?: boolean;
|
|
87
|
+
rightClickMenu?: MetabaseRightClickMenuItem[];
|
|
88
|
+
onRightClickMenuClick?: (params: MetabaseRightClickMenuClickParams) => boolean | void | Promise<boolean | void>;
|
|
72
89
|
joinAliasConflictCheck?: boolean;
|
|
73
90
|
getModuleDiffCode?: (obj: {
|
|
74
91
|
oldCode: MetaListType;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './function-tip.less';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
funcName: string;
|
|
4
5
|
didUpdate?: Function;
|
|
5
6
|
}
|
|
6
|
-
declare const FunctionTip: ({ funcName }: PropsType) =>
|
|
7
|
+
declare const FunctionTip: ({ funcName }: PropsType) => React.JSX.Element | null;
|
|
7
8
|
export default FunctionTip;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './select-list.less';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { OptionsTypeEnum } from '../expressions/suggest';
|
|
3
4
|
export interface ListProps {
|
|
4
5
|
type: OptionsTypeEnum;
|
|
@@ -10,5 +11,5 @@ export interface PropsType {
|
|
|
10
11
|
onSelect: (type: OptionsTypeEnum, val: string) => any;
|
|
11
12
|
didUpdate?: Function;
|
|
12
13
|
}
|
|
13
|
-
declare const SelectList: ({ data, onSelect }: PropsType) =>
|
|
14
|
+
declare const SelectList: ({ data, onSelect }: PropsType) => React.JSX.Element;
|
|
14
15
|
export default SelectList;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaData_ColumnsType } from '../../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
store?: any;
|
|
@@ -5,5 +6,5 @@ interface PropsType {
|
|
|
5
6
|
expression: string;
|
|
6
7
|
onChange: (formula: string) => void;
|
|
7
8
|
}
|
|
8
|
-
declare const ExpressionEditor: (props: PropsType) =>
|
|
9
|
+
declare const ExpressionEditor: (props: PropsType) => React.JSX.Element;
|
|
9
10
|
export default ExpressionEditor;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './index.less';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { MetaCustom_Item, MetaData_ColumnsType } from '../../../store/types';
|
|
3
4
|
interface PropsType {
|
|
4
5
|
value: MetaCustom_Item;
|
|
@@ -6,5 +7,5 @@ interface PropsType {
|
|
|
6
7
|
onChange: (record: MetaCustom_Item) => void;
|
|
7
8
|
onClose: Function;
|
|
8
9
|
}
|
|
9
|
-
declare const CustomColumn: ({ value, data, onChange, onClose }: PropsType) =>
|
|
10
|
+
declare const CustomColumn: ({ value, data, onChange, onClose }: PropsType) => React.JSX.Element;
|
|
10
11
|
export default CustomColumn;
|
|
@@ -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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
12
|
+
declare const LogicGroup: ({ items, onChangeOperator, onAddItem, onDeleteItem, onDelete, }: Props) => React.JSX.Element;
|
|
13
13
|
export default LogicGroup;
|
|
@@ -21,7 +21,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
21
21
|
import { getObjTem, getQuotes, formulaIsError } from '../formula/utils';
|
|
22
22
|
import { AtomsTypeEnum, FormulaTypeEnum } from '../../../store/types';
|
|
23
23
|
import { ColumnsPopupThemeEnum } from '../../../store/enum';
|
|
24
|
-
import { Select, Input, Modal2, Modal, InputNumber, Space, Button, Checkbox, Tooltip,
|
|
24
|
+
import { Select, Input, Modal2, Modal, InputNumber, Space, Button, Checkbox, Tooltip, Toast, Editor } from '@gingkoo/pandora';
|
|
25
25
|
import cloneDeep from 'lodash/cloneDeep';
|
|
26
26
|
import { buildSqlQuery, isError, changeCopyField, isExistsError, normalizeAndOrStructure } from '../../../utils';
|
|
27
27
|
import Formula from '../formula';
|
|
@@ -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';
|
|
@@ -576,12 +577,18 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
576
577
|
openChildModal({
|
|
577
578
|
title: '查看SQL',
|
|
578
579
|
transparentMask: true,
|
|
580
|
+
className: 'Sqb-FormulaSqlPreviewModal',
|
|
579
581
|
content: _jsx("div", {
|
|
580
|
-
className: 'Sqb-FormulaSqlPreview
|
|
581
|
-
children: _jsx(
|
|
582
|
-
|
|
582
|
+
className: 'Sqb-FormulaSqlPreview ',
|
|
583
|
+
children: _jsx(Editor, {
|
|
584
|
+
showFull: false,
|
|
585
|
+
className: 'Sqb-FormulaSqlPreviewEditor',
|
|
583
586
|
language: 'sql',
|
|
584
|
-
|
|
587
|
+
height: '100%',
|
|
588
|
+
fullscreen: true,
|
|
589
|
+
value: sql,
|
|
590
|
+
showLanguage: false,
|
|
591
|
+
matchBrackets: store.matchBrackets
|
|
585
592
|
})
|
|
586
593
|
}),
|
|
587
594
|
onClose: function onClose() {}
|
|
@@ -2165,13 +2172,16 @@ var FormulaList = forwardRef(function (props, ref) {
|
|
|
2165
2172
|
openCheck: isCheck && !isCompositeAtom
|
|
2166
2173
|
}),
|
|
2167
2174
|
children: itemContent.raw ? itemContent.node : _jsx(ItemName, _objectSpread(_objectSpread({}, getItemNameProps(v)), {}, {
|
|
2168
|
-
children: _jsx(
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
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
|
+
})
|
|
2175
2185
|
}))
|
|
2176
2186
|
}), showAfterArrow && selectOperator({
|
|
2177
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
7
|
-
export declare const FilterIcon: ({ width, height }: IconProps) =>
|
|
8
|
-
export declare const SummarizeIcon: ({ width, height }: IconProps) =>
|
|
9
|
-
export declare const JoinDataIcon: ({ width, height }: IconProps) =>
|
|
10
|
-
export declare const GroupIcon: ({ width, height }: IconProps) =>
|
|
11
|
-
export declare const PermissionTableIcon: ({ width, height }: IconProps) =>
|
|
12
|
-
export declare const CustomColumnIcon: ({ width, height }: IconProps) =>
|
|
13
|
-
export declare const SortIcon: ({ width, height }: IconProps) =>
|
|
14
|
-
export declare const RowLimitIcon: ({ width, height }: IconProps) =>
|
|
15
|
-
export declare const LeftJoinIcon: ({ width, height, style }: IconProps) =>
|
|
16
|
-
export declare const InnerJoinIcon: ({ width, height, style }: IconProps) =>
|
|
17
|
-
export declare const UpArrowIcon: ({ width, height }: IconProps) =>
|
|
18
|
-
export declare const DownArrowIcon: ({ width, height }: IconProps) =>
|
|
19
|
-
export declare const CloseIcon: ({ width, height }: IconProps) =>
|
|
20
|
-
export declare const AddIcon: ({ width, height }: IconProps) =>
|
|
21
|
-
export declare const TableIcon: ({ width, height }: IconProps) =>
|
|
22
|
-
export declare const SearchIcon: ({ width, height }: IconProps) =>
|
|
23
|
-
export declare const NotSelectIcon: () =>
|
|
24
|
-
export declare const SelectIcon: () =>
|
|
25
|
-
export declare const CircleIcon: () =>
|
|
26
|
-
export declare const LetterAaIcon: () =>
|
|
27
|
-
export declare const CalendarIcon: () =>
|
|
28
|
-
export declare const WellIcon: () =>
|
|
29
|
-
export declare const ForeignKeyIcon: () =>
|
|
30
|
-
export declare const UpArrowIcon2: () =>
|
|
31
|
-
export declare const DownArrowIcon2: () =>
|
|
32
|
-
export declare const LeftArrowIcon: () =>
|
|
33
|
-
export declare const RightArrowIcon: () =>
|
|
34
|
-
export declare const DataSourceIcon: () =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
12
|
+
declare const Header: (props: HeaderProps) => React.JSX.Element;
|
|
12
13
|
export default Header;
|
|
@@ -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> |
|
|
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) =>
|
|
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) =>
|
|
8
|
+
declare const CustomColumn: (props: PropsType) => React.JSX.Element;
|
|
8
9
|
export default CustomColumn;
|