@gingkoo/pandora-metabase 1.0.82 → 1.0.83
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/formula-list/index.js +137 -74
- package/lib/cjs/components/dialog/formula-list/index.less +13 -0
- package/lib/cjs/components/metabase/index.js +26 -4
- package/lib/cjs/components/metabase/index.less +32 -1
- package/lib/cjs/components/modules/components/header.d.ts +2 -0
- package/lib/cjs/components/modules/components/header.js +11 -6
- package/lib/cjs/components/modules/components/item-wrapper.d.ts +9 -0
- package/lib/cjs/components/modules/components/item-wrapper.js +45 -0
- package/lib/cjs/components/modules/components/meta-icon.d.ts +11 -0
- package/lib/cjs/components/modules/components/meta-icon.js +60 -12
- package/lib/cjs/components/modules/custom-column.js +34 -28
- package/lib/cjs/components/modules/filter.js +18 -12
- package/lib/cjs/components/modules/join-data.js +417 -411
- package/lib/cjs/components/modules/permission-table.js +17 -11
- package/lib/cjs/components/modules/row-limit.js +18 -12
- package/lib/cjs/components/modules/sort.js +33 -27
- package/lib/cjs/components/modules/summarize/index.js +26 -20
- package/lib/cjs/components/modules/table-data.js +137 -131
- package/lib/cjs/components/modules/union.js +14 -8
- package/lib/cjs/hooks/use-state.js +44 -4
- package/lib/cjs/index.js +5 -2
- package/lib/cjs/locale/en.js +5 -3
- package/lib/cjs/locale/zh.js +5 -3
- package/lib/cjs/types.d.ts +1 -0
- package/lib/cjs/utils/storage.d.ts +1 -0
- package/lib/cjs/utils/storage.js +2 -1
- package/lib/cjs/utils.d.ts +6 -0
- package/lib/cjs/utils.js +23 -3
- package/lib/es/components/dialog/formula-list/index.js +137 -76
- package/lib/es/components/dialog/formula-list/index.less +13 -0
- package/lib/es/components/metabase/index.js +26 -4
- package/lib/es/components/metabase/index.less +32 -1
- package/lib/es/components/modules/components/header.d.ts +2 -0
- package/lib/es/components/modules/components/header.js +12 -7
- package/lib/es/components/modules/components/item-wrapper.d.ts +9 -0
- package/lib/es/components/modules/components/item-wrapper.js +38 -0
- package/lib/es/components/modules/components/meta-icon.d.ts +11 -0
- package/lib/es/components/modules/components/meta-icon.js +60 -14
- package/lib/es/components/modules/custom-column.js +34 -28
- package/lib/es/components/modules/filter.js +18 -12
- package/lib/es/components/modules/join-data.js +417 -411
- package/lib/es/components/modules/permission-table.js +17 -11
- package/lib/es/components/modules/row-limit.js +18 -12
- package/lib/es/components/modules/sort.js +33 -27
- package/lib/es/components/modules/summarize/index.js +26 -20
- package/lib/es/components/modules/table-data.js +137 -131
- package/lib/es/components/modules/union.js +14 -8
- package/lib/es/hooks/use-state.js +44 -4
- package/lib/es/index.js +5 -2
- package/lib/es/locale/en.js +5 -3
- package/lib/es/locale/zh.js +5 -3
- package/lib/es/types.d.ts +1 -0
- package/lib/es/utils/storage.d.ts +1 -0
- package/lib/es/utils/storage.js +2 -1
- package/lib/es/utils.d.ts +6 -0
- package/lib/es/utils.js +21 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import { getHelper } from '../../utils';
|
|
|
8
8
|
import Wrapper from './components/Wrapper';
|
|
9
9
|
import NextDom from './components/meta-icon';
|
|
10
10
|
import Header from './components/header';
|
|
11
|
+
import ItemWrapper from './components/item-wrapper';
|
|
11
12
|
import { useStore } from '../../hooks/use-provider';
|
|
12
13
|
import { uuidv4 } from '../../utils/helper';
|
|
13
14
|
import ItemName from './components/item-name';
|
|
@@ -113,23 +114,28 @@ var PermissionTable = function PermissionTable(props) {
|
|
|
113
114
|
className: "Sqb-hover-parent",
|
|
114
115
|
children: [_jsx(Header, {
|
|
115
116
|
meta: meta,
|
|
117
|
+
groupIndex: groupIndex,
|
|
116
118
|
className: 'gray-text',
|
|
117
119
|
title: __('SqlQueryBuilder.permissionTable'),
|
|
118
120
|
onClose: function onClose() {
|
|
119
121
|
return store.delMeta(meta, groupIndex);
|
|
120
122
|
}
|
|
121
|
-
}), _jsx(
|
|
122
|
-
|
|
123
|
+
}), _jsx(ItemWrapper, {
|
|
124
|
+
meta: meta,
|
|
125
|
+
groupIndex: groupIndex,
|
|
123
126
|
children: _jsx("div", {
|
|
124
|
-
className: "Sqb-
|
|
125
|
-
children: _jsx(
|
|
126
|
-
|
|
127
|
-
children: _jsx(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
className: "Sqb-item--content",
|
|
128
|
+
children: _jsx("div", {
|
|
129
|
+
className: "Sqb-NotebookCell gray-bg",
|
|
130
|
+
children: _jsx(ItemName, {
|
|
131
|
+
isError: tableIsError(),
|
|
132
|
+
children: _jsx("div", {
|
|
133
|
+
className: cx("Sqb-TableName", {
|
|
134
|
+
notSelected: !selected
|
|
135
|
+
}),
|
|
136
|
+
onClick: selectTable,
|
|
137
|
+
children: selected ? "".concat(meta.table.datasourceName ? "".concat(meta.table.datasourceName, ".") : '').concat(meta.table.name === SummarizeAlias ? PrevResult : meta.table.name) : __('SqlQueryBuilder.pickPermissionTable')
|
|
138
|
+
})
|
|
133
139
|
})
|
|
134
140
|
})
|
|
135
141
|
})
|
|
@@ -6,6 +6,7 @@ import { findIndex } from '../../utils';
|
|
|
6
6
|
import Wrapper from './components/Wrapper';
|
|
7
7
|
import NextDom from './components/meta-icon';
|
|
8
8
|
import Header from './components/header';
|
|
9
|
+
import ItemWrapper from './components/item-wrapper';
|
|
9
10
|
import { useStore } from '../../hooks/use-provider';
|
|
10
11
|
var RowLimit = function RowLimit(props) {
|
|
11
12
|
var meta = props.meta,
|
|
@@ -24,24 +25,29 @@ var RowLimit = function RowLimit(props) {
|
|
|
24
25
|
className: cx("Sqb-hover-parent"),
|
|
25
26
|
children: [_jsx(Header, {
|
|
26
27
|
meta: meta,
|
|
28
|
+
groupIndex: groupIndex,
|
|
27
29
|
className: 'gray-text',
|
|
28
30
|
title: __('SqlQueryBuilder.rowLimit'),
|
|
29
31
|
onClose: function onClose() {
|
|
30
32
|
return store.delMeta(meta, groupIndex);
|
|
31
33
|
}
|
|
32
|
-
}), _jsx(
|
|
33
|
-
|
|
34
|
+
}), _jsx(ItemWrapper, {
|
|
35
|
+
meta: meta,
|
|
36
|
+
groupIndex: groupIndex,
|
|
34
37
|
children: _jsx("div", {
|
|
35
|
-
className: cx("Sqb-
|
|
36
|
-
children: _jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
className: cx("Sqb-item--content"),
|
|
39
|
+
children: _jsx("div", {
|
|
40
|
+
className: cx("Sqb-NotebookCell gray-bg"),
|
|
41
|
+
children: _jsx(InputNumber, {
|
|
42
|
+
value: meta.limit,
|
|
43
|
+
min: 1,
|
|
44
|
+
style: {
|
|
45
|
+
width: 200
|
|
46
|
+
},
|
|
47
|
+
onChange: handleChange,
|
|
48
|
+
placeholder: __('rowLimit.pleaseEnter'),
|
|
49
|
+
precision: 0
|
|
50
|
+
})
|
|
45
51
|
})
|
|
46
52
|
})
|
|
47
53
|
}), _jsx(NextDom, {
|
|
@@ -12,6 +12,7 @@ import { SelectColumnMultiple } from '../dialog';
|
|
|
12
12
|
import Wrapper from './components/Wrapper';
|
|
13
13
|
import NextDom from './components/meta-icon';
|
|
14
14
|
import Header from './components/header';
|
|
15
|
+
import ItemWrapper from './components/item-wrapper';
|
|
15
16
|
import { useStore } from '../../hooks/use-provider';
|
|
16
17
|
import ItemName from './components/item-name';
|
|
17
18
|
var Sort = function Sort(props) {
|
|
@@ -235,39 +236,44 @@ var Sort = function Sort(props) {
|
|
|
235
236
|
className: cx("Sqb-hover-parent"),
|
|
236
237
|
children: [_jsx(Header, {
|
|
237
238
|
meta: meta,
|
|
239
|
+
groupIndex: groupIndex,
|
|
238
240
|
className: 'gray-text',
|
|
239
241
|
title: __('SqlQueryBuilder.sort'),
|
|
240
242
|
onClose: function onClose() {
|
|
241
243
|
return store.delMeta(meta, groupIndex);
|
|
242
244
|
}
|
|
243
|
-
}), _jsx(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
fontSize: 0
|
|
258
|
-
},
|
|
259
|
-
onClick: function onClick(e) {
|
|
260
|
-
return delSortColumn(e, i);
|
|
245
|
+
}), _jsx(ItemWrapper, {
|
|
246
|
+
meta: meta,
|
|
247
|
+
groupIndex: groupIndex,
|
|
248
|
+
children: _jsx("div", {
|
|
249
|
+
className: cx("Sqb-item--content"),
|
|
250
|
+
children: _jsxs("div", {
|
|
251
|
+
className: cx("Sqb-NotebookCell gray-bg"),
|
|
252
|
+
children: [sort.map(function (v, i) {
|
|
253
|
+
return _jsx(ItemName, {
|
|
254
|
+
isError: isError(v.expression, getColumns()),
|
|
255
|
+
children: _jsxs("div", {
|
|
256
|
+
className: "Sqb-TableName gray-name",
|
|
257
|
+
onClick: function onClick() {
|
|
258
|
+
return handleSort(i);
|
|
261
259
|
},
|
|
262
|
-
children: _jsx(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
260
|
+
children: [v.sort === SortEnum.asc ? _jsx(UpArrowIcon, {}) : _jsx(DownArrowIcon, {}), getName(v.expression), _jsx("span", {
|
|
261
|
+
style: {
|
|
262
|
+
fontSize: 0
|
|
263
|
+
},
|
|
264
|
+
onClick: function onClick(e) {
|
|
265
|
+
return delSortColumn(e, i);
|
|
266
|
+
},
|
|
267
|
+
children: _jsx(CloseIcon, {})
|
|
268
|
+
})]
|
|
269
|
+
}, i)
|
|
270
|
+
}, i);
|
|
271
|
+
}), _jsx("div", {
|
|
272
|
+
className: "Sqb-TableName gray-name",
|
|
273
|
+
onClick: addSortColumn,
|
|
274
|
+
children: _jsx(AddIcon, {})
|
|
275
|
+
})]
|
|
276
|
+
})
|
|
271
277
|
})
|
|
272
278
|
}), _jsx(NextDom, {
|
|
273
279
|
meta: meta,
|
|
@@ -4,6 +4,7 @@ import { __ } from '../../../locale';
|
|
|
4
4
|
import Wrapper from '../components/Wrapper';
|
|
5
5
|
import NextDom from '../components/meta-icon';
|
|
6
6
|
import Header from '../components/header';
|
|
7
|
+
import ItemWrapper from '../components/item-wrapper';
|
|
7
8
|
import GroupBy from './group-by';
|
|
8
9
|
import SelectIndex from './select-index';
|
|
9
10
|
import { useStore } from '../../../hooks/use-provider';
|
|
@@ -17,6 +18,7 @@ var Summarize = function Summarize(props) {
|
|
|
17
18
|
className: cx("Sqb-hover-parent"),
|
|
18
19
|
children: [_jsx(Header, {
|
|
19
20
|
meta: meta,
|
|
21
|
+
groupIndex: groupIndex,
|
|
20
22
|
className: 'green-text',
|
|
21
23
|
title: __('SqlQueryBuilder.summarize'),
|
|
22
24
|
onClose: function onClose() {
|
|
@@ -25,26 +27,30 @@ var Summarize = function Summarize(props) {
|
|
|
25
27
|
});
|
|
26
28
|
store.delMeta(meta, groupIndex);
|
|
27
29
|
}
|
|
28
|
-
}), _jsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
}), _jsx(ItemWrapper, {
|
|
31
|
+
meta: meta,
|
|
32
|
+
groupIndex: groupIndex,
|
|
33
|
+
children: _jsx("div", {
|
|
34
|
+
className: cx("Sqb-item--content"),
|
|
35
|
+
children: _jsxs("div", {
|
|
36
|
+
className: 'flex-row',
|
|
37
|
+
children: [_jsx("div", {
|
|
38
|
+
className: "Sqb-NotebookCell green-bg",
|
|
39
|
+
children: _jsx(SelectIndex, {
|
|
40
|
+
meta: meta,
|
|
41
|
+
groupIndex: groupIndex
|
|
42
|
+
})
|
|
43
|
+
}), _jsx("div", {
|
|
44
|
+
className: 'pass',
|
|
45
|
+
children: __('SqlQueryBuilder.by')
|
|
46
|
+
}), _jsx("div", {
|
|
47
|
+
className: "Sqb-NotebookCell green-bg",
|
|
48
|
+
children: _jsx(GroupBy, {
|
|
49
|
+
meta: meta,
|
|
50
|
+
groupIndex: groupIndex
|
|
51
|
+
})
|
|
52
|
+
})]
|
|
53
|
+
})
|
|
48
54
|
})
|
|
49
55
|
}), _jsx(NextDom, {
|
|
50
56
|
meta: meta,
|
|
@@ -21,6 +21,7 @@ import { SelectTable, SelectColumn } from '../dialog';
|
|
|
21
21
|
import Wrapper from './components/Wrapper';
|
|
22
22
|
import NextDom from './components/meta-icon';
|
|
23
23
|
import Header from './components/header';
|
|
24
|
+
import ItemWrapper from './components/item-wrapper';
|
|
24
25
|
import { ExclamationCircleFill } from '@gingkoo/pandora-icons';
|
|
25
26
|
import { useStore } from '../../hooks/use-provider';
|
|
26
27
|
var TableData = function TableData(props) {
|
|
@@ -291,141 +292,146 @@ var TableData = function TableData(props) {
|
|
|
291
292
|
className: "Sqb-hover-parent",
|
|
292
293
|
children: [_jsx(Header, {
|
|
293
294
|
meta: meta,
|
|
295
|
+
groupIndex: groupIndex,
|
|
294
296
|
isDataModule: props.groupIndex === 0,
|
|
295
297
|
title: __('SqlQueryBuilder.data')
|
|
296
|
-
}), _jsx(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
298
|
+
}), _jsx(ItemWrapper, {
|
|
299
|
+
meta: meta,
|
|
300
|
+
groupIndex: groupIndex,
|
|
301
|
+
children: _jsx("div", {
|
|
302
|
+
className: "Sqb-item--content",
|
|
303
|
+
children: _jsxs("div", {
|
|
304
|
+
className: "Sqb-NotebookCell",
|
|
305
|
+
children: [meta.isSubquery ? _jsxs("div", {
|
|
306
|
+
className: cx("Sqb-TableName", {
|
|
307
|
+
notSelected: !subQuerySelected
|
|
308
|
+
}),
|
|
309
|
+
onClick: function onClick() {
|
|
310
|
+
showSubQuery(meta.subquery);
|
|
311
|
+
},
|
|
312
|
+
children: [subQuerySelected && _jsx(_Fragment, {
|
|
313
|
+
children: function () {
|
|
314
|
+
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
315
|
+
var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
316
|
+
return showButton ? _jsx(Tooltip, {
|
|
317
|
+
title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
318
|
+
children: _jsx(Button, {
|
|
319
|
+
danger: tableIsError(),
|
|
320
|
+
className: cx(':Sqb-TableName-as', {
|
|
321
|
+
isError: tableIsError()
|
|
322
|
+
}),
|
|
323
|
+
shape: 'circle',
|
|
324
|
+
style: isDel ? {
|
|
325
|
+
fontSize: 18,
|
|
326
|
+
backgroundColor: '#fff',
|
|
327
|
+
width: 'auto',
|
|
328
|
+
height: 'auto'
|
|
329
|
+
} : {},
|
|
330
|
+
iconOnly: true,
|
|
331
|
+
primary: !isDel,
|
|
332
|
+
icon: icon,
|
|
333
|
+
size: 'small',
|
|
334
|
+
onClick: function onClick(e) {
|
|
335
|
+
if (store.tableEnableAlias) {
|
|
336
|
+
var _meta$table4;
|
|
337
|
+
e.stopPropagation();
|
|
338
|
+
onChangeTableAlias(((_meta$table4 = meta.table) === null || _meta$table4 === void 0 ? void 0 : _meta$table4.alias) || '');
|
|
339
|
+
}
|
|
334
340
|
}
|
|
335
|
-
}
|
|
336
|
-
})
|
|
337
|
-
})
|
|
338
|
-
}()
|
|
339
|
-
})
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
341
|
+
})
|
|
342
|
+
}) : null;
|
|
343
|
+
}()
|
|
344
|
+
}), 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$table5 = meta.table) !== null && _meta$table5 !== void 0 && _meta$table5.alias && store.tableEnableAlias ? "as ".concat((_meta$table6 = meta.table) === null || _meta$table6 === void 0 ? void 0 : _meta$table6.alias) : '', " ") : __('SqlQueryBuilder.setSubQuery')]
|
|
345
|
+
}) : _jsxs("div", {
|
|
346
|
+
className: cx("Sqb-TableName", {
|
|
347
|
+
notSelected: !selected
|
|
348
|
+
}),
|
|
349
|
+
onClick: selectTable,
|
|
350
|
+
children: [selected && _jsx(_Fragment, {
|
|
351
|
+
children: function () {
|
|
352
|
+
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
353
|
+
var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
354
|
+
return showButton ? _jsx(Tooltip, {
|
|
355
|
+
title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
356
|
+
children: _jsx(Button, {
|
|
357
|
+
danger: tableIsError(),
|
|
358
|
+
className: cx(':Sqb-TableName-as', {
|
|
359
|
+
isError: tableIsError()
|
|
360
|
+
}),
|
|
361
|
+
shape: 'circle',
|
|
362
|
+
style: isDel ? {
|
|
363
|
+
fontSize: 18,
|
|
364
|
+
backgroundColor: '#fff',
|
|
365
|
+
width: 'auto',
|
|
366
|
+
height: 'auto'
|
|
367
|
+
} : {},
|
|
368
|
+
iconOnly: true,
|
|
369
|
+
primary: !isDel,
|
|
370
|
+
icon: icon,
|
|
371
|
+
size: 'small',
|
|
372
|
+
onClick: function onClick(e) {
|
|
373
|
+
if (store.tableEnableAlias) {
|
|
374
|
+
var _meta$table7;
|
|
375
|
+
e.stopPropagation();
|
|
376
|
+
onChangeTableAlias(((_meta$table7 = meta.table) === null || _meta$table7 === void 0 ? void 0 : _meta$table7.alias) || '');
|
|
377
|
+
}
|
|
372
378
|
}
|
|
373
|
-
}
|
|
374
|
-
})
|
|
375
|
-
})
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
})
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
})
|
|
379
|
+
})
|
|
380
|
+
}) : null;
|
|
381
|
+
}()
|
|
382
|
+
})
|
|
383
|
+
// <Tooltip
|
|
384
|
+
// title={__(
|
|
385
|
+
// tableIsError()
|
|
386
|
+
// ? isDel
|
|
387
|
+
// ? 'metabase.verify'
|
|
388
|
+
// : 'SqlQueryBuilder.repeatAlias'
|
|
389
|
+
// : 'SqlQueryBuilder.alias',
|
|
390
|
+
// )}
|
|
391
|
+
// >
|
|
392
|
+
// <Button
|
|
393
|
+
// danger={tableIsError()}
|
|
394
|
+
// className={cx(':Sqb-TableName-as', {
|
|
395
|
+
// isError: tableIsError(),
|
|
396
|
+
// })}
|
|
397
|
+
// shape='circle'
|
|
398
|
+
// style={
|
|
399
|
+
// isDel
|
|
400
|
+
// ? {
|
|
401
|
+
// fontSize: 18,
|
|
402
|
+
// backgroundColor: '#fff',
|
|
403
|
+
// width: 'auto',
|
|
404
|
+
// height: 'auto',
|
|
405
|
+
// }
|
|
406
|
+
// : {}
|
|
407
|
+
// }
|
|
408
|
+
// iconOnly
|
|
409
|
+
// primary={!isDel}
|
|
410
|
+
// icon={isDel ? <ExclamationCircleFill /> : 'As'}
|
|
411
|
+
// size='small'
|
|
412
|
+
// onClick={(e) => {
|
|
413
|
+
// e.stopPropagation();
|
|
414
|
+
// onChangeTableAlias(meta.table?.alias || '');
|
|
415
|
+
// }}
|
|
416
|
+
// ></Button>
|
|
417
|
+
// </Tooltip>
|
|
418
|
+
, selected ? "".concat(meta.table.datasourceName, ".").concat(meta.table.name, " ").concat((_meta$table8 = meta.table) !== null && _meta$table8 !== void 0 && _meta$table8.alias && store.tableEnableAlias ? "as ".concat((_meta$table9 = meta.table) === null || _meta$table9 === void 0 ? void 0 : _meta$table9.alias) : '') : __('SqlQueryBuilder.pickTable')]
|
|
419
|
+
}), store.showSubquery && _jsx(Tooltip, {
|
|
420
|
+
title: __('SqlQueryBuilder.switchSubQuery'),
|
|
421
|
+
children: _jsx(Button, {
|
|
422
|
+
disabled: meta.readonly,
|
|
423
|
+
primary: meta.isSubquery,
|
|
424
|
+
ghost: true,
|
|
425
|
+
className: cx('mr-2 operator-icon', _defineProperty({}, 'subquery-icon', !meta.isSubquery)),
|
|
426
|
+
icon: _jsx(RelatedWork, {}),
|
|
427
|
+
onClick: switchSubQuery
|
|
428
|
+
})
|
|
429
|
+
}), selected && store.showFields && (!store.isExit || store.isSubquery) && ((_store$showMainColumn = store.showMainColumn[groupIndex]) === null || _store$showMainColumn === void 0 ? void 0 : _store$showMainColumn.showColumn) && _jsx("div", {
|
|
430
|
+
className: "Sqb-TableColumns",
|
|
431
|
+
onClick: selectColumns,
|
|
432
|
+
children: __('SqlQueryBuilder.columns')
|
|
433
|
+
})]
|
|
434
|
+
})
|
|
429
435
|
})
|
|
430
436
|
}), _jsx(NextDom, {
|
|
431
437
|
meta: meta,
|
|
@@ -3,6 +3,7 @@ import cx from 'classnames';
|
|
|
3
3
|
import { __ } from '../../locale';
|
|
4
4
|
import Wrapper from './components/Wrapper';
|
|
5
5
|
import Header from './components/header';
|
|
6
|
+
import ItemWrapper from './components/item-wrapper';
|
|
6
7
|
import SelectList from '../dialog/select-list';
|
|
7
8
|
import { UnionEnum } from '../../store/enum';
|
|
8
9
|
import { useStore } from '../../hooks/use-provider';
|
|
@@ -42,20 +43,25 @@ var RowLimit = function RowLimit(props) {
|
|
|
42
43
|
className: cx("Sqb-hover-parent"),
|
|
43
44
|
children: [_jsx(Header, {
|
|
44
45
|
meta: meta,
|
|
46
|
+
groupIndex: groupIndex,
|
|
45
47
|
title: __('SqlQueryBuilder.union'),
|
|
46
48
|
onClose: function onClose() {
|
|
47
49
|
return store.delMeta(meta, groupIndex);
|
|
48
50
|
}
|
|
49
|
-
}), _jsx(
|
|
50
|
-
|
|
51
|
+
}), _jsx(ItemWrapper, {
|
|
52
|
+
meta: meta,
|
|
53
|
+
groupIndex: groupIndex,
|
|
51
54
|
children: _jsx("div", {
|
|
52
|
-
className: cx("Sqb-
|
|
55
|
+
className: cx("Sqb-item--content"),
|
|
53
56
|
children: _jsx("div", {
|
|
54
|
-
className: "Sqb-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
className: cx("Sqb-NotebookCell"),
|
|
58
|
+
children: _jsx("div", {
|
|
59
|
+
className: "Sqb-TableName",
|
|
60
|
+
onClick: function onClick(e) {
|
|
61
|
+
return selectOperator(e);
|
|
62
|
+
},
|
|
63
|
+
children: union
|
|
64
|
+
})
|
|
59
65
|
})
|
|
60
66
|
})
|
|
61
67
|
})]
|