@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
|
@@ -24,6 +24,7 @@ var _utils = require("../../utils");
|
|
|
24
24
|
var _pandoraIcons = require("@gingkoo/pandora-icons");
|
|
25
25
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
26
26
|
var _itemName = _interopRequireDefault(require("./components/item-name"));
|
|
27
|
+
var _rightClickValue = _interopRequireDefault(require("../right-click-value"));
|
|
27
28
|
var _dialog = require("../dialog");
|
|
28
29
|
var _Wrapper = _interopRequireDefault(require("./components/Wrapper"));
|
|
29
30
|
var _metaIcon = _interopRequireDefault(require("./components/meta-icon"));
|
|
@@ -298,14 +299,58 @@ var TableData = function TableData(props) {
|
|
|
298
299
|
className: "Sqb-NotebookCell",
|
|
299
300
|
children: [meta.isSubquery ? (0, _jsxRuntime.jsx)(_itemName["default"], {
|
|
300
301
|
isError: (0, _utils.isExistsError)(meta.subquery || [], store.existsError),
|
|
302
|
+
children: (0, _jsxRuntime.jsx)(_rightClickValue["default"], {
|
|
303
|
+
value: meta,
|
|
304
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
|
305
|
+
className: (0, _classnames["default"])("Sqb-TableName", {
|
|
306
|
+
notSelected: !subQuerySelected
|
|
307
|
+
}),
|
|
308
|
+
onClick: function onClick() {
|
|
309
|
+
showSubQuery(meta.subquery);
|
|
310
|
+
},
|
|
311
|
+
children: [subQuerySelected && (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
312
|
+
children: function () {
|
|
313
|
+
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
314
|
+
var icon = isDel ? (0, _jsxRuntime.jsx)(_pandoraIcons.ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
315
|
+
return showButton ? (0, _jsxRuntime.jsx)(_pandora.Tooltip, {
|
|
316
|
+
title: (0, _locale.__)(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
317
|
+
children: (0, _jsxRuntime.jsx)(_pandora.Button, {
|
|
318
|
+
danger: tableIsError(),
|
|
319
|
+
className: (0, _classnames["default"])(':Sqb-TableName-as', {
|
|
320
|
+
isError: tableIsError()
|
|
321
|
+
}),
|
|
322
|
+
shape: 'circle',
|
|
323
|
+
style: isDel ? {
|
|
324
|
+
fontSize: 18,
|
|
325
|
+
backgroundColor: '#fff',
|
|
326
|
+
width: 'auto',
|
|
327
|
+
height: 'auto'
|
|
328
|
+
} : {},
|
|
329
|
+
iconOnly: true,
|
|
330
|
+
primary: !isDel,
|
|
331
|
+
icon: icon,
|
|
332
|
+
size: 'small',
|
|
333
|
+
onClick: function onClick(e) {
|
|
334
|
+
if (store.tableEnableAlias) {
|
|
335
|
+
var _meta$table3;
|
|
336
|
+
e.stopPropagation();
|
|
337
|
+
onChangeTableAlias(((_meta$table3 = meta.table) === null || _meta$table3 === void 0 ? void 0 : _meta$table3.alias) || '');
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
})
|
|
341
|
+
}) : null;
|
|
342
|
+
}()
|
|
343
|
+
}), subQuerySelected ? "".concat(((_meta$subquery2 = meta.subquery) === null || _meta$subquery2 === void 0 ? void 0 : _meta$subquery2[0]).table.datasourceName, ".").concat(((_meta$subquery3 = meta.subquery) === null || _meta$subquery3 === void 0 ? void 0 : _meta$subquery3[0]).table.name, " ").concat((_meta$table4 = meta.table) !== null && _meta$table4 !== void 0 && _meta$table4.alias && store.tableEnableAlias ? "as ".concat((_meta$table5 = meta.table) === null || _meta$table5 === void 0 ? void 0 : _meta$table5.alias) : '', " ") : (0, _locale.__)('SqlQueryBuilder.setSubQuery')]
|
|
344
|
+
})
|
|
345
|
+
})
|
|
346
|
+
}) : (0, _jsxRuntime.jsx)(_rightClickValue["default"], {
|
|
347
|
+
value: meta.table,
|
|
301
348
|
children: (0, _jsxRuntime.jsxs)("div", {
|
|
302
349
|
className: (0, _classnames["default"])("Sqb-TableName", {
|
|
303
|
-
notSelected: !
|
|
350
|
+
notSelected: !selected
|
|
304
351
|
}),
|
|
305
|
-
onClick:
|
|
306
|
-
|
|
307
|
-
},
|
|
308
|
-
children: [subQuerySelected && (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
352
|
+
onClick: selectTable,
|
|
353
|
+
children: [selected && (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
309
354
|
children: function () {
|
|
310
355
|
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
311
356
|
var icon = isDel ? (0, _jsxRuntime.jsx)(_pandoraIcons.ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
@@ -329,54 +374,16 @@ var TableData = function TableData(props) {
|
|
|
329
374
|
size: 'small',
|
|
330
375
|
onClick: function onClick(e) {
|
|
331
376
|
if (store.tableEnableAlias) {
|
|
332
|
-
var _meta$
|
|
377
|
+
var _meta$table6;
|
|
333
378
|
e.stopPropagation();
|
|
334
|
-
onChangeTableAlias(((_meta$
|
|
379
|
+
onChangeTableAlias(((_meta$table6 = meta.table) === null || _meta$table6 === void 0 ? void 0 : _meta$table6.alias) || '');
|
|
335
380
|
}
|
|
336
381
|
}
|
|
337
382
|
})
|
|
338
383
|
}) : null;
|
|
339
384
|
}()
|
|
340
|
-
}),
|
|
385
|
+
}), selected ? "".concat(meta.table.datasourceName, ".").concat(meta.table.name, " ").concat((_meta$table7 = meta.table) !== null && _meta$table7 !== void 0 && _meta$table7.alias && store.tableEnableAlias ? "as ".concat((_meta$table8 = meta.table) === null || _meta$table8 === void 0 ? void 0 : _meta$table8.alias) : '') : (0, _locale.__)('SqlQueryBuilder.pickTable')]
|
|
341
386
|
})
|
|
342
|
-
}) : (0, _jsxRuntime.jsxs)("div", {
|
|
343
|
-
className: (0, _classnames["default"])("Sqb-TableName", {
|
|
344
|
-
notSelected: !selected
|
|
345
|
-
}),
|
|
346
|
-
onClick: selectTable,
|
|
347
|
-
children: [selected && (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
348
|
-
children: function () {
|
|
349
|
-
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
350
|
-
var icon = isDel ? (0, _jsxRuntime.jsx)(_pandoraIcons.ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
351
|
-
return showButton ? (0, _jsxRuntime.jsx)(_pandora.Tooltip, {
|
|
352
|
-
title: (0, _locale.__)(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
353
|
-
children: (0, _jsxRuntime.jsx)(_pandora.Button, {
|
|
354
|
-
danger: tableIsError(),
|
|
355
|
-
className: (0, _classnames["default"])(':Sqb-TableName-as', {
|
|
356
|
-
isError: tableIsError()
|
|
357
|
-
}),
|
|
358
|
-
shape: 'circle',
|
|
359
|
-
style: isDel ? {
|
|
360
|
-
fontSize: 18,
|
|
361
|
-
backgroundColor: '#fff',
|
|
362
|
-
width: 'auto',
|
|
363
|
-
height: 'auto'
|
|
364
|
-
} : {},
|
|
365
|
-
iconOnly: true,
|
|
366
|
-
primary: !isDel,
|
|
367
|
-
icon: icon,
|
|
368
|
-
size: 'small',
|
|
369
|
-
onClick: function onClick(e) {
|
|
370
|
-
if (store.tableEnableAlias) {
|
|
371
|
-
var _meta$table6;
|
|
372
|
-
e.stopPropagation();
|
|
373
|
-
onChangeTableAlias(((_meta$table6 = meta.table) === null || _meta$table6 === void 0 ? void 0 : _meta$table6.alias) || '');
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
})
|
|
377
|
-
}) : null;
|
|
378
|
-
}()
|
|
379
|
-
}), selected ? "".concat(meta.table.datasourceName, ".").concat(meta.table.name, " ").concat((_meta$table7 = meta.table) !== null && _meta$table7 !== void 0 && _meta$table7.alias && store.tableEnableAlias ? "as ".concat((_meta$table8 = meta.table) === null || _meta$table8 === void 0 ? void 0 : _meta$table8.alias) : '') : (0, _locale.__)('SqlQueryBuilder.pickTable')]
|
|
380
387
|
}), store.showSubquery && (0, _jsxRuntime.jsx)(_pandora.Tooltip, {
|
|
381
388
|
title: (0, _locale.__)('SqlQueryBuilder.switchSubQuery'),
|
|
382
389
|
children: (0, _jsxRuntime.jsx)(_pandora.Button, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { UnionEnum } from '../../store/enum';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
store?: any;
|
|
@@ -5,5 +6,5 @@ interface PropsType {
|
|
|
5
6
|
union: UnionEnum;
|
|
6
7
|
groupIndex: number;
|
|
7
8
|
}
|
|
8
|
-
declare const RowLimit: (props: PropsType) =>
|
|
9
|
+
declare const RowLimit: (props: PropsType) => React.JSX.Element;
|
|
9
10
|
export default RowLimit;
|
|
@@ -41,7 +41,7 @@ declare class TriggerInternal extends React.Component<PropsType, StateType> {
|
|
|
41
41
|
private getContainer;
|
|
42
42
|
private getComponent;
|
|
43
43
|
private didUpdate;
|
|
44
|
-
render():
|
|
44
|
+
render(): React.JSX.Element | null;
|
|
45
45
|
}
|
|
46
46
|
export declare function generateTrigger(PortalComponent: any): typeof TriggerInternal;
|
|
47
47
|
declare const _default: typeof TriggerInternal;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type RightClickMenuState = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
item: any;
|
|
6
|
+
itemText: string;
|
|
7
|
+
target: HTMLElement;
|
|
8
|
+
};
|
|
9
|
+
export declare const openSqbRightClickMenu: (store: any, event: React.MouseEvent<HTMLElement>, setMenuState?: (state: RightClickMenuState | null) => void) => void;
|
|
10
|
+
interface SqbRightClickMenuProps {
|
|
11
|
+
popupZIndex?: number;
|
|
12
|
+
state?: RightClickMenuState | null;
|
|
13
|
+
setState?: (state: RightClickMenuState | null) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const SqbRightClickMenu: ({ popupZIndex, state, setState }: SqbRightClickMenuProps) => React.JSX.Element | null;
|
|
16
|
+
export default SqbRightClickMenu;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.openSqbRightClickMenu = exports["default"] = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/typeof"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
var _utils = require("../utils");
|
|
15
|
+
var _useProvider = require("../hooks/use-provider");
|
|
16
|
+
var findRightClickTarget = function findRightClickTarget(target) {
|
|
17
|
+
var element = target instanceof HTMLElement ? target : null;
|
|
18
|
+
while (element) {
|
|
19
|
+
var _element$classList, _element$classList2, _element$classList3;
|
|
20
|
+
if ((_element$classList = element.classList) !== null && _element$classList !== void 0 && _element$classList.contains('Sqb-TableName') || (_element$classList2 = element.classList) !== null && _element$classList2 !== void 0 && _element$classList2.contains(':Sqb-TableName') && !((_element$classList3 = element.classList) !== null && _element$classList3 !== void 0 && _element$classList3.contains('operator-trigger'))) {
|
|
21
|
+
return element;
|
|
22
|
+
}
|
|
23
|
+
element = element.parentElement;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
var getRightClickTriggerText = function getRightClickTriggerText(element) {
|
|
28
|
+
return (element.innerText || '').replace(/\s+/g, ' ').trim();
|
|
29
|
+
};
|
|
30
|
+
var getRightClickTriggerValue = function getRightClickTriggerValue(store, element, triggerText) {
|
|
31
|
+
var valueId = element.getAttribute('data-right-click-id');
|
|
32
|
+
if (valueId) {
|
|
33
|
+
var registeredValue = store.getRightClickButtonValue(valueId);
|
|
34
|
+
if (registeredValue !== undefined && registeredValue !== null) {
|
|
35
|
+
return registeredValue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return triggerText;
|
|
39
|
+
};
|
|
40
|
+
var isEmptyRightClickTriggerValue = function isEmptyRightClickTriggerValue(value) {
|
|
41
|
+
if (value === undefined || value === null) return true;
|
|
42
|
+
if (typeof value === 'string') return !value.trim();
|
|
43
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
44
|
+
if ((0, _typeof2["default"])(value) === 'object') {
|
|
45
|
+
if (value.type === 'exists' || value.type === 'notExists') {
|
|
46
|
+
return !Array.isArray(value.notExists) || value.notExists.length === 0;
|
|
47
|
+
}
|
|
48
|
+
if (value.type === 'FORMULA') {
|
|
49
|
+
return !String(value.name || '').trim();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
54
|
+
var openSqbRightClickMenu = exports.openSqbRightClickMenu = function openSqbRightClickMenu(store, event, setMenuState) {
|
|
55
|
+
var _store$getRightClickM;
|
|
56
|
+
var rightClickMenu = store.rightClickMenu || [];
|
|
57
|
+
var onRightClickMenuClick = (_store$getRightClickM = store.getRightClickMenuClick) === null || _store$getRightClickM === void 0 ? void 0 : _store$getRightClickM.call(store);
|
|
58
|
+
var setState = setMenuState || store.setRightClickMenuState;
|
|
59
|
+
if (!Array.isArray(rightClickMenu) || rightClickMenu.length === 0 || typeof onRightClickMenuClick !== 'function') {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
var target = findRightClickTarget(event.target);
|
|
63
|
+
if (!target || target.classList.contains('notSelected')) {
|
|
64
|
+
setState(null);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
var itemText = getRightClickTriggerText(target);
|
|
68
|
+
var item = getRightClickTriggerValue(store, target, itemText);
|
|
69
|
+
if (isEmptyRightClickTriggerValue(item)) {
|
|
70
|
+
setState(null);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
setState({
|
|
76
|
+
x: event.clientX,
|
|
77
|
+
y: event.clientY,
|
|
78
|
+
item: item,
|
|
79
|
+
itemText: itemText,
|
|
80
|
+
target: target
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
var SqbRightClickMenu = function SqbRightClickMenu(_ref) {
|
|
84
|
+
var popupZIndex = _ref.popupZIndex,
|
|
85
|
+
state = _ref.state,
|
|
86
|
+
setState = _ref.setState;
|
|
87
|
+
var store = (0, _useProvider.useStore)();
|
|
88
|
+
var _store$rightClickMenu = store.rightClickMenu,
|
|
89
|
+
rightClickMenu = _store$rightClickMenu === void 0 ? [] : _store$rightClickMenu;
|
|
90
|
+
var rightClickMenuState = state === undefined ? store.rightClickMenuState : state;
|
|
91
|
+
var setRightClickMenuState = setState || store.setRightClickMenuState;
|
|
92
|
+
var handleRightClickMenuItem = function () {
|
|
93
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(menuItem) {
|
|
94
|
+
var _store$getRightClickM2;
|
|
95
|
+
var onRightClickMenuClick, shouldClose;
|
|
96
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
97
|
+
while (1) switch (_context.prev = _context.next) {
|
|
98
|
+
case 0:
|
|
99
|
+
if (!(!rightClickMenuState || menuItem.disabled)) {
|
|
100
|
+
_context.next = 1;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
return _context.abrupt("return");
|
|
104
|
+
case 1:
|
|
105
|
+
onRightClickMenuClick = (_store$getRightClickM2 = store.getRightClickMenuClick) === null || _store$getRightClickM2 === void 0 ? void 0 : _store$getRightClickM2.call(store);
|
|
106
|
+
if (!(typeof onRightClickMenuClick !== 'function')) {
|
|
107
|
+
_context.next = 2;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
return _context.abrupt("return");
|
|
111
|
+
case 2:
|
|
112
|
+
_context.next = 3;
|
|
113
|
+
return onRightClickMenuClick({
|
|
114
|
+
item: rightClickMenuState.item,
|
|
115
|
+
itemText: rightClickMenuState.itemText,
|
|
116
|
+
menuValue: menuItem.value,
|
|
117
|
+
menuItem: menuItem,
|
|
118
|
+
data: (0, _utils.normalizeLegacySummarizeForSave)((0, _utils.splitByUnion)(store.metaList)),
|
|
119
|
+
target: rightClickMenuState.target
|
|
120
|
+
});
|
|
121
|
+
case 3:
|
|
122
|
+
shouldClose = _context.sent;
|
|
123
|
+
if (shouldClose === true) {
|
|
124
|
+
setRightClickMenuState(null);
|
|
125
|
+
}
|
|
126
|
+
case 4:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}, _callee);
|
|
131
|
+
}));
|
|
132
|
+
return function handleRightClickMenuItem(_x) {
|
|
133
|
+
return _ref2.apply(this, arguments);
|
|
134
|
+
};
|
|
135
|
+
}();
|
|
136
|
+
(0, _react.useEffect)(function () {
|
|
137
|
+
if (!rightClickMenuState) return;
|
|
138
|
+
var closeRightClickMenu = function closeRightClickMenu() {
|
|
139
|
+
return setRightClickMenuState(null);
|
|
140
|
+
};
|
|
141
|
+
window.addEventListener('click', closeRightClickMenu);
|
|
142
|
+
window.addEventListener('scroll', closeRightClickMenu, true);
|
|
143
|
+
window.addEventListener('resize', closeRightClickMenu);
|
|
144
|
+
return function () {
|
|
145
|
+
window.removeEventListener('click', closeRightClickMenu);
|
|
146
|
+
window.removeEventListener('scroll', closeRightClickMenu, true);
|
|
147
|
+
window.removeEventListener('resize', closeRightClickMenu);
|
|
148
|
+
};
|
|
149
|
+
}, [rightClickMenuState]);
|
|
150
|
+
if (!rightClickMenuState) return null;
|
|
151
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
152
|
+
className: 'Sqb-right-click-menu',
|
|
153
|
+
style: {
|
|
154
|
+
left: rightClickMenuState.x,
|
|
155
|
+
top: rightClickMenuState.y,
|
|
156
|
+
zIndex: popupZIndex ? popupZIndex + 10 : 9999
|
|
157
|
+
},
|
|
158
|
+
onClick: function onClick(event) {
|
|
159
|
+
return event.stopPropagation();
|
|
160
|
+
},
|
|
161
|
+
onContextMenu: function onContextMenu(event) {
|
|
162
|
+
return event.preventDefault();
|
|
163
|
+
},
|
|
164
|
+
children: rightClickMenu.map(function (menuItem) {
|
|
165
|
+
return (0, _jsxRuntime.jsx)("button", {
|
|
166
|
+
type: 'button',
|
|
167
|
+
className: (0, _classnames["default"])('Sqb-right-click-menu-item', {
|
|
168
|
+
disabled: menuItem.disabled
|
|
169
|
+
}),
|
|
170
|
+
disabled: menuItem.disabled,
|
|
171
|
+
onClick: function onClick() {
|
|
172
|
+
return handleRightClickMenuItem(menuItem);
|
|
173
|
+
},
|
|
174
|
+
children: menuItem.label
|
|
175
|
+
}, menuItem.value);
|
|
176
|
+
})
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
var _default = exports["default"] = SqbRightClickMenu;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RightClickValueProps {
|
|
3
|
+
value: any;
|
|
4
|
+
children: React.ReactElement;
|
|
5
|
+
}
|
|
6
|
+
declare const RightClickValue: ({ value, children }: RightClickValueProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
7
|
+
export declare const useRightClickValue: (value: any) => string;
|
|
8
|
+
export default RightClickValue;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useRightClickValue = exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _useProvider = require("../hooks/use-provider");
|
|
10
|
+
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); }
|
|
11
|
+
var RightClickValue = function RightClickValue(_ref) {
|
|
12
|
+
var value = _ref.value,
|
|
13
|
+
children = _ref.children;
|
|
14
|
+
var valueId = useRightClickValue(value);
|
|
15
|
+
return _react["default"].cloneElement(children, {
|
|
16
|
+
'data-right-click-id': valueId
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var useRightClickValue = exports.useRightClickValue = function useRightClickValue(value) {
|
|
20
|
+
var store = (0, _useProvider.useStore)();
|
|
21
|
+
var valueIdRef = (0, _react.useRef)();
|
|
22
|
+
if (!valueIdRef.current) {
|
|
23
|
+
valueIdRef.current = "sqb-right-click-".concat(Math.random().toString(36).slice(2));
|
|
24
|
+
}
|
|
25
|
+
(0, _react.useEffect)(function () {
|
|
26
|
+
store.setRightClickButtonValue(valueIdRef.current, value);
|
|
27
|
+
return function () {
|
|
28
|
+
store.removeRightClickButtonValue(valueIdRef.current);
|
|
29
|
+
};
|
|
30
|
+
}, [store, value]);
|
|
31
|
+
return valueIdRef.current;
|
|
32
|
+
};
|
|
33
|
+
var _default = exports["default"] = RightClickValue;
|
|
@@ -6,6 +6,6 @@ interface ProviderProps {
|
|
|
6
6
|
value: ContextProps;
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const Provider: ({ value, children }: ProviderProps) =>
|
|
9
|
+
export declare const Provider: ({ value, children }: ProviderProps) => React.JSX.Element;
|
|
10
10
|
export declare const useStore: any;
|
|
11
11
|
export {};
|
|
@@ -194,38 +194,67 @@ var useStore = function useStore() {
|
|
|
194
194
|
_useState64 = (0, _slicedToArray2["default"])(_useState63, 2),
|
|
195
195
|
showFormulaDiff = _useState64[0],
|
|
196
196
|
setShowFormulaDiff = _useState64[1];
|
|
197
|
-
var _useState65 = (0, _react.useState)(
|
|
197
|
+
var _useState65 = (0, _react.useState)(true),
|
|
198
198
|
_useState66 = (0, _slicedToArray2["default"])(_useState65, 2),
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
matchBrackets = _useState66[0],
|
|
200
|
+
setMatchBrackets = _useState66[1];
|
|
201
201
|
var _useState67 = (0, _react.useState)(false),
|
|
202
202
|
_useState68 = (0, _slicedToArray2["default"])(_useState67, 2),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var _useState69 = (0, _react.useState)(
|
|
203
|
+
hasFormulaSqlCode = _useState68[0],
|
|
204
|
+
setHasFormulaSqlCode = _useState68[1];
|
|
205
|
+
var _useState69 = (0, _react.useState)(false),
|
|
206
206
|
_useState70 = (0, _slicedToArray2["default"])(_useState69, 2),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
var _useState71 = (0, _react.useState)(
|
|
207
|
+
hasFormulaDiffCode = _useState70[0],
|
|
208
|
+
setHasFormulaDiffCode = _useState70[1];
|
|
209
|
+
var _useState71 = (0, _react.useState)([]),
|
|
210
210
|
_useState72 = (0, _slicedToArray2["default"])(_useState71, 2),
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
sourceData = _useState72[0],
|
|
212
|
+
setSourceData = _useState72[1];
|
|
213
213
|
var _useState73 = (0, _react.useState)(false),
|
|
214
214
|
_useState74 = (0, _slicedToArray2["default"])(_useState73, 2),
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
moduleCopy = _useState74[0],
|
|
216
|
+
setModuleCopy = _useState74[1];
|
|
217
217
|
var _useState75 = (0, _react.useState)(false),
|
|
218
218
|
_useState76 = (0, _slicedToArray2["default"])(_useState75, 2),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
var _useState77 = (0, _react.useState)(
|
|
219
|
+
isMetabaseCopy = _useState76[0],
|
|
220
|
+
setIsMetabaseCopy = _useState76[1];
|
|
221
|
+
var _useState77 = (0, _react.useState)(false),
|
|
222
222
|
_useState78 = (0, _slicedToArray2["default"])(_useState77, 2),
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
var _useState79 = (0, _react.useState)(
|
|
223
|
+
joinAliasConflictCheck = _useState78[0],
|
|
224
|
+
setJoinAliasConflictCheck = _useState78[1];
|
|
225
|
+
var _useState79 = (0, _react.useState)([]),
|
|
226
226
|
_useState80 = (0, _slicedToArray2["default"])(_useState79, 2),
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
existsError = _useState80[0],
|
|
228
|
+
setExistsError = _useState80[1];
|
|
229
|
+
var rightClickButtonValueMap = (0, _react.useRef)({});
|
|
230
|
+
var _useState81 = (0, _react.useState)([]),
|
|
231
|
+
_useState82 = (0, _slicedToArray2["default"])(_useState81, 2),
|
|
232
|
+
rightClickMenu = _useState82[0],
|
|
233
|
+
setRightClickMenu = _useState82[1];
|
|
234
|
+
var _useState83 = (0, _react.useState)(null),
|
|
235
|
+
_useState84 = (0, _slicedToArray2["default"])(_useState83, 2),
|
|
236
|
+
rightClickMenuState = _useState84[0],
|
|
237
|
+
setRightClickMenuState = _useState84[1];
|
|
238
|
+
var rightClickMenuClickRef = (0, _react.useRef)();
|
|
239
|
+
var _useState85 = (0, _react.useState)(_storage["default"]._metabaseCopyModule || []),
|
|
240
|
+
_useState86 = (0, _slicedToArray2["default"])(_useState85, 2),
|
|
241
|
+
metabaseCopyModule = _useState86[0],
|
|
242
|
+
setMetabaseCopyModule = _useState86[1];
|
|
243
|
+
var setRightClickMenuClick = function setRightClickMenuClick(fn) {
|
|
244
|
+
rightClickMenuClickRef.current = fn;
|
|
245
|
+
};
|
|
246
|
+
var getRightClickMenuClick = function getRightClickMenuClick() {
|
|
247
|
+
return rightClickMenuClickRef.current;
|
|
248
|
+
};
|
|
249
|
+
var setRightClickButtonValue = function setRightClickButtonValue(id, value) {
|
|
250
|
+
rightClickButtonValueMap.current[id] = value;
|
|
251
|
+
};
|
|
252
|
+
var removeRightClickButtonValue = function removeRightClickButtonValue(id) {
|
|
253
|
+
delete rightClickButtonValueMap.current[id];
|
|
254
|
+
};
|
|
255
|
+
var getRightClickButtonValue = function getRightClickButtonValue(id) {
|
|
256
|
+
return rightClickButtonValueMap.current[id];
|
|
257
|
+
};
|
|
229
258
|
var setFormulaTemplates = function setFormulaTemplates(data) {
|
|
230
259
|
var newData = data === null || data === void 0 ? void 0 : data.map(function (v) {
|
|
231
260
|
var children = v.children.map(function (vv) {
|
|
@@ -1094,6 +1123,8 @@ var useStore = function useStore() {
|
|
|
1094
1123
|
setShowFormulaSql: setShowFormulaSql,
|
|
1095
1124
|
showFormulaDiff: showFormulaDiff,
|
|
1096
1125
|
setShowFormulaDiff: setShowFormulaDiff,
|
|
1126
|
+
matchBrackets: matchBrackets,
|
|
1127
|
+
setMatchBrackets: setMatchBrackets,
|
|
1097
1128
|
hasFormulaSqlCode: hasFormulaSqlCode,
|
|
1098
1129
|
hasFormulaDiffCode: hasFormulaDiffCode,
|
|
1099
1130
|
sourceData: sourceData,
|
|
@@ -1117,7 +1148,16 @@ var useStore = function useStore() {
|
|
|
1117
1148
|
setExistsErrorFn: setExistsErrorFn,
|
|
1118
1149
|
existsError: existsError,
|
|
1119
1150
|
joinAliasConflictCheck: joinAliasConflictCheck,
|
|
1120
|
-
setJoinAliasConflictCheck: setJoinAliasConflictCheck
|
|
1151
|
+
setJoinAliasConflictCheck: setJoinAliasConflictCheck,
|
|
1152
|
+
setRightClickButtonValue: setRightClickButtonValue,
|
|
1153
|
+
removeRightClickButtonValue: removeRightClickButtonValue,
|
|
1154
|
+
getRightClickButtonValue: getRightClickButtonValue,
|
|
1155
|
+
rightClickMenu: rightClickMenu,
|
|
1156
|
+
setRightClickMenu: setRightClickMenu,
|
|
1157
|
+
rightClickMenuState: rightClickMenuState,
|
|
1158
|
+
setRightClickMenuState: setRightClickMenuState,
|
|
1159
|
+
setRightClickMenuClick: setRightClickMenuClick,
|
|
1160
|
+
getRightClickMenuClick: getRightClickMenuClick
|
|
1121
1161
|
};
|
|
1122
1162
|
};
|
|
1123
1163
|
var _default = exports["default"] = useStore;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './locale/en';
|
|
3
3
|
import './locale/zh';
|
|
4
|
-
import type { MetabaseProps, SqlVisionBuilderRef, DatasourceType } from './types';
|
|
4
|
+
import type { MetabaseProps, SqlVisionBuilderRef, DatasourceType, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams } from './types';
|
|
5
5
|
import type { MetaListType, ToolbarType } from './store/types';
|
|
6
6
|
declare const SqlVisionBuilder: React.ForwardRefExoticComponent<MetabaseProps & React.RefAttributes<SqlVisionBuilderRef>>;
|
|
7
7
|
export default SqlVisionBuilder;
|
|
8
|
-
export { MetabaseProps, DatasourceType, MetaListType, ToolbarType, SqlVisionBuilderRef };
|
|
8
|
+
export { MetabaseProps, DatasourceType, MetaListType, ToolbarType, SqlVisionBuilderRef, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, };
|
package/lib/cjs/index.js
CHANGED
|
@@ -81,6 +81,8 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
81
81
|
showFormulaSql = _props$showFormulaSql === void 0 ? true : _props$showFormulaSql,
|
|
82
82
|
_props$showFormulaDif = props.showFormulaDiff,
|
|
83
83
|
showFormulaDiff = _props$showFormulaDif === void 0 ? true : _props$showFormulaDif,
|
|
84
|
+
_props$matchBrackets = props.matchBrackets,
|
|
85
|
+
matchBrackets = _props$matchBrackets === void 0 ? true : _props$matchBrackets,
|
|
84
86
|
_props$joinAliasConfl = props.joinAliasConflictCheck,
|
|
85
87
|
joinAliasConflictCheck = _props$joinAliasConfl === void 0 ? false : _props$joinAliasConfl,
|
|
86
88
|
_props$operatorList = props.operatorList,
|
|
@@ -133,11 +135,12 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
133
135
|
store.setModuleDiff(moduleDiff);
|
|
134
136
|
store.setShowFormulaSql(showFormulaSql);
|
|
135
137
|
store.setShowFormulaDiff(showFormulaDiff);
|
|
138
|
+
store.setMatchBrackets(matchBrackets);
|
|
136
139
|
store.setIsSubquery(isSubquery);
|
|
137
140
|
store.setModuleCopy(moduleCopy);
|
|
138
141
|
store.setJoinAliasConflictCheck(joinAliasConflictCheck);
|
|
139
142
|
store.setOperatorList(operatorList || []);
|
|
140
|
-
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
143
|
+
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
141
144
|
_react["default"].useImperativeHandle(ref, function () {
|
|
142
145
|
return {
|
|
143
146
|
reset: function reset() {
|
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;
|