@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
|
@@ -21,6 +21,7 @@ import NextDom from './components/meta-icon';
|
|
|
21
21
|
import Header from './components/header';
|
|
22
22
|
import ItemWrapper from './components/item-wrapper';
|
|
23
23
|
import ItemName from './components/item-name';
|
|
24
|
+
import RightClickValue from '../right-click-value';
|
|
24
25
|
import { getTopLayerZIndex } from '../../utils/helper-dom';
|
|
25
26
|
import { useStore } from '../../hooks/use-provider';
|
|
26
27
|
var CustomColumn = function CustomColumn(props) {
|
|
@@ -310,20 +311,23 @@ var CustomColumn = function CustomColumn(props) {
|
|
|
310
311
|
children: [meta.customColumn.map(function (v, i) {
|
|
311
312
|
return _jsx(ItemName, {
|
|
312
313
|
isError: isError(v.formulaList, getColumns()) || isExistsError(v.formulaList, store.existsError),
|
|
313
|
-
children:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
},
|
|
318
|
-
children: [v.name, _jsx("span", {
|
|
319
|
-
style: {
|
|
320
|
-
fontSize: 0
|
|
321
|
-
},
|
|
314
|
+
children: _jsx(RightClickValue, {
|
|
315
|
+
value: v,
|
|
316
|
+
children: _jsxs("div", {
|
|
317
|
+
className: cx("Sqb-TableName gray-name"),
|
|
322
318
|
onClick: function onClick(e) {
|
|
323
|
-
return
|
|
319
|
+
return showSubQuery(e, i);
|
|
324
320
|
},
|
|
325
|
-
children: _jsx(
|
|
326
|
-
|
|
321
|
+
children: [v.name, _jsx("span", {
|
|
322
|
+
style: {
|
|
323
|
+
fontSize: 0
|
|
324
|
+
},
|
|
325
|
+
onClick: function onClick(e) {
|
|
326
|
+
return handleDel(e, i);
|
|
327
|
+
},
|
|
328
|
+
children: _jsx(CloseIcon, {})
|
|
329
|
+
})]
|
|
330
|
+
})
|
|
327
331
|
})
|
|
328
332
|
}, i);
|
|
329
333
|
}), _jsx("div", {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaFilter } from '../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
meta: MetaFilter;
|
|
4
5
|
groupIndex: number;
|
|
5
6
|
}
|
|
6
|
-
declare const Filter: (props: PropsType) =>
|
|
7
|
+
declare const Filter: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default Filter;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaJoin } from '../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
meta: MetaJoin;
|
|
4
5
|
groupIndex: number;
|
|
5
6
|
}
|
|
6
|
-
declare const JoinData: (props: PropsType) =>
|
|
7
|
+
declare const JoinData: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default JoinData;
|
|
@@ -22,6 +22,7 @@ import { AtomsTypeEnum, ChangeType, FormulaTypeEnum } from '../../store/types';
|
|
|
22
22
|
import { SummarizeAlias } from '../../store/helper';
|
|
23
23
|
import { getHelper, changeTableAlias, isValidSQLAlias, isError } from '../../utils';
|
|
24
24
|
import ItemName from './components/item-name';
|
|
25
|
+
import RightClickValue from '../right-click-value';
|
|
25
26
|
import Wrapper from './components/Wrapper';
|
|
26
27
|
import NextDom from './components/meta-icon';
|
|
27
28
|
import Header from './components/header';
|
|
@@ -1211,17 +1212,20 @@ var JoinData = function JoinData(props) {
|
|
|
1211
1212
|
var _items$2, _items$3;
|
|
1212
1213
|
return _jsx(ItemName, {
|
|
1213
1214
|
isError: isError(items, getColumns(type)),
|
|
1214
|
-
children: _jsx(
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1215
|
+
children: _jsx(RightClickValue, {
|
|
1216
|
+
value: items,
|
|
1217
|
+
children: _jsx("div", {
|
|
1218
|
+
className: cx("Sqb-TableName", {
|
|
1219
|
+
notSelected: !((_items$2 = items[0]) !== null && _items$2 !== void 0 && _items$2.fieldName)
|
|
1220
|
+
}),
|
|
1221
|
+
"v-position": type,
|
|
1222
|
+
"v-index": i,
|
|
1223
|
+
"v-index2": index,
|
|
1224
|
+
onClick: selectMoreJoinColumn,
|
|
1225
|
+
children: (_items$3 = items[0]) !== null && _items$3 !== void 0 && _items$3.fieldName ? items.map(function (field) {
|
|
1226
|
+
return field.fieldName;
|
|
1227
|
+
}).join(' || ') : __('SqlQueryBuilder.pickTable')
|
|
1228
|
+
})
|
|
1225
1229
|
})
|
|
1226
1230
|
}, type + i);
|
|
1227
1231
|
} else {
|
|
@@ -1268,17 +1272,20 @@ var JoinData = function JoinData(props) {
|
|
|
1268
1272
|
return _jsx(ItemName, {
|
|
1269
1273
|
isError: !!(item.id || item.val) && !getConstantLabel(store.constantList, item.id || item.val),
|
|
1270
1274
|
message: "\u5E38\u91CF\u4E22\u5931",
|
|
1271
|
-
children: _jsx(
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1275
|
+
children: _jsx(RightClickValue, {
|
|
1276
|
+
value: item,
|
|
1277
|
+
children: _jsx("div", {
|
|
1278
|
+
className: cx("Sqb-TableName", {
|
|
1279
|
+
notSelected: !item.val
|
|
1280
|
+
}),
|
|
1281
|
+
"v-position": type,
|
|
1282
|
+
"v-index": i,
|
|
1283
|
+
"v-index2": index,
|
|
1284
|
+
"v-val": item.id || item.val,
|
|
1285
|
+
onClick: selectConstant,
|
|
1286
|
+
children: getConstantLabel(store.constantList, item.id || item.val, item.val) || __('SqlQueryBuilder.pickConstant')
|
|
1287
|
+
}, index)
|
|
1288
|
+
})
|
|
1282
1289
|
}, index);
|
|
1283
1290
|
}
|
|
1284
1291
|
});
|
|
@@ -1315,12 +1322,15 @@ var JoinData = function JoinData(props) {
|
|
|
1315
1322
|
className: cx("Sqb-NotebookCell"),
|
|
1316
1323
|
children: [_jsx(ItemName, {
|
|
1317
1324
|
isError: leftTableIsError(),
|
|
1318
|
-
children: _jsx(
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1325
|
+
children: _jsx(RightClickValue, {
|
|
1326
|
+
value: meta.table1,
|
|
1327
|
+
children: _jsx("div", {
|
|
1328
|
+
className: cx("Sqb-TableName", {
|
|
1329
|
+
notSelected: !table1Selected
|
|
1330
|
+
}),
|
|
1331
|
+
onClick: selectLeftTable,
|
|
1332
|
+
children: getTable1Name() || __('SqlQueryBuilder.pickTable')
|
|
1333
|
+
})
|
|
1324
1334
|
})
|
|
1325
1335
|
}), _jsx("div", {
|
|
1326
1336
|
onClick: selectJoin,
|
|
@@ -1341,84 +1351,90 @@ var JoinData = function JoinData(props) {
|
|
|
1341
1351
|
cursor: 'pointer'
|
|
1342
1352
|
}
|
|
1343
1353
|
})
|
|
1344
|
-
}), meta.isSubquery ?
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1354
|
+
}), meta.isSubquery ? _jsx(RightClickValue, {
|
|
1355
|
+
value: meta,
|
|
1356
|
+
children: _jsxs("div", {
|
|
1357
|
+
className: cx("Sqb-TableName", {
|
|
1358
|
+
notSelected: !subQuerySelected
|
|
1359
|
+
}),
|
|
1360
|
+
onClick: function onClick() {
|
|
1361
|
+
showSubQuery(meta.subquery);
|
|
1362
|
+
},
|
|
1363
|
+
children: [subQuerySelected && _jsx(_Fragment, {
|
|
1364
|
+
children: function () {
|
|
1365
|
+
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
1366
|
+
var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
1367
|
+
return showButton ? _jsx(Tooltip, {
|
|
1368
|
+
title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
1369
|
+
children: _jsx(Button, {
|
|
1370
|
+
danger: tableIsError(),
|
|
1371
|
+
className: cx(':Sqb-TableName-as', {
|
|
1372
|
+
isError: tableIsError()
|
|
1373
|
+
}),
|
|
1374
|
+
shape: 'circle',
|
|
1375
|
+
style: isDel ? {
|
|
1376
|
+
fontSize: 18,
|
|
1377
|
+
backgroundColor: '#fff',
|
|
1378
|
+
width: 'auto',
|
|
1379
|
+
height: 'auto'
|
|
1380
|
+
} : {},
|
|
1381
|
+
iconOnly: true,
|
|
1382
|
+
primary: !isDel,
|
|
1383
|
+
icon: icon,
|
|
1384
|
+
size: 'small',
|
|
1385
|
+
onClick: function onClick(e) {
|
|
1386
|
+
if (store.tableEnableAlias) {
|
|
1387
|
+
var _meta$table3;
|
|
1388
|
+
e.stopPropagation();
|
|
1389
|
+
onChangeTableAlias(((_meta$table3 = meta.table2) === null || _meta$table3 === void 0 ? void 0 : _meta$table3.alias) || '');
|
|
1390
|
+
}
|
|
1378
1391
|
}
|
|
1379
|
-
}
|
|
1380
|
-
})
|
|
1381
|
-
})
|
|
1382
|
-
}()
|
|
1383
|
-
})
|
|
1384
|
-
}) :
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1392
|
+
})
|
|
1393
|
+
}) : null;
|
|
1394
|
+
}()
|
|
1395
|
+
}), 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.table2) !== null && _meta$table4 !== void 0 && _meta$table4.alias && store.tableEnableAlias ? "as ".concat((_meta$table5 = meta.table2) === null || _meta$table5 === void 0 ? void 0 : _meta$table5.alias) : '', " ") : __('SqlQueryBuilder.setSubQuery')]
|
|
1396
|
+
})
|
|
1397
|
+
}) : _jsx(RightClickValue, {
|
|
1398
|
+
value: meta.table2,
|
|
1399
|
+
children: _jsxs("div", {
|
|
1400
|
+
className: cx("Sqb-TableName", {
|
|
1401
|
+
notSelected: !table2Selected
|
|
1402
|
+
}),
|
|
1403
|
+
onClick: selectTable,
|
|
1404
|
+
children: [table2Selected && _jsx(_Fragment, {
|
|
1405
|
+
children: function () {
|
|
1406
|
+
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
1407
|
+
var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
1408
|
+
return showButton ? _jsx(Tooltip, {
|
|
1409
|
+
title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
1410
|
+
children: _jsx(Button, {
|
|
1411
|
+
danger: tableIsError(),
|
|
1412
|
+
className: cx(':Sqb-TableName-as', {
|
|
1413
|
+
isError: tableIsError()
|
|
1414
|
+
}),
|
|
1415
|
+
shape: 'circle',
|
|
1416
|
+
style: isDel ? {
|
|
1417
|
+
fontSize: 18,
|
|
1418
|
+
backgroundColor: '#fff',
|
|
1419
|
+
width: 'auto',
|
|
1420
|
+
height: 'auto'
|
|
1421
|
+
} : {},
|
|
1422
|
+
iconOnly: true,
|
|
1423
|
+
primary: !isDel,
|
|
1424
|
+
icon: icon,
|
|
1425
|
+
size: 'small',
|
|
1426
|
+
onClick: function onClick(e) {
|
|
1427
|
+
if (store.tableEnableAlias) {
|
|
1428
|
+
var _meta$table6;
|
|
1429
|
+
e.stopPropagation();
|
|
1430
|
+
onChangeTableAlias(((_meta$table6 = meta.table2) === null || _meta$table6 === void 0 ? void 0 : _meta$table6.alias) || '');
|
|
1431
|
+
}
|
|
1416
1432
|
}
|
|
1417
|
-
}
|
|
1418
|
-
})
|
|
1419
|
-
})
|
|
1420
|
-
}()
|
|
1421
|
-
})
|
|
1433
|
+
})
|
|
1434
|
+
}) : null;
|
|
1435
|
+
}()
|
|
1436
|
+
}), table2Selected ? "".concat(meta.table2.datasourceName, ".").concat(meta.table2.name, " ").concat((_meta$table7 = meta.table2) !== null && _meta$table7 !== void 0 && _meta$table7.alias && store.tableEnableAlias ? "as ".concat((_meta$table8 = meta.table2) === null || _meta$table8 === void 0 ? void 0 : _meta$table8.alias) : '') : __('SqlQueryBuilder.pickTable')]
|
|
1437
|
+
})
|
|
1422
1438
|
}), store.showSubquery && _jsx(Tooltip, {
|
|
1423
1439
|
title: __('SqlQueryBuilder.switchSubQuery'),
|
|
1424
1440
|
children: _jsx(Button, {
|
|
@@ -1529,15 +1545,18 @@ var JoinData = function JoinData(props) {
|
|
|
1529
1545
|
children: "on"
|
|
1530
1546
|
}), _jsx(ItemName, {
|
|
1531
1547
|
isError: isError(v, getTableColumns()),
|
|
1532
|
-
children: _jsx(
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1548
|
+
children: _jsx(RightClickValue, {
|
|
1549
|
+
value: v,
|
|
1550
|
+
children: _jsx("div", {
|
|
1551
|
+
className: cx("Sqb-TableName purple-name", {
|
|
1552
|
+
notSelected: !v.quotes
|
|
1553
|
+
}),
|
|
1554
|
+
onClick: function onClick(e) {
|
|
1555
|
+
return changeExpression(e, i);
|
|
1556
|
+
},
|
|
1557
|
+
children: v.quotes || __('joinData.selectExpression')
|
|
1558
|
+
}, i)
|
|
1559
|
+
})
|
|
1541
1560
|
}), _jsx(Tooltip, {
|
|
1542
1561
|
title: __('SqlQueryBuilder.add'),
|
|
1543
1562
|
children: _jsx(Dropdown, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaData } from '../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
meta: MetaData;
|
|
4
5
|
groupIndex: number;
|
|
5
6
|
}
|
|
6
|
-
declare const PermissionTable: (props: PropsType) =>
|
|
7
|
+
declare const PermissionTable: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default PermissionTable;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface PropsType {
|
|
2
3
|
store?: any;
|
|
3
4
|
meta: any;
|
|
4
5
|
groupIndex: number;
|
|
5
6
|
}
|
|
6
|
-
declare const RowLimit: (props: PropsType) =>
|
|
7
|
+
declare const RowLimit: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default RowLimit;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaSort } from '../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
meta: MetaSort;
|
|
4
5
|
groupIndex: number;
|
|
5
6
|
}
|
|
6
|
-
declare const Sort: (props: PropsType) =>
|
|
7
|
+
declare const Sort: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default Sort;
|
|
@@ -15,6 +15,7 @@ import Header from './components/header';
|
|
|
15
15
|
import ItemWrapper from './components/item-wrapper';
|
|
16
16
|
import { useStore } from '../../hooks/use-provider';
|
|
17
17
|
import ItemName from './components/item-name';
|
|
18
|
+
import RightClickValue from '../right-click-value';
|
|
18
19
|
var Sort = function Sort(props) {
|
|
19
20
|
var meta = props.meta,
|
|
20
21
|
groupIndex = props.groupIndex;
|
|
@@ -192,21 +193,24 @@ var Sort = function Sort(props) {
|
|
|
192
193
|
children: [sort.map(function (v, i) {
|
|
193
194
|
return _jsx(ItemName, {
|
|
194
195
|
isError: isError(v.expression, getColumns()),
|
|
195
|
-
children:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
style: {
|
|
202
|
-
fontSize: 0
|
|
196
|
+
children: _jsx(RightClickValue, {
|
|
197
|
+
value: v,
|
|
198
|
+
children: _jsxs("div", {
|
|
199
|
+
className: "Sqb-TableName gray-name",
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
return handleSort(i);
|
|
203
202
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
203
|
+
children: [v.sort === SortEnum.asc ? _jsx(UpArrowIcon, {}) : _jsx(DownArrowIcon, {}), getName(v.expression), _jsx("span", {
|
|
204
|
+
style: {
|
|
205
|
+
fontSize: 0
|
|
206
|
+
},
|
|
207
|
+
onClick: function onClick(e) {
|
|
208
|
+
return delSortColumn(e, i);
|
|
209
|
+
},
|
|
210
|
+
children: _jsx(CloseIcon, {})
|
|
211
|
+
})]
|
|
212
|
+
}, i)
|
|
213
|
+
})
|
|
210
214
|
}, i);
|
|
211
215
|
}), _jsx("div", {
|
|
212
216
|
className: "Sqb-TableName gray-name",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaSummarize } from '../../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
meta: MetaSummarize;
|
|
4
5
|
groupIndex: number;
|
|
5
6
|
}
|
|
6
|
-
declare const GroupBy: (props: PropsType) =>
|
|
7
|
+
declare const GroupBy: (props: PropsType) => React.JSX.Element;
|
|
7
8
|
export default GroupBy;
|
|
@@ -16,6 +16,7 @@ import { Tooltip, Button, Modal, Input, Toast } from '@gingkoo/pandora';
|
|
|
16
16
|
import { uuidv4, getAlias } from '../../../utils/helper';
|
|
17
17
|
import { changeFieldAlias, isExistsError, isValidSQLAlias } from '../../../utils';
|
|
18
18
|
import ItemName from '../components/item-name';
|
|
19
|
+
import RightClickValue from '../../right-click-value';
|
|
19
20
|
import { AddIcon, CloseIcon } from '../../icons';
|
|
20
21
|
import FormulaList from '../../dialog/formula-list';
|
|
21
22
|
import { useStore } from '../../../hooks/use-provider';
|
|
@@ -510,36 +511,39 @@ var GroupBy = function GroupBy(props) {
|
|
|
510
511
|
children: [meta.by.map(function (v, i) {
|
|
511
512
|
return _jsx(ItemName, {
|
|
512
513
|
isError: isExistsError([getErrorCheckField(v)], store.existsError),
|
|
513
|
-
children:
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
},
|
|
518
|
-
children: [v.quotes && _jsx(_Fragment, {
|
|
519
|
-
children: store.groupByEnableAlias && _jsx(Tooltip, {
|
|
520
|
-
title: !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias) ? __('SqlQueryBuilder.aliasForRules') : __('SqlQueryBuilder.alias'),
|
|
521
|
-
children: _jsx(Button, {
|
|
522
|
-
className: cx(':Sqb-TableName-as :Sqb-TableName green-name', _defineProperty({}, 'isError', !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias))),
|
|
523
|
-
shape: 'circle',
|
|
524
|
-
iconOnly: true,
|
|
525
|
-
primary: true,
|
|
526
|
-
icon: 'As',
|
|
527
|
-
size: 'small',
|
|
528
|
-
onClick: function onClick(e) {
|
|
529
|
-
e.stopPropagation();
|
|
530
|
-
onChangeFieldAlias((v === null || v === void 0 ? void 0 : v.fieldAlias) || '', i);
|
|
531
|
-
}
|
|
532
|
-
})
|
|
533
|
-
})
|
|
534
|
-
}), "".concat(v.quotes, " ").concat(v.fieldAlias ? "as ".concat(v.fieldAlias) : ''), _jsx("span", {
|
|
535
|
-
style: {
|
|
536
|
-
fontSize: 0
|
|
537
|
-
},
|
|
514
|
+
children: _jsx(RightClickValue, {
|
|
515
|
+
value: v,
|
|
516
|
+
children: _jsxs("div", {
|
|
517
|
+
className: "Sqb-TableName green-name",
|
|
538
518
|
onClick: function onClick(e) {
|
|
539
|
-
return
|
|
519
|
+
return handleUpdate(e, i);
|
|
540
520
|
},
|
|
541
|
-
children: _jsx(
|
|
542
|
-
|
|
521
|
+
children: [v.quotes && _jsx(_Fragment, {
|
|
522
|
+
children: store.groupByEnableAlias && _jsx(Tooltip, {
|
|
523
|
+
title: !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias) ? __('SqlQueryBuilder.aliasForRules') : __('SqlQueryBuilder.alias'),
|
|
524
|
+
children: _jsx(Button, {
|
|
525
|
+
className: cx(':Sqb-TableName-as :Sqb-TableName green-name', _defineProperty({}, 'isError', !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias))),
|
|
526
|
+
shape: 'circle',
|
|
527
|
+
iconOnly: true,
|
|
528
|
+
primary: true,
|
|
529
|
+
icon: 'As',
|
|
530
|
+
size: 'small',
|
|
531
|
+
onClick: function onClick(e) {
|
|
532
|
+
e.stopPropagation();
|
|
533
|
+
onChangeFieldAlias((v === null || v === void 0 ? void 0 : v.fieldAlias) || '', i);
|
|
534
|
+
}
|
|
535
|
+
})
|
|
536
|
+
})
|
|
537
|
+
}), "".concat(v.quotes, " ").concat(v.fieldAlias ? "as ".concat(v.fieldAlias) : ''), _jsx("span", {
|
|
538
|
+
style: {
|
|
539
|
+
fontSize: 0
|
|
540
|
+
},
|
|
541
|
+
onClick: function onClick(e) {
|
|
542
|
+
return handleDel(e, i);
|
|
543
|
+
},
|
|
544
|
+
children: _jsx(CloseIcon, {})
|
|
545
|
+
})]
|
|
546
|
+
})
|
|
543
547
|
})
|
|
544
548
|
}, i);
|
|
545
549
|
}), _jsx("div", {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaSummarize } from '../../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
store?: any;
|
|
4
5
|
meta: MetaSummarize;
|
|
5
6
|
groupIndex: number;
|
|
6
7
|
}
|
|
7
|
-
declare const Summarize: (props: PropsType) =>
|
|
8
|
+
declare const Summarize: (props: PropsType) => React.JSX.Element;
|
|
8
9
|
export default Summarize;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { MetaSummarize } from '../../../store/types';
|
|
2
3
|
interface PropsType {
|
|
3
4
|
store?: any;
|
|
4
5
|
meta: MetaSummarize;
|
|
5
6
|
groupIndex: number;
|
|
6
7
|
}
|
|
7
|
-
declare const SelectIndex: (props: PropsType) =>
|
|
8
|
+
declare const SelectIndex: (props: PropsType) => React.JSX.Element;
|
|
8
9
|
export default SelectIndex;
|
|
@@ -15,6 +15,7 @@ import { uuidv4 } from '../../../utils/helper';
|
|
|
15
15
|
import { MetaSummarize_Enum, AtomsTypeEnum, ChangeType } from '../../../store/types';
|
|
16
16
|
import { changeFieldAlias, isExistsError, isValidSQLAlias } from '../../../utils';
|
|
17
17
|
import ItemName from '../components/item-name';
|
|
18
|
+
import RightClickValue from '../../right-click-value';
|
|
18
19
|
import { AddIcon, CloseIcon } from '../../icons';
|
|
19
20
|
import { SelectSummarize } from '../../dialog';
|
|
20
21
|
import { useStore } from '../../../hooks/use-provider';
|
|
@@ -412,36 +413,39 @@ var SelectIndex = function SelectIndex(props) {
|
|
|
412
413
|
children: [meta.group.map(function (v, i) {
|
|
413
414
|
return _jsx(ItemName, {
|
|
414
415
|
isError: isExistsError([getErrorCheckField(v)], store.existsError),
|
|
415
|
-
children:
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
},
|
|
420
|
-
children: [v.quotes && _jsx(_Fragment, {
|
|
421
|
-
children: store.groupByEnableAlias && _jsx(Tooltip, {
|
|
422
|
-
title: !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias) ? __('SqlQueryBuilder.aliasForRules') : __('SqlQueryBuilder.alias'),
|
|
423
|
-
children: _jsx(Button, {
|
|
424
|
-
className: cx(':Sqb-TableName-as :Sqb-TableName green-name', _defineProperty({}, 'isError', !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias))),
|
|
425
|
-
shape: 'circle',
|
|
426
|
-
iconOnly: true,
|
|
427
|
-
primary: true,
|
|
428
|
-
icon: 'As',
|
|
429
|
-
size: 'small',
|
|
430
|
-
onClick: function onClick(e) {
|
|
431
|
-
e.stopPropagation();
|
|
432
|
-
onChangeFieldAlias((v === null || v === void 0 ? void 0 : v.fieldAlias) || '', i);
|
|
433
|
-
}
|
|
434
|
-
})
|
|
435
|
-
})
|
|
436
|
-
}), "".concat(v.quotes, " ").concat(v.fieldAlias ? "as ".concat(v.fieldAlias) : ''), _jsx("span", {
|
|
437
|
-
style: {
|
|
438
|
-
fontSize: 0
|
|
439
|
-
},
|
|
416
|
+
children: _jsx(RightClickValue, {
|
|
417
|
+
value: v,
|
|
418
|
+
children: _jsxs("div", {
|
|
419
|
+
className: "Sqb-TableName green-name",
|
|
440
420
|
onClick: function onClick(e) {
|
|
441
|
-
return
|
|
421
|
+
return handleUpdate(e, i);
|
|
442
422
|
},
|
|
443
|
-
children: _jsx(
|
|
444
|
-
|
|
423
|
+
children: [v.quotes && _jsx(_Fragment, {
|
|
424
|
+
children: store.groupByEnableAlias && _jsx(Tooltip, {
|
|
425
|
+
title: !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias) ? __('SqlQueryBuilder.aliasForRules') : __('SqlQueryBuilder.alias'),
|
|
426
|
+
children: _jsx(Button, {
|
|
427
|
+
className: cx(':Sqb-TableName-as :Sqb-TableName green-name', _defineProperty({}, 'isError', !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias))),
|
|
428
|
+
shape: 'circle',
|
|
429
|
+
iconOnly: true,
|
|
430
|
+
primary: true,
|
|
431
|
+
icon: 'As',
|
|
432
|
+
size: 'small',
|
|
433
|
+
onClick: function onClick(e) {
|
|
434
|
+
e.stopPropagation();
|
|
435
|
+
onChangeFieldAlias((v === null || v === void 0 ? void 0 : v.fieldAlias) || '', i);
|
|
436
|
+
}
|
|
437
|
+
})
|
|
438
|
+
})
|
|
439
|
+
}), "".concat(v.quotes, " ").concat(v.fieldAlias ? "as ".concat(v.fieldAlias) : ''), _jsx("span", {
|
|
440
|
+
style: {
|
|
441
|
+
fontSize: 0
|
|
442
|
+
},
|
|
443
|
+
onClick: function onClick(e) {
|
|
444
|
+
return handleDel(e, i);
|
|
445
|
+
},
|
|
446
|
+
children: _jsx(CloseIcon, {})
|
|
447
|
+
})]
|
|
448
|
+
})
|
|
445
449
|
})
|
|
446
450
|
}, i);
|
|
447
451
|
}), _jsx("div", {
|