@gingkoo/pandora-metabase 1.0.81 → 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.
Files changed (57) hide show
  1. package/lib/cjs/components/dialog/formula-list/index.js +139 -74
  2. package/lib/cjs/components/dialog/formula-list/index.less +13 -0
  3. package/lib/cjs/components/metabase/index.js +26 -4
  4. package/lib/cjs/components/metabase/index.less +32 -1
  5. package/lib/cjs/components/modules/components/header.d.ts +2 -0
  6. package/lib/cjs/components/modules/components/header.js +11 -6
  7. package/lib/cjs/components/modules/components/item-wrapper.d.ts +9 -0
  8. package/lib/cjs/components/modules/components/item-wrapper.js +45 -0
  9. package/lib/cjs/components/modules/components/meta-icon.d.ts +11 -0
  10. package/lib/cjs/components/modules/components/meta-icon.js +60 -12
  11. package/lib/cjs/components/modules/custom-column.js +34 -28
  12. package/lib/cjs/components/modules/filter.js +18 -12
  13. package/lib/cjs/components/modules/join-data.js +417 -411
  14. package/lib/cjs/components/modules/permission-table.js +17 -11
  15. package/lib/cjs/components/modules/row-limit.js +18 -12
  16. package/lib/cjs/components/modules/sort.js +33 -27
  17. package/lib/cjs/components/modules/summarize/index.js +26 -20
  18. package/lib/cjs/components/modules/table-data.js +137 -131
  19. package/lib/cjs/components/modules/union.js +14 -8
  20. package/lib/cjs/hooks/use-state.js +84 -31
  21. package/lib/cjs/index.js +9 -3
  22. package/lib/cjs/locale/en.js +5 -3
  23. package/lib/cjs/locale/zh.js +5 -3
  24. package/lib/cjs/types.d.ts +2 -0
  25. package/lib/cjs/utils/storage.d.ts +1 -0
  26. package/lib/cjs/utils/storage.js +2 -1
  27. package/lib/cjs/utils.d.ts +6 -0
  28. package/lib/cjs/utils.js +23 -3
  29. package/lib/es/components/dialog/formula-list/index.js +139 -76
  30. package/lib/es/components/dialog/formula-list/index.less +13 -0
  31. package/lib/es/components/metabase/index.js +26 -4
  32. package/lib/es/components/metabase/index.less +32 -1
  33. package/lib/es/components/modules/components/header.d.ts +2 -0
  34. package/lib/es/components/modules/components/header.js +12 -7
  35. package/lib/es/components/modules/components/item-wrapper.d.ts +9 -0
  36. package/lib/es/components/modules/components/item-wrapper.js +38 -0
  37. package/lib/es/components/modules/components/meta-icon.d.ts +11 -0
  38. package/lib/es/components/modules/components/meta-icon.js +60 -14
  39. package/lib/es/components/modules/custom-column.js +34 -28
  40. package/lib/es/components/modules/filter.js +18 -12
  41. package/lib/es/components/modules/join-data.js +417 -411
  42. package/lib/es/components/modules/permission-table.js +17 -11
  43. package/lib/es/components/modules/row-limit.js +18 -12
  44. package/lib/es/components/modules/sort.js +33 -27
  45. package/lib/es/components/modules/summarize/index.js +26 -20
  46. package/lib/es/components/modules/table-data.js +137 -131
  47. package/lib/es/components/modules/union.js +14 -8
  48. package/lib/es/hooks/use-state.js +84 -31
  49. package/lib/es/index.js +9 -3
  50. package/lib/es/locale/en.js +5 -3
  51. package/lib/es/locale/zh.js +5 -3
  52. package/lib/es/types.d.ts +2 -0
  53. package/lib/es/utils/storage.d.ts +1 -0
  54. package/lib/es/utils/storage.js +2 -1
  55. package/lib/es/utils.d.ts +6 -0
  56. package/lib/es/utils.js +21 -1
  57. 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("div", {
122
- className: "Sqb-item--content",
123
+ }), _jsx(ItemWrapper, {
124
+ meta: meta,
125
+ groupIndex: groupIndex,
123
126
  children: _jsx("div", {
124
- className: "Sqb-NotebookCell gray-bg",
125
- children: _jsx(ItemName, {
126
- isError: tableIsError(),
127
- children: _jsx("div", {
128
- className: cx("Sqb-TableName", {
129
- notSelected: !selected
130
- }),
131
- onClick: selectTable,
132
- children: selected ? "".concat(meta.table.datasourceName ? "".concat(meta.table.datasourceName, ".") : '').concat(meta.table.name === SummarizeAlias ? PrevResult : meta.table.name) : __('SqlQueryBuilder.pickPermissionTable')
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("div", {
33
- className: cx("Sqb-item--content"),
34
+ }), _jsx(ItemWrapper, {
35
+ meta: meta,
36
+ groupIndex: groupIndex,
34
37
  children: _jsx("div", {
35
- className: cx("Sqb-NotebookCell gray-bg"),
36
- children: _jsx(InputNumber, {
37
- value: meta.limit,
38
- min: 1,
39
- style: {
40
- width: 200
41
- },
42
- onChange: handleChange,
43
- placeholder: __('rowLimit.pleaseEnter'),
44
- precision: 0
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("div", {
244
- className: cx("Sqb-item--content"),
245
- children: _jsxs("div", {
246
- className: cx("Sqb-NotebookCell gray-bg"),
247
- children: [sort.map(function (v, i) {
248
- return _jsx(ItemName, {
249
- isError: isError(v.expression, getColumns()),
250
- children: _jsxs("div", {
251
- className: "Sqb-TableName gray-name",
252
- onClick: function onClick() {
253
- return handleSort(i);
254
- },
255
- children: [v.sort === SortEnum.asc ? _jsx(UpArrowIcon, {}) : _jsx(DownArrowIcon, {}), getName(v.expression), _jsx("span", {
256
- style: {
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(CloseIcon, {})
263
- })]
264
- }, i)
265
- }, i);
266
- }), _jsx("div", {
267
- className: "Sqb-TableName gray-name",
268
- onClick: addSortColumn,
269
- children: _jsx(AddIcon, {})
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("div", {
29
- className: cx("Sqb-item--content"),
30
- children: _jsxs("div", {
31
- className: 'flex-row',
32
- children: [_jsx("div", {
33
- className: "Sqb-NotebookCell green-bg",
34
- children: _jsx(SelectIndex, {
35
- meta: meta,
36
- groupIndex: groupIndex
37
- })
38
- }), _jsx("div", {
39
- className: 'pass',
40
- children: __('SqlQueryBuilder.by')
41
- }), _jsx("div", {
42
- className: "Sqb-NotebookCell green-bg",
43
- children: _jsx(GroupBy, {
44
- meta: meta,
45
- groupIndex: groupIndex
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("div", {
297
- className: "Sqb-item--content",
298
- children: _jsxs("div", {
299
- className: "Sqb-NotebookCell",
300
- children: [meta.isSubquery ? _jsxs("div", {
301
- className: cx("Sqb-TableName", {
302
- notSelected: !subQuerySelected
303
- }),
304
- onClick: function onClick() {
305
- showSubQuery(meta.subquery);
306
- },
307
- children: [subQuerySelected && _jsx(_Fragment, {
308
- children: function () {
309
- var showButton = store.tableEnableAlias || tableIsError() && isDel;
310
- var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
311
- return showButton ? _jsx(Tooltip, {
312
- title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
313
- children: _jsx(Button, {
314
- danger: tableIsError(),
315
- className: cx(':Sqb-TableName-as', {
316
- isError: tableIsError()
317
- }),
318
- shape: 'circle',
319
- style: isDel ? {
320
- fontSize: 18,
321
- backgroundColor: '#fff',
322
- width: 'auto',
323
- height: 'auto'
324
- } : {},
325
- iconOnly: true,
326
- primary: !isDel,
327
- icon: icon,
328
- size: 'small',
329
- onClick: function onClick(e) {
330
- if (store.tableEnableAlias) {
331
- var _meta$table4;
332
- e.stopPropagation();
333
- onChangeTableAlias(((_meta$table4 = meta.table) === null || _meta$table4 === void 0 ? void 0 : _meta$table4.alias) || '');
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
- }) : null;
338
- }()
339
- }), 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')]
340
- }) : _jsxs("div", {
341
- className: cx("Sqb-TableName", {
342
- notSelected: !selected
343
- }),
344
- onClick: selectTable,
345
- children: [selected && _jsx(_Fragment, {
346
- children: function () {
347
- var showButton = store.tableEnableAlias || tableIsError() && isDel;
348
- var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
349
- return showButton ? _jsx(Tooltip, {
350
- title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
351
- children: _jsx(Button, {
352
- danger: tableIsError(),
353
- className: cx(':Sqb-TableName-as', {
354
- isError: tableIsError()
355
- }),
356
- shape: 'circle',
357
- style: isDel ? {
358
- fontSize: 18,
359
- backgroundColor: '#fff',
360
- width: 'auto',
361
- height: 'auto'
362
- } : {},
363
- iconOnly: true,
364
- primary: !isDel,
365
- icon: icon,
366
- size: 'small',
367
- onClick: function onClick(e) {
368
- if (store.tableEnableAlias) {
369
- var _meta$table7;
370
- e.stopPropagation();
371
- onChangeTableAlias(((_meta$table7 = meta.table) === null || _meta$table7 === void 0 ? void 0 : _meta$table7.alias) || '');
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
- }) : null;
376
- }()
377
- })
378
- // <Tooltip
379
- // title={__(
380
- // tableIsError()
381
- // ? isDel
382
- // ? 'metabase.verify'
383
- // : 'SqlQueryBuilder.repeatAlias'
384
- // : 'SqlQueryBuilder.alias',
385
- // )}
386
- // >
387
- // <Button
388
- // danger={tableIsError()}
389
- // className={cx(':Sqb-TableName-as', {
390
- // isError: tableIsError(),
391
- // })}
392
- // shape='circle'
393
- // style={
394
- // isDel
395
- // ? {
396
- // fontSize: 18,
397
- // backgroundColor: '#fff',
398
- // width: 'auto',
399
- // height: 'auto',
400
- // }
401
- // : {}
402
- // }
403
- // iconOnly
404
- // primary={!isDel}
405
- // icon={isDel ? <ExclamationCircleFill /> : 'As'}
406
- // size='small'
407
- // onClick={(e) => {
408
- // e.stopPropagation();
409
- // onChangeTableAlias(meta.table?.alias || '');
410
- // }}
411
- // ></Button>
412
- // </Tooltip>
413
- , 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')]
414
- }), store.showSubquery && _jsx(Tooltip, {
415
- title: __('SqlQueryBuilder.switchSubQuery'),
416
- children: _jsx(Button, {
417
- disabled: meta.readonly,
418
- primary: meta.isSubquery,
419
- ghost: true,
420
- className: cx('mr-2 operator-icon', _defineProperty({}, 'subquery-icon', !meta.isSubquery)),
421
- icon: _jsx(RelatedWork, {}),
422
- onClick: switchSubQuery
423
- })
424
- }), selected && store.showFields && !store.isExit && ((_store$showMainColumn = store.showMainColumn[groupIndex]) === null || _store$showMainColumn === void 0 ? void 0 : _store$showMainColumn.showColumn) && _jsx("div", {
425
- className: "Sqb-TableColumns",
426
- onClick: selectColumns,
427
- children: __('SqlQueryBuilder.columns')
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("div", {
50
- className: cx("Sqb-item--content"),
51
+ }), _jsx(ItemWrapper, {
52
+ meta: meta,
53
+ groupIndex: groupIndex,
51
54
  children: _jsx("div", {
52
- className: cx("Sqb-NotebookCell"),
55
+ className: cx("Sqb-item--content"),
53
56
  children: _jsx("div", {
54
- className: "Sqb-TableName",
55
- onClick: function onClick(e) {
56
- return selectOperator(e);
57
- },
58
- children: union
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
  })]