@gingkoo/pandora-metabase 1.0.157-alpha.1 → 1.0.157-alpha.3
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/components/dialog/select-join/index.js +11 -0
- package/lib/cjs/components/icons.d.ts +1 -0
- package/lib/cjs/components/icons.js +54 -29
- package/lib/cjs/components/modules/join-data.js +5 -0
- package/lib/cjs/hooks/use-state.js +1 -13
- package/lib/cjs/store/enum.d.ts +2 -1
- package/lib/cjs/store/enum.js +1 -0
- package/lib/cjs/utils/helper.js +20 -0
- package/lib/es/components/dialog/select-join/index.js +12 -1
- package/lib/es/components/icons.d.ts +1 -0
- package/lib/es/components/icons.js +53 -28
- package/lib/es/components/modules/join-data.js +6 -1
- package/lib/es/hooks/use-state.js +1 -13
- package/lib/es/store/enum.d.ts +2 -1
- package/lib/es/store/enum.js +1 -0
- package/lib/es/utils/helper.js +20 -0
- package/package.json +1 -1
|
@@ -44,6 +44,17 @@ var JoinList = [{
|
|
|
44
44
|
cursor: 'pointer'
|
|
45
45
|
}
|
|
46
46
|
})
|
|
47
|
+
}, {
|
|
48
|
+
type: _enum.JoinEnum.full,
|
|
49
|
+
name: 'Full outer join',
|
|
50
|
+
icon: (0, _jsxRuntime.jsx)(_icons.FullJoinIcon, {
|
|
51
|
+
width: 24,
|
|
52
|
+
height: 24,
|
|
53
|
+
style: {
|
|
54
|
+
marginRight: '0.5rem',
|
|
55
|
+
cursor: 'pointer'
|
|
56
|
+
}
|
|
57
|
+
})
|
|
47
58
|
}];
|
|
48
59
|
var SelectJoin = function SelectJoin(_ref) {
|
|
49
60
|
var value = _ref.value,
|
|
@@ -15,6 +15,7 @@ export declare const SortIcon: ({ width, height }: IconProps) => React.JSX.Eleme
|
|
|
15
15
|
export declare const RowLimitIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
16
16
|
export declare const LeftJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
|
|
17
17
|
export declare const InnerJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
|
|
18
|
+
export declare const FullJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
|
|
18
19
|
export declare const UpArrowIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
19
20
|
export declare const DownArrowIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
20
21
|
export declare const CloseIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WellIcon = exports.UpArrowIcon2 = exports.UpArrowIcon = exports.TableIcon = exports.SummarizeIcon = exports.SortIcon = exports.SelectIcon = exports.SearchIcon = exports.RowLimitIcon = exports.RightArrowIcon = exports.PermissionTableIcon = exports.NotSelectIcon = exports.LetterAaIcon = exports.LeftJoinIcon = exports.LeftArrowIcon = exports.JoinDataIcon = exports.InnerJoinIcon = exports.GroupIcon = exports.ForeignKeyIcon = exports.FilterIcon = exports.DownArrowIcon2 = exports.DownArrowIcon = exports.DataSourceIcon = exports.CustomColumnIcon = exports.CloseIcon2 = exports.CloseIcon = exports.CircleIcon = exports.CalendarIcon = exports.AddIcon = void 0;
|
|
7
|
+
exports.WellIcon = exports.UpArrowIcon2 = exports.UpArrowIcon = exports.TableIcon = exports.SummarizeIcon = exports.SortIcon = exports.SelectIcon = exports.SearchIcon = exports.RowLimitIcon = exports.RightArrowIcon = exports.PermissionTableIcon = exports.NotSelectIcon = exports.LetterAaIcon = exports.LeftJoinIcon = exports.LeftArrowIcon = exports.JoinDataIcon = exports.InnerJoinIcon = exports.GroupIcon = exports.FullJoinIcon = exports.ForeignKeyIcon = exports.FilterIcon = exports.DownArrowIcon2 = exports.DownArrowIcon = exports.DataSourceIcon = exports.CustomColumnIcon = exports.CloseIcon2 = exports.CloseIcon = exports.CircleIcon = exports.CalendarIcon = exports.AddIcon = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
var CloseIcon2 = exports.CloseIcon2 = function CloseIcon2(reset) {
|
|
@@ -195,11 +195,36 @@ var InnerJoinIcon = exports.InnerJoinIcon = function InnerJoinIcon(_ref0) {
|
|
|
195
195
|
})
|
|
196
196
|
});
|
|
197
197
|
};
|
|
198
|
-
var
|
|
198
|
+
var FullJoinIcon = exports.FullJoinIcon = function FullJoinIcon(_ref1) {
|
|
199
199
|
var _ref1$width = _ref1.width,
|
|
200
|
-
width = _ref1$width === void 0 ?
|
|
200
|
+
width = _ref1$width === void 0 ? 32 : _ref1$width,
|
|
201
201
|
_ref1$height = _ref1.height,
|
|
202
|
-
height = _ref1$height === void 0 ?
|
|
202
|
+
height = _ref1$height === void 0 ? 32 : _ref1$height,
|
|
203
|
+
style = _ref1.style;
|
|
204
|
+
return (0, _jsxRuntime.jsxs)("svg", {
|
|
205
|
+
viewBox: '0 0 32 32',
|
|
206
|
+
width: width,
|
|
207
|
+
height: height,
|
|
208
|
+
fill: 'currentcolor',
|
|
209
|
+
role: 'img',
|
|
210
|
+
"aria-label": 'join_full_outer icon',
|
|
211
|
+
style: style,
|
|
212
|
+
children: [(0, _jsxRuntime.jsx)("circle", {
|
|
213
|
+
cx: '11',
|
|
214
|
+
cy: '16',
|
|
215
|
+
r: '9'
|
|
216
|
+
}), (0, _jsxRuntime.jsx)("circle", {
|
|
217
|
+
cx: '21',
|
|
218
|
+
cy: '16',
|
|
219
|
+
r: '9'
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
var UpArrowIcon = exports.UpArrowIcon = function UpArrowIcon(_ref10) {
|
|
224
|
+
var _ref10$width = _ref10.width,
|
|
225
|
+
width = _ref10$width === void 0 ? 16 : _ref10$width,
|
|
226
|
+
_ref10$height = _ref10.height,
|
|
227
|
+
height = _ref10$height === void 0 ? 17 : _ref10$height;
|
|
203
228
|
return (0, _jsxRuntime.jsx)("svg", {
|
|
204
229
|
className: 'sort-arrow',
|
|
205
230
|
viewBox: '0 0 32 34',
|
|
@@ -213,11 +238,11 @@ var UpArrowIcon = exports.UpArrowIcon = function UpArrowIcon(_ref1) {
|
|
|
213
238
|
})
|
|
214
239
|
});
|
|
215
240
|
};
|
|
216
|
-
var DownArrowIcon = exports.DownArrowIcon = function DownArrowIcon(
|
|
217
|
-
var
|
|
218
|
-
width =
|
|
219
|
-
|
|
220
|
-
height =
|
|
241
|
+
var DownArrowIcon = exports.DownArrowIcon = function DownArrowIcon(_ref11) {
|
|
242
|
+
var _ref11$width = _ref11.width,
|
|
243
|
+
width = _ref11$width === void 0 ? 16 : _ref11$width,
|
|
244
|
+
_ref11$height = _ref11.height,
|
|
245
|
+
height = _ref11$height === void 0 ? 17 : _ref11$height;
|
|
221
246
|
return (0, _jsxRuntime.jsx)("svg", {
|
|
222
247
|
className: 'sort-arrow',
|
|
223
248
|
viewBox: '0 0 32 34',
|
|
@@ -231,11 +256,11 @@ var DownArrowIcon = exports.DownArrowIcon = function DownArrowIcon(_ref10) {
|
|
|
231
256
|
})
|
|
232
257
|
});
|
|
233
258
|
};
|
|
234
|
-
var CloseIcon = exports.CloseIcon = function CloseIcon(
|
|
235
|
-
var
|
|
236
|
-
width =
|
|
237
|
-
|
|
238
|
-
height =
|
|
259
|
+
var CloseIcon = exports.CloseIcon = function CloseIcon(_ref12) {
|
|
260
|
+
var _ref12$width = _ref12.width,
|
|
261
|
+
width = _ref12$width === void 0 ? 16 : _ref12$width,
|
|
262
|
+
_ref12$height = _ref12.height,
|
|
263
|
+
height = _ref12$height === void 0 ? 16 : _ref12$height;
|
|
239
264
|
return (0, _jsxRuntime.jsx)("svg", {
|
|
240
265
|
className: 'closeIcon',
|
|
241
266
|
viewBox: '0 0 32 32',
|
|
@@ -249,11 +274,11 @@ var CloseIcon = exports.CloseIcon = function CloseIcon(_ref11) {
|
|
|
249
274
|
})
|
|
250
275
|
});
|
|
251
276
|
};
|
|
252
|
-
var AddIcon = exports.AddIcon = function AddIcon(
|
|
253
|
-
var
|
|
254
|
-
width =
|
|
255
|
-
|
|
256
|
-
height =
|
|
277
|
+
var AddIcon = exports.AddIcon = function AddIcon(_ref13) {
|
|
278
|
+
var _ref13$width = _ref13.width,
|
|
279
|
+
width = _ref13$width === void 0 ? 16 : _ref13$width,
|
|
280
|
+
_ref13$height = _ref13.height,
|
|
281
|
+
height = _ref13$height === void 0 ? 16 : _ref13$height;
|
|
257
282
|
return (0, _jsxRuntime.jsx)("svg", {
|
|
258
283
|
viewBox: '0 0 32 32',
|
|
259
284
|
width: width,
|
|
@@ -266,11 +291,11 @@ var AddIcon = exports.AddIcon = function AddIcon(_ref12) {
|
|
|
266
291
|
})
|
|
267
292
|
});
|
|
268
293
|
};
|
|
269
|
-
var TableIcon = exports.TableIcon = function TableIcon(
|
|
270
|
-
var
|
|
271
|
-
width =
|
|
272
|
-
|
|
273
|
-
height =
|
|
294
|
+
var TableIcon = exports.TableIcon = function TableIcon(_ref14) {
|
|
295
|
+
var _ref14$width = _ref14.width,
|
|
296
|
+
width = _ref14$width === void 0 ? 18 : _ref14$width,
|
|
297
|
+
_ref14$height = _ref14.height,
|
|
298
|
+
height = _ref14$height === void 0 ? 18 : _ref14$height;
|
|
274
299
|
return (0, _jsxRuntime.jsx)("svg", {
|
|
275
300
|
viewBox: '0 0 32 32',
|
|
276
301
|
width: width,
|
|
@@ -283,11 +308,11 @@ var TableIcon = exports.TableIcon = function TableIcon(_ref13) {
|
|
|
283
308
|
})
|
|
284
309
|
});
|
|
285
310
|
};
|
|
286
|
-
var SearchIcon = exports.SearchIcon = function SearchIcon(
|
|
287
|
-
var
|
|
288
|
-
width =
|
|
289
|
-
|
|
290
|
-
height =
|
|
311
|
+
var SearchIcon = exports.SearchIcon = function SearchIcon(_ref15) {
|
|
312
|
+
var _ref15$width = _ref15.width,
|
|
313
|
+
width = _ref15$width === void 0 ? 16 : _ref15$width,
|
|
314
|
+
_ref15$height = _ref15.height,
|
|
315
|
+
height = _ref15$height === void 0 ? 16 : _ref15$height;
|
|
291
316
|
return (0, _jsxRuntime.jsx)("svg", {
|
|
292
317
|
viewBox: '0 0 32 32',
|
|
293
318
|
width: width,
|
|
@@ -1378,6 +1378,11 @@ var JoinData = function JoinData(props) {
|
|
|
1378
1378
|
marginRight: '0.5rem',
|
|
1379
1379
|
cursor: 'pointer'
|
|
1380
1380
|
}
|
|
1381
|
+
}) : meta.joinType === _enum.JoinEnum.full ? (0, _jsxRuntime.jsx)(_icons.FullJoinIcon, {
|
|
1382
|
+
style: {
|
|
1383
|
+
marginRight: '0.5rem',
|
|
1384
|
+
cursor: 'pointer'
|
|
1385
|
+
}
|
|
1381
1386
|
}) : (0, _jsxRuntime.jsx)(_icons.InnerJoinIcon, {
|
|
1382
1387
|
style: {
|
|
1383
1388
|
marginRight: '0.5rem',
|
|
@@ -525,8 +525,6 @@ var useStore = function useStore() {
|
|
|
525
525
|
isSelect,
|
|
526
526
|
_isSubquery,
|
|
527
527
|
_isExit,
|
|
528
|
-
oldObj,
|
|
529
|
-
selectId,
|
|
530
528
|
_table$alias,
|
|
531
529
|
alias,
|
|
532
530
|
datasourceName,
|
|
@@ -545,17 +543,7 @@ var useStore = function useStore() {
|
|
|
545
543
|
isSelect = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : isSelectFields;
|
|
546
544
|
_isSubquery = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : isSubquery;
|
|
547
545
|
_isExit = _args8.length > 6 && _args8[6] !== undefined ? _args8[6] : isExit;
|
|
548
|
-
oldObj = {};
|
|
549
|
-
selectId = oldColumns.filter(function (v) {
|
|
550
|
-
oldObj[v.id] = v;
|
|
551
|
-
return v.select;
|
|
552
|
-
}).map(function (v) {
|
|
553
|
-
return v.id;
|
|
554
|
-
}).filter(function (v) {
|
|
555
|
-
return v;
|
|
556
|
-
});
|
|
557
546
|
if (_isSubquery && oldColumns.length < 1) {
|
|
558
|
-
selectId = [];
|
|
559
547
|
isSelect = false;
|
|
560
548
|
}
|
|
561
549
|
_table$alias = table.alias, alias = _table$alias === void 0 ? '' : _table$alias, datasourceName = table.datasourceName, did = table.datasourceId, column = table.column, extra = (0, _objectWithoutProperties2["default"])(table, _excluded);
|
|
@@ -578,7 +566,7 @@ var useStore = function useStore() {
|
|
|
578
566
|
var obj = oldColumns.find(function (oldColumn) {
|
|
579
567
|
return (0, _helper.isSameColumnByIdFirst)(oldColumn, v);
|
|
580
568
|
});
|
|
581
|
-
var select =
|
|
569
|
+
var select = Boolean(obj === null || obj === void 0 ? void 0 : obj.select);
|
|
582
570
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, obj), v), {}, {
|
|
583
571
|
select: isSelect || select,
|
|
584
572
|
fieldAlias: (_ref9 = (_obj$fieldAlias = obj === null || obj === void 0 ? void 0 : obj.fieldAlias) !== null && _obj$fieldAlias !== void 0 ? _obj$fieldAlias : v.fieldAlias) !== null && _ref9 !== void 0 ? _ref9 : '',
|
package/lib/cjs/store/enum.d.ts
CHANGED
package/lib/cjs/store/enum.js
CHANGED
package/lib/cjs/utils/helper.js
CHANGED
|
@@ -28,6 +28,15 @@ var getColumnIdNameParts = function getColumnIdNameParts() {
|
|
|
28
28
|
name: normalizeId(column.fieldName || column.name)
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
var getSummarizeOutputName = function getSummarizeOutputName() {
|
|
32
|
+
var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33
|
+
return normalizeId(column.name || column.fieldName || column.fieldAlias);
|
|
34
|
+
};
|
|
35
|
+
var areSummarizeOutputColumns = function areSummarizeOutputColumns() {
|
|
36
|
+
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
|
+
var right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
38
|
+
return Boolean(left.summarizeType && right.summarizeType);
|
|
39
|
+
};
|
|
31
40
|
var isSameTableByIdName = exports.isSameTableByIdName = function isSameTableByIdName() {
|
|
32
41
|
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33
42
|
var right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -107,6 +116,10 @@ var isSameTableByIdFirst = exports.isSameTableByIdFirst = function isSameTableBy
|
|
|
107
116
|
var getColumnIdFirstKey = exports.getColumnIdFirstKey = function getColumnIdFirstKey() {
|
|
108
117
|
var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
109
118
|
var tableKey = getTableIdFirstKey(column);
|
|
119
|
+
var summarizeOutputName = column.summarizeType ? getSummarizeOutputName(column) : '';
|
|
120
|
+
if (summarizeOutputName) {
|
|
121
|
+
return "".concat(tableKey, "|summarizeType:").concat(column.summarizeType, "|output:").concat(summarizeOutputName);
|
|
122
|
+
}
|
|
110
123
|
var fieldId = normalizeId(column.fieldId || column.id);
|
|
111
124
|
if (fieldId) return "".concat(tableKey, "|fieldId:").concat(fieldId);
|
|
112
125
|
var fieldUuid = normalizeId(column.fieldUuid);
|
|
@@ -133,6 +146,13 @@ var isSameColumnByIdFirst = exports.isSameColumnByIdFirst = function isSameColum
|
|
|
133
146
|
if (hasBoth(leftTableUuid, rightTableUuid) && leftTableUuid !== rightTableUuid) {
|
|
134
147
|
return false;
|
|
135
148
|
}
|
|
149
|
+
if (areSummarizeOutputColumns(left, right)) {
|
|
150
|
+
var leftOutputName = getSummarizeOutputName(left);
|
|
151
|
+
var rightOutputName = getSummarizeOutputName(right);
|
|
152
|
+
if (hasBoth(leftOutputName, rightOutputName)) {
|
|
153
|
+
return left.summarizeType === right.summarizeType && leftOutputName === rightOutputName;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
136
156
|
var leftFieldId = normalizeId(left.fieldId || left.id);
|
|
137
157
|
var rightFieldId = normalizeId(right.fieldId || right.id);
|
|
138
158
|
if (hasBoth(leftFieldId, rightFieldId)) {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import './index.less';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { JoinEnum } from '../../../store/enum';
|
|
5
|
-
import { LeftJoinIcon, InnerJoinIcon } from '../../icons';
|
|
5
|
+
import { LeftJoinIcon, InnerJoinIcon, FullJoinIcon } from '../../icons';
|
|
6
6
|
var JoinList = [{
|
|
7
7
|
type: JoinEnum.left,
|
|
8
8
|
name: 'Left outer join',
|
|
@@ -37,6 +37,17 @@ var JoinList = [{
|
|
|
37
37
|
cursor: 'pointer'
|
|
38
38
|
}
|
|
39
39
|
})
|
|
40
|
+
}, {
|
|
41
|
+
type: JoinEnum.full,
|
|
42
|
+
name: 'Full outer join',
|
|
43
|
+
icon: _jsx(FullJoinIcon, {
|
|
44
|
+
width: 24,
|
|
45
|
+
height: 24,
|
|
46
|
+
style: {
|
|
47
|
+
marginRight: '0.5rem',
|
|
48
|
+
cursor: 'pointer'
|
|
49
|
+
}
|
|
50
|
+
})
|
|
40
51
|
}];
|
|
41
52
|
var SelectJoin = function SelectJoin(_ref) {
|
|
42
53
|
var value = _ref.value,
|
|
@@ -15,6 +15,7 @@ export declare const SortIcon: ({ width, height }: IconProps) => React.JSX.Eleme
|
|
|
15
15
|
export declare const RowLimitIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
16
16
|
export declare const LeftJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
|
|
17
17
|
export declare const InnerJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
|
|
18
|
+
export declare const FullJoinIcon: ({ width, height, style }: IconProps) => React.JSX.Element;
|
|
18
19
|
export declare const UpArrowIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
19
20
|
export declare const DownArrowIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
20
21
|
export declare const CloseIcon: ({ width, height }: IconProps) => React.JSX.Element;
|
|
@@ -188,11 +188,36 @@ export var InnerJoinIcon = function InnerJoinIcon(_ref0) {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
};
|
|
191
|
-
export var
|
|
191
|
+
export var FullJoinIcon = function FullJoinIcon(_ref1) {
|
|
192
192
|
var _ref1$width = _ref1.width,
|
|
193
|
-
width = _ref1$width === void 0 ?
|
|
193
|
+
width = _ref1$width === void 0 ? 32 : _ref1$width,
|
|
194
194
|
_ref1$height = _ref1.height,
|
|
195
|
-
height = _ref1$height === void 0 ?
|
|
195
|
+
height = _ref1$height === void 0 ? 32 : _ref1$height,
|
|
196
|
+
style = _ref1.style;
|
|
197
|
+
return _jsxs("svg", {
|
|
198
|
+
viewBox: '0 0 32 32',
|
|
199
|
+
width: width,
|
|
200
|
+
height: height,
|
|
201
|
+
fill: 'currentcolor',
|
|
202
|
+
role: 'img',
|
|
203
|
+
"aria-label": 'join_full_outer icon',
|
|
204
|
+
style: style,
|
|
205
|
+
children: [_jsx("circle", {
|
|
206
|
+
cx: '11',
|
|
207
|
+
cy: '16',
|
|
208
|
+
r: '9'
|
|
209
|
+
}), _jsx("circle", {
|
|
210
|
+
cx: '21',
|
|
211
|
+
cy: '16',
|
|
212
|
+
r: '9'
|
|
213
|
+
})]
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
export var UpArrowIcon = function UpArrowIcon(_ref10) {
|
|
217
|
+
var _ref10$width = _ref10.width,
|
|
218
|
+
width = _ref10$width === void 0 ? 16 : _ref10$width,
|
|
219
|
+
_ref10$height = _ref10.height,
|
|
220
|
+
height = _ref10$height === void 0 ? 17 : _ref10$height;
|
|
196
221
|
return _jsx("svg", {
|
|
197
222
|
className: 'sort-arrow',
|
|
198
223
|
viewBox: '0 0 32 34',
|
|
@@ -206,11 +231,11 @@ export var UpArrowIcon = function UpArrowIcon(_ref1) {
|
|
|
206
231
|
})
|
|
207
232
|
});
|
|
208
233
|
};
|
|
209
|
-
export var DownArrowIcon = function DownArrowIcon(
|
|
210
|
-
var
|
|
211
|
-
width =
|
|
212
|
-
|
|
213
|
-
height =
|
|
234
|
+
export var DownArrowIcon = function DownArrowIcon(_ref11) {
|
|
235
|
+
var _ref11$width = _ref11.width,
|
|
236
|
+
width = _ref11$width === void 0 ? 16 : _ref11$width,
|
|
237
|
+
_ref11$height = _ref11.height,
|
|
238
|
+
height = _ref11$height === void 0 ? 17 : _ref11$height;
|
|
214
239
|
return _jsx("svg", {
|
|
215
240
|
className: 'sort-arrow',
|
|
216
241
|
viewBox: '0 0 32 34',
|
|
@@ -224,11 +249,11 @@ export var DownArrowIcon = function DownArrowIcon(_ref10) {
|
|
|
224
249
|
})
|
|
225
250
|
});
|
|
226
251
|
};
|
|
227
|
-
export var CloseIcon = function CloseIcon(
|
|
228
|
-
var
|
|
229
|
-
width =
|
|
230
|
-
|
|
231
|
-
height =
|
|
252
|
+
export var CloseIcon = function CloseIcon(_ref12) {
|
|
253
|
+
var _ref12$width = _ref12.width,
|
|
254
|
+
width = _ref12$width === void 0 ? 16 : _ref12$width,
|
|
255
|
+
_ref12$height = _ref12.height,
|
|
256
|
+
height = _ref12$height === void 0 ? 16 : _ref12$height;
|
|
232
257
|
return _jsx("svg", {
|
|
233
258
|
className: 'closeIcon',
|
|
234
259
|
viewBox: '0 0 32 32',
|
|
@@ -242,11 +267,11 @@ export var CloseIcon = function CloseIcon(_ref11) {
|
|
|
242
267
|
})
|
|
243
268
|
});
|
|
244
269
|
};
|
|
245
|
-
export var AddIcon = function AddIcon(
|
|
246
|
-
var
|
|
247
|
-
width =
|
|
248
|
-
|
|
249
|
-
height =
|
|
270
|
+
export var AddIcon = function AddIcon(_ref13) {
|
|
271
|
+
var _ref13$width = _ref13.width,
|
|
272
|
+
width = _ref13$width === void 0 ? 16 : _ref13$width,
|
|
273
|
+
_ref13$height = _ref13.height,
|
|
274
|
+
height = _ref13$height === void 0 ? 16 : _ref13$height;
|
|
250
275
|
return _jsx("svg", {
|
|
251
276
|
viewBox: '0 0 32 32',
|
|
252
277
|
width: width,
|
|
@@ -259,11 +284,11 @@ export var AddIcon = function AddIcon(_ref12) {
|
|
|
259
284
|
})
|
|
260
285
|
});
|
|
261
286
|
};
|
|
262
|
-
export var TableIcon = function TableIcon(
|
|
263
|
-
var
|
|
264
|
-
width =
|
|
265
|
-
|
|
266
|
-
height =
|
|
287
|
+
export var TableIcon = function TableIcon(_ref14) {
|
|
288
|
+
var _ref14$width = _ref14.width,
|
|
289
|
+
width = _ref14$width === void 0 ? 18 : _ref14$width,
|
|
290
|
+
_ref14$height = _ref14.height,
|
|
291
|
+
height = _ref14$height === void 0 ? 18 : _ref14$height;
|
|
267
292
|
return _jsx("svg", {
|
|
268
293
|
viewBox: '0 0 32 32',
|
|
269
294
|
width: width,
|
|
@@ -276,11 +301,11 @@ export var TableIcon = function TableIcon(_ref13) {
|
|
|
276
301
|
})
|
|
277
302
|
});
|
|
278
303
|
};
|
|
279
|
-
export var SearchIcon = function SearchIcon(
|
|
280
|
-
var
|
|
281
|
-
width =
|
|
282
|
-
|
|
283
|
-
height =
|
|
304
|
+
export var SearchIcon = function SearchIcon(_ref15) {
|
|
305
|
+
var _ref15$width = _ref15.width,
|
|
306
|
+
width = _ref15$width === void 0 ? 16 : _ref15$width,
|
|
307
|
+
_ref15$height = _ref15.height,
|
|
308
|
+
height = _ref15$height === void 0 ? 16 : _ref15$height;
|
|
284
309
|
return _jsx("svg", {
|
|
285
310
|
viewBox: '0 0 32 32',
|
|
286
311
|
width: width,
|
|
@@ -28,7 +28,7 @@ import NextDom from './components/meta-icon';
|
|
|
28
28
|
import Header from './components/header';
|
|
29
29
|
import ItemWrapper from './components/item-wrapper';
|
|
30
30
|
import SelectList from '../dialog/select-list';
|
|
31
|
-
import { LeftJoinIcon, InnerJoinIcon } from '../icons';
|
|
31
|
+
import { LeftJoinIcon, InnerJoinIcon, FullJoinIcon } from '../icons';
|
|
32
32
|
import { SelectTable, SelectJoin, SelectColumnMultiple, SelectColumn, Expression, SelectPermissionTable, FormulaList, getTemplateItem } from '../dialog';
|
|
33
33
|
import { useStore } from '../../hooks/use-provider';
|
|
34
34
|
var PrevResult = 'Previous results';
|
|
@@ -1372,6 +1372,11 @@ var JoinData = function JoinData(props) {
|
|
|
1372
1372
|
marginRight: '0.5rem',
|
|
1373
1373
|
cursor: 'pointer'
|
|
1374
1374
|
}
|
|
1375
|
+
}) : meta.joinType === JoinEnum.full ? _jsx(FullJoinIcon, {
|
|
1376
|
+
style: {
|
|
1377
|
+
marginRight: '0.5rem',
|
|
1378
|
+
cursor: 'pointer'
|
|
1379
|
+
}
|
|
1375
1380
|
}) : _jsx(InnerJoinIcon, {
|
|
1376
1381
|
style: {
|
|
1377
1382
|
marginRight: '0.5rem',
|
|
@@ -519,8 +519,6 @@ var useStore = function useStore() {
|
|
|
519
519
|
isSelect,
|
|
520
520
|
_isSubquery,
|
|
521
521
|
_isExit,
|
|
522
|
-
oldObj,
|
|
523
|
-
selectId,
|
|
524
522
|
_table$alias,
|
|
525
523
|
alias,
|
|
526
524
|
datasourceName,
|
|
@@ -539,17 +537,7 @@ var useStore = function useStore() {
|
|
|
539
537
|
isSelect = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : isSelectFields;
|
|
540
538
|
_isSubquery = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : isSubquery;
|
|
541
539
|
_isExit = _args8.length > 6 && _args8[6] !== undefined ? _args8[6] : isExit;
|
|
542
|
-
oldObj = {};
|
|
543
|
-
selectId = oldColumns.filter(function (v) {
|
|
544
|
-
oldObj[v.id] = v;
|
|
545
|
-
return v.select;
|
|
546
|
-
}).map(function (v) {
|
|
547
|
-
return v.id;
|
|
548
|
-
}).filter(function (v) {
|
|
549
|
-
return v;
|
|
550
|
-
});
|
|
551
540
|
if (_isSubquery && oldColumns.length < 1) {
|
|
552
|
-
selectId = [];
|
|
553
541
|
isSelect = false;
|
|
554
542
|
}
|
|
555
543
|
_table$alias = table.alias, alias = _table$alias === void 0 ? '' : _table$alias, datasourceName = table.datasourceName, did = table.datasourceId, column = table.column, extra = _objectWithoutProperties(table, _excluded);
|
|
@@ -572,7 +560,7 @@ var useStore = function useStore() {
|
|
|
572
560
|
var obj = oldColumns.find(function (oldColumn) {
|
|
573
561
|
return isSameColumnByIdFirst(oldColumn, v);
|
|
574
562
|
});
|
|
575
|
-
var select =
|
|
563
|
+
var select = Boolean(obj === null || obj === void 0 ? void 0 : obj.select);
|
|
576
564
|
return _objectSpread(_objectSpread(_objectSpread({}, obj), v), {}, {
|
|
577
565
|
select: isSelect || select,
|
|
578
566
|
fieldAlias: (_ref9 = (_obj$fieldAlias = obj === null || obj === void 0 ? void 0 : obj.fieldAlias) !== null && _obj$fieldAlias !== void 0 ? _obj$fieldAlias : v.fieldAlias) !== null && _ref9 !== void 0 ? _ref9 : '',
|
package/lib/es/store/enum.d.ts
CHANGED
package/lib/es/store/enum.js
CHANGED
package/lib/es/utils/helper.js
CHANGED
|
@@ -21,6 +21,15 @@ var getColumnIdNameParts = function getColumnIdNameParts() {
|
|
|
21
21
|
name: normalizeId(column.fieldName || column.name)
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
+
var getSummarizeOutputName = function getSummarizeOutputName() {
|
|
25
|
+
var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
|
+
return normalizeId(column.name || column.fieldName || column.fieldAlias);
|
|
27
|
+
};
|
|
28
|
+
var areSummarizeOutputColumns = function areSummarizeOutputColumns() {
|
|
29
|
+
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
|
+
var right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
31
|
+
return Boolean(left.summarizeType && right.summarizeType);
|
|
32
|
+
};
|
|
24
33
|
export var isSameTableByIdName = function isSameTableByIdName() {
|
|
25
34
|
var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
35
|
var right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -100,6 +109,10 @@ export var isSameTableByIdFirst = function isSameTableByIdFirst() {
|
|
|
100
109
|
export var getColumnIdFirstKey = function getColumnIdFirstKey() {
|
|
101
110
|
var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
102
111
|
var tableKey = getTableIdFirstKey(column);
|
|
112
|
+
var summarizeOutputName = column.summarizeType ? getSummarizeOutputName(column) : '';
|
|
113
|
+
if (summarizeOutputName) {
|
|
114
|
+
return "".concat(tableKey, "|summarizeType:").concat(column.summarizeType, "|output:").concat(summarizeOutputName);
|
|
115
|
+
}
|
|
103
116
|
var fieldId = normalizeId(column.fieldId || column.id);
|
|
104
117
|
if (fieldId) return "".concat(tableKey, "|fieldId:").concat(fieldId);
|
|
105
118
|
var fieldUuid = normalizeId(column.fieldUuid);
|
|
@@ -126,6 +139,13 @@ export var isSameColumnByIdFirst = function isSameColumnByIdFirst() {
|
|
|
126
139
|
if (hasBoth(leftTableUuid, rightTableUuid) && leftTableUuid !== rightTableUuid) {
|
|
127
140
|
return false;
|
|
128
141
|
}
|
|
142
|
+
if (areSummarizeOutputColumns(left, right)) {
|
|
143
|
+
var leftOutputName = getSummarizeOutputName(left);
|
|
144
|
+
var rightOutputName = getSummarizeOutputName(right);
|
|
145
|
+
if (hasBoth(leftOutputName, rightOutputName)) {
|
|
146
|
+
return left.summarizeType === right.summarizeType && leftOutputName === rightOutputName;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
129
149
|
var leftFieldId = normalizeId(left.fieldId || left.id);
|
|
130
150
|
var rightFieldId = normalizeId(right.fieldId || right.id);
|
|
131
151
|
if (hasBoth(leftFieldId, rightFieldId)) {
|