@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.
- 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 +13 -8
- 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 +13 -8
- 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
|
@@ -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;
|
|
@@ -26,6 +26,8 @@ var _pandora = require("@gingkoo/pandora");
|
|
|
26
26
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
27
27
|
var _useProvider = require("../../../hooks/use-provider");
|
|
28
28
|
var _helperDom = require("../../../utils/helper-dom");
|
|
29
|
+
var _rightClickValue = require("../../right-click-value");
|
|
30
|
+
var _rightClickMenu = _interopRequireWildcard(require("../../right-click-menu"));
|
|
29
31
|
var _templateObject;
|
|
30
32
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
33
|
var VisualBox = _styledComponents["default"].div.attrs({
|
|
@@ -80,6 +82,11 @@ var CaseEditor = _react["default"].forwardRef(function (props, ref) {
|
|
|
80
82
|
});
|
|
81
83
|
}, [currentFormulaKey, currentFormulaTemplate, effectiveArity]);
|
|
82
84
|
var _ref = (0, _react.useRef)(null);
|
|
85
|
+
var formulaRightClickValueId = (0, _rightClickValue.useRightClickValue)(fun);
|
|
86
|
+
var _useState5 = (0, _react.useState)(null),
|
|
87
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
88
|
+
rightClickMenuState = _useState6[0],
|
|
89
|
+
setRightClickMenuState = _useState6[1];
|
|
83
90
|
var usable = (0, _react.useMemo)(function () {
|
|
84
91
|
return fun.name && (0, _utils.isOk)(fun.args);
|
|
85
92
|
}, [fun]);
|
|
@@ -128,6 +135,9 @@ var CaseEditor = _react["default"].forwardRef(function (props, ref) {
|
|
|
128
135
|
className: (0, _classnames["default"])(props.className, 'function-box'),
|
|
129
136
|
ref: ref,
|
|
130
137
|
children: [(0, _jsxRuntime.jsx)(VisualBox, {
|
|
138
|
+
onContextMenu: function onContextMenu(e) {
|
|
139
|
+
return (0, _rightClickMenu.openSqbRightClickMenu)(store, e, setRightClickMenuState);
|
|
140
|
+
},
|
|
131
141
|
children: (0, _jsxRuntime.jsx)("div", {
|
|
132
142
|
className: "Sqb-item Sqb-case-editor mb-2 mt-2",
|
|
133
143
|
children: (0, _jsxRuntime.jsxs)("div", {
|
|
@@ -159,6 +169,7 @@ var CaseEditor = _react["default"].forwardRef(function (props, ref) {
|
|
|
159
169
|
className: (0, _classnames["default"])("Sqb-TableName Sqb-TableName-OPERATOR", {
|
|
160
170
|
notSelected: !fun.name
|
|
161
171
|
}),
|
|
172
|
+
"data-right-click-id": formulaRightClickValueId,
|
|
162
173
|
children: (0, _utils2.formulaName)(fun, formulaList) || (0, _locale.__)('customColumn.selectFormula')
|
|
163
174
|
});
|
|
164
175
|
},
|
|
@@ -246,6 +257,10 @@ var CaseEditor = _react["default"].forwardRef(function (props, ref) {
|
|
|
246
257
|
})]
|
|
247
258
|
})
|
|
248
259
|
})
|
|
260
|
+
}), (0, _jsxRuntime.jsx)(_rightClickMenu["default"], {
|
|
261
|
+
popupZIndex: (0, _helperDom.getTopLayerZIndex)() + 10,
|
|
262
|
+
state: rightClickMenuState,
|
|
263
|
+
setState: setRightClickMenuState
|
|
249
264
|
}), (0, _jsxRuntime.jsx)("div", {
|
|
250
265
|
className: "btns p-4",
|
|
251
266
|
children: (0, _jsxRuntime.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;
|
|
@@ -37,6 +37,7 @@ var _selectList = _interopRequireDefault(require("../../dialog/select-list"));
|
|
|
37
37
|
var _arrow = _interopRequireDefault(require("./arrow.svg"));
|
|
38
38
|
var _useProvider = require("../../../hooks/use-provider");
|
|
39
39
|
var _itemName = _interopRequireDefault(require("../../modules/components/item-name"));
|
|
40
|
+
var _rightClickValue = _interopRequireDefault(require("../../right-click-value"));
|
|
40
41
|
var _diffViewer = _interopRequireDefault(require("../diff-viewer"));
|
|
41
42
|
var _storage = _interopRequireDefault(require("../../../utils/storage"));
|
|
42
43
|
var _helperDom = require("../../../utils/helper-dom");
|
|
@@ -595,7 +596,8 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
595
596
|
height: '100%',
|
|
596
597
|
fullscreen: true,
|
|
597
598
|
value: sql,
|
|
598
|
-
showLanguage: false
|
|
599
|
+
showLanguage: false,
|
|
600
|
+
matchBrackets: store.matchBrackets
|
|
599
601
|
})
|
|
600
602
|
}),
|
|
601
603
|
onClose: function onClose() {}
|
|
@@ -2179,13 +2181,16 @@ var FormulaList = (0, _react.forwardRef)(function (props, ref) {
|
|
|
2179
2181
|
openCheck: isCheck && !isCompositeAtom
|
|
2180
2182
|
}),
|
|
2181
2183
|
children: itemContent.raw ? itemContent.node : (0, _jsxRuntime.jsx)(_itemName["default"], (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, getItemNameProps(v)), {}, {
|
|
2182
|
-
children: (0, _jsxRuntime.jsx)(
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2184
|
+
children: (0, _jsxRuntime.jsx)(_rightClickValue["default"], {
|
|
2185
|
+
value: v,
|
|
2186
|
+
children: (0, _jsxRuntime.jsx)("div", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
2187
|
+
className: (0, _classnames["default"])('Sqb-TableName', itemContent.className),
|
|
2188
|
+
onClick: itemContent.onClick,
|
|
2189
|
+
style: getTokenStyleByClassName(itemContent.className, itemContent.style)
|
|
2190
|
+
}, itemContent.attrs || {}), {}, {
|
|
2191
|
+
children: itemContent.node
|
|
2192
|
+
}))
|
|
2193
|
+
})
|
|
2189
2194
|
}))
|
|
2190
2195
|
}), showAfterArrow && selectOperator({
|
|
2191
2196
|
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;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -22,7 +23,9 @@ var _modules = _interopRequireDefault(require("../modules"));
|
|
|
22
23
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
23
24
|
var _useProvider = require("../../hooks/use-provider");
|
|
24
25
|
var _storage = _interopRequireDefault(require("../../utils/storage"));
|
|
26
|
+
var _rightClickMenu = _interopRequireWildcard(require("../right-click-menu"));
|
|
25
27
|
var _templateObject;
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
26
29
|
var VisualBox = _styledComponents["default"].div.attrs({
|
|
27
30
|
className: 'visual-box scroller'
|
|
28
31
|
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
@@ -34,7 +37,10 @@ var Metabase = function Metabase(props) {
|
|
|
34
37
|
onOk = props.onOk,
|
|
35
38
|
metabaseCopy = props.metabaseCopy,
|
|
36
39
|
moduleCopy = props.moduleCopy,
|
|
37
|
-
popupZIndex = props.popupZIndex
|
|
40
|
+
popupZIndex = props.popupZIndex,
|
|
41
|
+
_props$rightClickMenu = props.rightClickMenu,
|
|
42
|
+
rightClickMenu = _props$rightClickMenu === void 0 ? [] : _props$rightClickMenu,
|
|
43
|
+
onRightClickMenuClick = props.onRightClickMenuClick;
|
|
38
44
|
var store = (0, _useProvider.useStore)();
|
|
39
45
|
var _useState = (0, _react.useState)(false),
|
|
40
46
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -151,6 +157,10 @@ var Metabase = function Metabase(props) {
|
|
|
151
157
|
return _ref.apply(this, arguments);
|
|
152
158
|
};
|
|
153
159
|
}();
|
|
160
|
+
(0, _react.useEffect)(function () {
|
|
161
|
+
store.setRightClickMenu(rightClickMenu || []);
|
|
162
|
+
store.setRightClickMenuClick(onRightClickMenuClick);
|
|
163
|
+
}, [rightClickMenu, onRightClickMenuClick]);
|
|
154
164
|
var copy = function copy() {
|
|
155
165
|
return (0, _jsxRuntime.jsxs)(_pandora.Space, {
|
|
156
166
|
children: [moduleCopy && (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -213,6 +223,9 @@ var Metabase = function Metabase(props) {
|
|
|
213
223
|
};
|
|
214
224
|
return (0, _jsxRuntime.jsx)(VisualBox, {
|
|
215
225
|
ref: store.popupContainer,
|
|
226
|
+
onContextMenu: function onContextMenu(e) {
|
|
227
|
+
return (0, _rightClickMenu.openSqbRightClickMenu)(store, e);
|
|
228
|
+
},
|
|
216
229
|
children: (0, _jsxRuntime.jsxs)("div", {
|
|
217
230
|
className: 'Sqb',
|
|
218
231
|
children: [(0, _jsxRuntime.jsx)("div", {
|
|
@@ -274,6 +287,8 @@ var Metabase = function Metabase(props) {
|
|
|
274
287
|
});
|
|
275
288
|
},
|
|
276
289
|
children: popupContent2
|
|
290
|
+
}), (0, _jsxRuntime.jsx)(_rightClickMenu["default"], {
|
|
291
|
+
popupZIndex: popupZIndex
|
|
277
292
|
})]
|
|
278
293
|
})
|
|
279
294
|
});
|
|
@@ -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;
|
|
@@ -26,6 +26,7 @@ var _metaIcon = _interopRequireDefault(require("./components/meta-icon"));
|
|
|
26
26
|
var _header = _interopRequireDefault(require("./components/header"));
|
|
27
27
|
var _itemWrapper = _interopRequireDefault(require("./components/item-wrapper"));
|
|
28
28
|
var _itemName = _interopRequireDefault(require("./components/item-name"));
|
|
29
|
+
var _rightClickValue = _interopRequireDefault(require("../right-click-value"));
|
|
29
30
|
var _helperDom = require("../../utils/helper-dom");
|
|
30
31
|
var CustomColumn = function CustomColumn(props) {
|
|
31
32
|
var meta = props.meta,
|
|
@@ -314,20 +315,23 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
314
315
|
children: [meta.customColumn.map(function (v, i) {
|
|
315
316
|
return (0, _jsxRuntime.jsx)(_itemName["default"], {
|
|
316
317
|
isError: (0, _utils.isError)(v.formulaList, getColumns()) || (0, _utils.isExistsError)(v.formulaList, store.existsError),
|
|
317
|
-
children: (0, _jsxRuntime.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
children: [v.name, (0, _jsxRuntime.jsx)("span", {
|
|
323
|
-
style: {
|
|
324
|
-
fontSize: 0
|
|
325
|
-
},
|
|
318
|
+
children: (0, _jsxRuntime.jsx)(_rightClickValue["default"], {
|
|
319
|
+
value: v,
|
|
320
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
|
321
|
+
className: (0, _classnames["default"])("Sqb-TableName gray-name"),
|
|
326
322
|
onClick: function onClick(e) {
|
|
327
|
-
return
|
|
323
|
+
return showSubQuery(e, i);
|
|
328
324
|
},
|
|
329
|
-
children: (0, _jsxRuntime.jsx)(
|
|
330
|
-
|
|
325
|
+
children: [v.name, (0, _jsxRuntime.jsx)("span", {
|
|
326
|
+
style: {
|
|
327
|
+
fontSize: 0
|
|
328
|
+
},
|
|
329
|
+
onClick: function onClick(e) {
|
|
330
|
+
return handleDel(e, i);
|
|
331
|
+
},
|
|
332
|
+
children: (0, _jsxRuntime.jsx)(_icons.CloseIcon, {})
|
|
333
|
+
})]
|
|
334
|
+
})
|
|
331
335
|
})
|
|
332
336
|
}, i);
|
|
333
337
|
}), (0, _jsxRuntime.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) =>
|
|
7
|
+
declare const Filter: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default Filter;
|