@gingkoo/pandora-metabase 1.0.89 → 1.0.91

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 (48) hide show
  1. package/lib/cjs/common/SplitView/index.js +11 -12
  2. package/lib/cjs/components/dialog/custom-column/expression-editor.js +1 -2
  3. package/lib/cjs/components/dialog/custom-column/tokenizedI-input.js +1 -2
  4. package/lib/cjs/components/dialog/expression/index.js +17 -16
  5. package/lib/cjs/components/dialog/formula/index.js +1 -2
  6. package/lib/cjs/components/dialog/formula-list/index.js +29 -29
  7. package/lib/cjs/components/dialog/index.js +2 -2
  8. package/lib/cjs/components/dialog/select-column/index.js +4 -4
  9. package/lib/cjs/components/dialog/select-column-multiple/index.js +10 -10
  10. package/lib/cjs/components/dialog/select-join-column/index.js +3 -3
  11. package/lib/cjs/components/dialog/select-table/index.js +12 -13
  12. package/lib/cjs/components/icons.js +36 -36
  13. package/lib/cjs/components/metabase/index.js +9 -9
  14. package/lib/cjs/components/metabase/index.less +2 -1
  15. package/lib/cjs/components/modules/components/Wrapper.js +6 -6
  16. package/lib/cjs/components/modules/components/header.js +4 -4
  17. package/lib/cjs/components/modules/components/meta-icon.js +1 -2
  18. package/lib/cjs/components/modules/custom-column.js +4 -4
  19. package/lib/cjs/components/modules/join-data.js +13 -13
  20. package/lib/cjs/components/modules/summarize/group-by.js +4 -4
  21. package/lib/cjs/components/modules/summarize/select-index.js +4 -4
  22. package/lib/cjs/components/modules/table-data.js +10 -10
  23. package/lib/cjs/components/popup.js +1 -2
  24. package/lib/cjs/hooks/use-state.js +111 -111
  25. package/lib/cjs/index.js +1 -2
  26. package/lib/cjs/utils/transformSql.js +8 -8
  27. package/lib/cjs/utils.js +3 -0
  28. package/lib/es/common/SplitView/index.js +10 -10
  29. package/lib/es/components/dialog/expression/index.js +16 -14
  30. package/lib/es/components/dialog/formula-list/index.js +28 -27
  31. package/lib/es/components/dialog/select-column/index.js +4 -4
  32. package/lib/es/components/dialog/select-column-multiple/index.js +10 -10
  33. package/lib/es/components/dialog/select-join-column/index.js +3 -3
  34. package/lib/es/components/dialog/select-table/index.js +11 -11
  35. package/lib/es/components/icons.js +36 -36
  36. package/lib/es/components/metabase/index.js +9 -9
  37. package/lib/es/components/metabase/index.less +2 -1
  38. package/lib/es/components/modules/components/Wrapper.js +6 -6
  39. package/lib/es/components/modules/components/header.js +4 -4
  40. package/lib/es/components/modules/custom-column.js +4 -4
  41. package/lib/es/components/modules/join-data.js +13 -13
  42. package/lib/es/components/modules/summarize/group-by.js +4 -4
  43. package/lib/es/components/modules/summarize/select-index.js +4 -4
  44. package/lib/es/components/modules/table-data.js +10 -10
  45. package/lib/es/hooks/use-state.js +111 -111
  46. package/lib/es/utils/transformSql.js +8 -8
  47. package/lib/es/utils.js +3 -0
  48. package/package.json +2 -2
@@ -102,16 +102,16 @@ var SelectColumn = function SelectColumn(_ref) {
102
102
  onOk: function () {
103
103
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
104
104
  var newColumns, newMetaList;
105
- return _regeneratorRuntime.wrap(function _callee$(_context) {
105
+ return _regeneratorRuntime.wrap(function (_context) {
106
106
  while (1) switch (_context.prev = _context.next) {
107
107
  case 0:
108
108
  if (isValidSQLAlias(fieldAlias)) {
109
- _context.next = 3;
109
+ _context.next = 1;
110
110
  break;
111
111
  }
112
112
  Toast.warning(__('SqlQueryBuilder.aliasForRules'));
113
113
  return _context.abrupt("return", false);
114
- case 3:
114
+ case 1:
115
115
  newColumns = cloneDeep(columns);
116
116
  newMetaList = store.metaList[groupIndex].list.slice();
117
117
  newColumns[i].fieldAlias = fieldAlias;
@@ -125,7 +125,7 @@ var SelectColumn = function SelectColumn(_ref) {
125
125
  setTimeout(function () {
126
126
  store.setClosable(true);
127
127
  }, 0);
128
- case 11:
128
+ case 2:
129
129
  case "end":
130
130
  return _context.stop();
131
131
  }
@@ -328,25 +328,25 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
328
328
  className: cx("Sqb-List-section"),
329
329
  children: _jsx("div", {
330
330
  className: cx("Sqb-List-item mx-2", {
331
- active: isActive((v.id || v.name) + v.fieldAlias)
331
+ active: isActive((v.id || v.name) + (v.fieldAlias || ''))
332
332
  }),
333
333
  onClick: function onClick() {
334
334
  if (isSummarize) {
335
335
  // console.log(v, 'v');
336
336
  }
337
337
  changeValue(tableUuid, {
338
- tableName: tableItem.name,
339
- tableId: tableItem.id,
340
- tableNameZh: tableItem.name_zh,
341
- tableAlias: tableItem.alias,
342
- tableUuid: tableItem.tableUuid,
338
+ tableName: tableItem.name || '',
339
+ tableId: tableItem.id || '',
340
+ tableNameZh: tableItem.name_zh || '',
341
+ tableAlias: tableItem.alias || '',
342
+ tableUuid: tableItem.tableUuid || '',
343
343
  datasourceName: tableItem.datasourceName || '',
344
344
  datasourceId: tableItem.datasourceId || '',
345
- fieldName: v.name,
346
- fieldId: v.id || v.name,
345
+ fieldName: v.name || '',
346
+ fieldId: v.id || v.name || '',
347
347
  fieldNameZh: v.name_zh || '',
348
- fieldAlias: v.fieldAlias,
349
- fieldUuid: v.fieldUuid,
348
+ fieldAlias: v.fieldAlias || '',
349
+ fieldUuid: v.fieldUuid || '',
350
350
  type: AtomsTypeEnum.FIELD
351
351
  // quotes: v.fieldAlias || v.name,
352
352
  });
@@ -73,9 +73,9 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
73
73
  columns: v.columns.slice()
74
74
  });
75
75
  })),
76
- _useState10 = _slicedToArray(_useState9, 2),
77
- tableList = _useState10[0],
78
- setTableList = _useState10[1];
76
+ _useState0 = _slicedToArray(_useState9, 2),
77
+ tableList = _useState0[0],
78
+ setTableList = _useState0[1];
79
79
  useEffect(function () {
80
80
  setValue(_value);
81
81
  setCurColumn(_value.name);
@@ -47,13 +47,13 @@ var SelectTable = function SelectTable(_ref) {
47
47
  list = _useState8[0],
48
48
  setList = _useState8[1];
49
49
  var _useState9 = useState([]),
50
- _useState10 = _slicedToArray(_useState9, 2),
51
- originList = _useState10[0],
52
- setOriginList = _useState10[1];
53
- var _useState11 = useState(value),
54
- _useState12 = _slicedToArray(_useState11, 2),
55
- val = _useState12[0],
56
- setVal = _useState12[1];
50
+ _useState0 = _slicedToArray(_useState9, 2),
51
+ originList = _useState0[0],
52
+ setOriginList = _useState0[1];
53
+ var _useState1 = useState(value),
54
+ _useState10 = _slicedToArray(_useState1, 2),
55
+ val = _useState10[0],
56
+ setVal = _useState10[1];
57
57
  useEffect(function () {
58
58
  if (value.datasourceId) {
59
59
  getTables(value.datasourceId);
@@ -65,18 +65,18 @@ var SelectTable = function SelectTable(_ref) {
65
65
  function _getTables() {
66
66
  _getTables = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(datasourceId) {
67
67
  var tables;
68
- return _regeneratorRuntime.wrap(function _callee$(_context) {
68
+ return _regeneratorRuntime.wrap(function (_context) {
69
69
  while (1) switch (_context.prev = _context.next) {
70
70
  case 0:
71
71
  setLoading(true);
72
- _context.next = 3;
72
+ _context.next = 1;
73
73
  return store.fetchDataset(datasourceId);
74
- case 3:
74
+ case 1:
75
75
  tables = _context.sent;
76
76
  setLoading(false);
77
77
  setList(tables);
78
78
  setOriginList(tables);
79
- case 7:
79
+ case 2:
80
80
  case "end":
81
81
  return _context.stop();
82
82
  }
@@ -169,12 +169,12 @@ export var LeftJoinIcon = function LeftJoinIcon(_ref9) {
169
169
  })
170
170
  });
171
171
  };
172
- export var InnerJoinIcon = function InnerJoinIcon(_ref10) {
173
- var _ref10$width = _ref10.width,
174
- width = _ref10$width === void 0 ? 32 : _ref10$width,
175
- _ref10$height = _ref10.height,
176
- height = _ref10$height === void 0 ? 32 : _ref10$height,
177
- style = _ref10.style;
172
+ export var InnerJoinIcon = function InnerJoinIcon(_ref0) {
173
+ var _ref0$width = _ref0.width,
174
+ width = _ref0$width === void 0 ? 32 : _ref0$width,
175
+ _ref0$height = _ref0.height,
176
+ height = _ref0$height === void 0 ? 32 : _ref0$height,
177
+ style = _ref0.style;
178
178
  return _jsx("svg", {
179
179
  viewBox: '0 0 32 32',
180
180
  width: width,
@@ -188,11 +188,11 @@ export var InnerJoinIcon = function InnerJoinIcon(_ref10) {
188
188
  })
189
189
  });
190
190
  };
191
- export var UpArrowIcon = function UpArrowIcon(_ref11) {
192
- var _ref11$width = _ref11.width,
193
- width = _ref11$width === void 0 ? 16 : _ref11$width,
194
- _ref11$height = _ref11.height,
195
- height = _ref11$height === void 0 ? 17 : _ref11$height;
191
+ export var UpArrowIcon = function UpArrowIcon(_ref1) {
192
+ var _ref1$width = _ref1.width,
193
+ width = _ref1$width === void 0 ? 16 : _ref1$width,
194
+ _ref1$height = _ref1.height,
195
+ height = _ref1$height === void 0 ? 17 : _ref1$height;
196
196
  return _jsx("svg", {
197
197
  className: 'sort-arrow',
198
198
  viewBox: '0 0 32 34',
@@ -206,11 +206,11 @@ export var UpArrowIcon = function UpArrowIcon(_ref11) {
206
206
  })
207
207
  });
208
208
  };
209
- export var DownArrowIcon = function DownArrowIcon(_ref12) {
210
- var _ref12$width = _ref12.width,
211
- width = _ref12$width === void 0 ? 16 : _ref12$width,
212
- _ref12$height = _ref12.height,
213
- height = _ref12$height === void 0 ? 17 : _ref12$height;
209
+ export var DownArrowIcon = function DownArrowIcon(_ref10) {
210
+ var _ref10$width = _ref10.width,
211
+ width = _ref10$width === void 0 ? 16 : _ref10$width,
212
+ _ref10$height = _ref10.height,
213
+ height = _ref10$height === void 0 ? 17 : _ref10$height;
214
214
  return _jsx("svg", {
215
215
  className: 'sort-arrow',
216
216
  viewBox: '0 0 32 34',
@@ -224,11 +224,11 @@ export var DownArrowIcon = function DownArrowIcon(_ref12) {
224
224
  })
225
225
  });
226
226
  };
227
- export var CloseIcon = function CloseIcon(_ref13) {
228
- var _ref13$width = _ref13.width,
229
- width = _ref13$width === void 0 ? 16 : _ref13$width,
230
- _ref13$height = _ref13.height,
231
- height = _ref13$height === void 0 ? 16 : _ref13$height;
227
+ export var CloseIcon = function CloseIcon(_ref11) {
228
+ var _ref11$width = _ref11.width,
229
+ width = _ref11$width === void 0 ? 16 : _ref11$width,
230
+ _ref11$height = _ref11.height,
231
+ height = _ref11$height === void 0 ? 16 : _ref11$height;
232
232
  return _jsx("svg", {
233
233
  className: 'closeIcon',
234
234
  viewBox: '0 0 32 32',
@@ -242,11 +242,11 @@ export var CloseIcon = function CloseIcon(_ref13) {
242
242
  })
243
243
  });
244
244
  };
245
- export var AddIcon = function AddIcon(_ref14) {
246
- var _ref14$width = _ref14.width,
247
- width = _ref14$width === void 0 ? 16 : _ref14$width,
248
- _ref14$height = _ref14.height,
249
- height = _ref14$height === void 0 ? 16 : _ref14$height;
245
+ export var AddIcon = function AddIcon(_ref12) {
246
+ var _ref12$width = _ref12.width,
247
+ width = _ref12$width === void 0 ? 16 : _ref12$width,
248
+ _ref12$height = _ref12.height,
249
+ height = _ref12$height === void 0 ? 16 : _ref12$height;
250
250
  return _jsx("svg", {
251
251
  viewBox: '0 0 32 32',
252
252
  width: width,
@@ -259,11 +259,11 @@ export var AddIcon = function AddIcon(_ref14) {
259
259
  })
260
260
  });
261
261
  };
262
- export var TableIcon = function TableIcon(_ref15) {
263
- var _ref15$width = _ref15.width,
264
- width = _ref15$width === void 0 ? 18 : _ref15$width,
265
- _ref15$height = _ref15.height,
266
- height = _ref15$height === void 0 ? 18 : _ref15$height;
262
+ export var TableIcon = function TableIcon(_ref13) {
263
+ var _ref13$width = _ref13.width,
264
+ width = _ref13$width === void 0 ? 18 : _ref13$width,
265
+ _ref13$height = _ref13.height,
266
+ height = _ref13$height === void 0 ? 18 : _ref13$height;
267
267
  return _jsx("svg", {
268
268
  viewBox: '0 0 32 32',
269
269
  width: width,
@@ -276,11 +276,11 @@ export var TableIcon = function TableIcon(_ref15) {
276
276
  })
277
277
  });
278
278
  };
279
- export var SearchIcon = function SearchIcon(_ref16) {
280
- var _ref16$width = _ref16.width,
281
- width = _ref16$width === void 0 ? 16 : _ref16$width,
282
- _ref16$height = _ref16.height,
283
- height = _ref16$height === void 0 ? 16 : _ref16$height;
279
+ export var SearchIcon = function SearchIcon(_ref14) {
280
+ var _ref14$width = _ref14.width,
281
+ width = _ref14$width === void 0 ? 16 : _ref14$width,
282
+ _ref14$height = _ref14.height,
283
+ height = _ref14$height === void 0 ? 16 : _ref14$height;
284
284
  return _jsx("svg", {
285
285
  viewBox: '0 0 32 32',
286
286
  width: width,
@@ -72,12 +72,12 @@ var Metabase = function Metabase(props) {
72
72
  content: __('metabase.validationFailed'),
73
73
  onOk: function () {
74
74
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
75
- return _regeneratorRuntime.wrap(function _callee$(_context) {
75
+ return _regeneratorRuntime.wrap(function (_context) {
76
76
  while (1) switch (_context.prev = _context.next) {
77
77
  case 0:
78
- _context.next = 2;
78
+ _context.next = 1;
79
79
  return onSave();
80
- case 2:
80
+ case 1:
81
81
  case "end":
82
82
  return _context.stop();
83
83
  }
@@ -96,7 +96,7 @@ var Metabase = function Metabase(props) {
96
96
  var onSave = /*#__PURE__*/function () {
97
97
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
98
98
  var intercept, _metaList;
99
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
99
+ return _regeneratorRuntime.wrap(function (_context2) {
100
100
  while (1) switch (_context2.prev = _context2.next) {
101
101
  case 0:
102
102
  intercept = false; // 是否返回
@@ -110,17 +110,17 @@ var Metabase = function Metabase(props) {
110
110
  }
111
111
  });
112
112
  if (!(saveLoading || intercept)) {
113
- _context2.next = 6;
113
+ _context2.next = 1;
114
114
  break;
115
115
  }
116
116
  return _context2.abrupt("return", null);
117
- case 6:
117
+ case 1:
118
118
  setSaveLoading(true);
119
- _context2.next = 9;
119
+ _context2.next = 2;
120
120
  return onOk === null || onOk === void 0 ? void 0 : onOk(_metaList);
121
- case 9:
121
+ case 2:
122
122
  setSaveLoading(false);
123
- case 10:
123
+ case 3:
124
124
  case "end":
125
125
  return _context2.stop();
126
126
  }
@@ -186,7 +186,8 @@
186
186
  -webkit-box-align: center;
187
187
  align-items: center;
188
188
  cursor: pointer;
189
- height: 36px;
189
+ min-height: 36px;
190
+ word-break: break-word;
190
191
  // &-OPERATOR {
191
192
  // // 操作符
192
193
  // background-color: var(--link-5);
@@ -25,19 +25,19 @@ var Wrapper = function Wrapper(_ref) {
25
25
  function _animation() {
26
26
  _animation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
27
27
  var _couterRef$current;
28
- return _regeneratorRuntime.wrap(function _callee$(_context) {
28
+ return _regeneratorRuntime.wrap(function (_context) {
29
29
  while (1) switch (_context.prev = _context.next) {
30
30
  case 0:
31
- _context.next = 2;
31
+ _context.next = 1;
32
32
  return sleep(10);
33
- case 2:
33
+ case 1:
34
34
  setOpacity(1);
35
35
  ((_couterRef$current = couterRef.current) === null || _couterRef$current === void 0 || (_couterRef$current = _couterRef$current.childNodes) === null || _couterRef$current === void 0 ? void 0 : _couterRef$current.length) && setMaxHeight(couterRef.current.childNodes[0].clientHeight + 16);
36
- _context.next = 6;
36
+ _context.next = 2;
37
37
  return sleep(500);
38
- case 6:
38
+ case 2:
39
39
  setMaxHeight('auto');
40
- case 7:
40
+ case 3:
41
41
  case "end":
42
42
  return _context.stop();
43
43
  }
@@ -16,14 +16,14 @@ var Header = function Header(props) {
16
16
  var diff = /*#__PURE__*/function () {
17
17
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
18
18
  var _oldMeta, _newMeta, _yield$store$getModul, oldCode, newCode, o;
19
- return _regeneratorRuntime.wrap(function _callee$(_context) {
19
+ return _regeneratorRuntime.wrap(function (_context) {
20
20
  while (1) switch (_context.prev = _context.next) {
21
21
  case 0:
22
22
  _oldMeta = store.sourceData.slice();
23
23
  _newMeta = splitByUnion(store.metaList);
24
- _context.next = 4;
24
+ _context.next = 1;
25
25
  return store.getModuleDiffCode(_oldMeta, _newMeta);
26
- case 4:
26
+ case 1:
27
27
  _yield$store$getModul = _context.sent;
28
28
  oldCode = _yield$store$getModul.oldCode;
29
29
  newCode = _yield$store$getModul.newCode;
@@ -36,7 +36,7 @@ var Header = function Header(props) {
36
36
  }),
37
37
  onClose: function onClose() {}
38
38
  });
39
- case 8:
39
+ case 2:
40
40
  case "end":
41
41
  return _context.stop();
42
42
  }
@@ -74,14 +74,14 @@ var CustomColumn = function CustomColumn(props) {
74
74
  function _handleUpdate() {
75
75
  _handleUpdate = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(e, i) {
76
76
  var node, newMeta, value, columns;
77
- return _regeneratorRuntime.wrap(function _callee$(_context) {
77
+ return _regeneratorRuntime.wrap(function (_context) {
78
78
  while (1) switch (_context.prev = _context.next) {
79
79
  case 0:
80
80
  node = e.currentTarget;
81
81
  closePopup();
82
- _context.next = 4;
82
+ _context.next = 1;
83
83
  return sleep(100);
84
- case 4:
84
+ case 1:
85
85
  newMeta = store.metaList[groupIndex].list.slice();
86
86
  value = customColumn[i];
87
87
  columns = getAvailableColumns();
@@ -106,7 +106,7 @@ var CustomColumn = function CustomColumn(props) {
106
106
  onClose: closePopup
107
107
  })
108
108
  });
109
- case 8:
109
+ case 2:
110
110
  case "end":
111
111
  return _context.stop();
112
112
  }
@@ -65,7 +65,7 @@ var menuOperator = operators.map(function (v) {
65
65
  };
66
66
  });
67
67
  var JoinData = function JoinData(props) {
68
- var _meta$subquery, _meta$subquery2, _meta$subquery3, _meta$table5, _meta$table6, _meta$table8, _meta$table9, _meta$table10, _meta$table11, _meta$expressions, _meta$table12, _meta$table13, _meta$expressions2, _store$showMainColumn, _store$showMainColumn2;
68
+ var _meta$subquery, _meta$subquery2, _meta$subquery3, _meta$table5, _meta$table6, _meta$table8, _meta$table9, _meta$table0, _meta$table1, _meta$expressions, _meta$table10, _meta$table11, _meta$expressions2, _store$showMainColumn, _store$showMainColumn2;
69
69
  var meta = props.meta,
70
70
  groupIndex = props.groupIndex;
71
71
  var store = useStore();
@@ -87,20 +87,20 @@ var JoinData = function JoinData(props) {
87
87
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
88
88
  var _meta$table, _meta$table2;
89
89
  var tableName, tables, names;
90
- return _regeneratorRuntime.wrap(function _callee$(_context) {
90
+ return _regeneratorRuntime.wrap(function (_context) {
91
91
  while (1) switch (_context.prev = _context.next) {
92
92
  case 0:
93
93
  tableName = (_meta$table = meta.table2) === null || _meta$table === void 0 ? void 0 : _meta$table.name;
94
94
  if ((_meta$table2 = meta.table2) !== null && _meta$table2 !== void 0 && _meta$table2.datasourceId) {
95
- _context.next = 4;
95
+ _context.next = 1;
96
96
  break;
97
97
  }
98
98
  setIsDel(false);
99
99
  return _context.abrupt("return");
100
- case 4:
101
- _context.next = 6;
100
+ case 1:
101
+ _context.next = 2;
102
102
  return store === null || store === void 0 ? void 0 : store.fetchDataset(meta.table2.datasourceId);
103
- case 6:
103
+ case 2:
104
104
  tables = _context.sent;
105
105
  names = (tables === null || tables === void 0 ? void 0 : tables.map(function (v) {
106
106
  return v.name;
@@ -110,7 +110,7 @@ var JoinData = function JoinData(props) {
110
110
  } else {
111
111
  setIsDel(false);
112
112
  }
113
- case 9:
113
+ case 3:
114
114
  case "end":
115
115
  return _context.stop();
116
116
  }
@@ -1196,16 +1196,16 @@ var JoinData = function JoinData(props) {
1196
1196
  onOk: function () {
1197
1197
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
1198
1198
  var index, newMeta;
1199
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1199
+ return _regeneratorRuntime.wrap(function (_context2) {
1200
1200
  while (1) switch (_context2.prev = _context2.next) {
1201
1201
  case 0:
1202
1202
  if (isValidSQLAlias(alias)) {
1203
- _context2.next = 3;
1203
+ _context2.next = 1;
1204
1204
  break;
1205
1205
  }
1206
1206
  Toast.warning(__('SqlQueryBuilder.aliasForRules'));
1207
1207
  return _context2.abrupt("return", false);
1208
- case 3:
1208
+ case 1:
1209
1209
  index = findIndex(store.metaList[groupIndex].list, meta);
1210
1210
  newMeta = store.metaList[groupIndex].list.slice();
1211
1211
  newMeta[index].table2.alias = alias;
@@ -1214,7 +1214,7 @@ var JoinData = function JoinData(props) {
1214
1214
  obj: newMeta[index].table2,
1215
1215
  type: ChangeType.tableAlias
1216
1216
  });
1217
- case 8:
1217
+ case 2:
1218
1218
  case "end":
1219
1219
  return _context2.stop();
1220
1220
  }
@@ -1655,7 +1655,7 @@ var JoinData = function JoinData(props) {
1655
1655
  icon: _jsx(RelatedWork, {}),
1656
1656
  onClick: switchSubQuery
1657
1657
  })
1658
- }), ((_meta$table10 = meta.table2) === null || _meta$table10 === void 0 ? void 0 : _meta$table10.name) && ((_meta$table11 = meta.table1) === null || _meta$table11 === void 0 ? void 0 : _meta$table11.name) && ((_meta$expressions = meta.expressions) === null || _meta$expressions === void 0 ? void 0 : _meta$expressions.map(function (v, i) {
1658
+ }), ((_meta$table0 = meta.table2) === null || _meta$table0 === void 0 ? void 0 : _meta$table0.name) && ((_meta$table1 = meta.table1) === null || _meta$table1 === void 0 ? void 0 : _meta$table1.name) && ((_meta$expressions = meta.expressions) === null || _meta$expressions === void 0 ? void 0 : _meta$expressions.map(function (v, i) {
1659
1659
  if (v.type === AtomsTypeEnum.JOIN_DEFAULT) {
1660
1660
  return _jsxs("div", {
1661
1661
  className: cx("Sqb-where block"),
@@ -1883,7 +1883,7 @@ var JoinData = function JoinData(props) {
1883
1883
  })]
1884
1884
  }, i);
1885
1885
  }
1886
- })), ((_meta$table12 = meta.table2) === null || _meta$table12 === void 0 ? void 0 : _meta$table12.name) && ((_meta$table13 = meta.table1) === null || _meta$table13 === void 0 ? void 0 : _meta$table13.name) && (((_meta$expressions2 = meta.expressions) === null || _meta$expressions2 === void 0 ? void 0 : _meta$expressions2.length) || 0) < 1 && _jsx(Tooltip, {
1886
+ })), ((_meta$table10 = meta.table2) === null || _meta$table10 === void 0 ? void 0 : _meta$table10.name) && ((_meta$table11 = meta.table1) === null || _meta$table11 === void 0 ? void 0 : _meta$table11.name) && (((_meta$expressions2 = meta.expressions) === null || _meta$expressions2 === void 0 ? void 0 : _meta$expressions2.length) || 0) < 1 && _jsx(Tooltip, {
1887
1887
  title: __('SqlQueryBuilder.add'),
1888
1888
  children: _jsx(Dropdown, {
1889
1889
  trigger: ['click'],
@@ -249,16 +249,16 @@ var GroupBy = function GroupBy(props) {
249
249
  onOk: function () {
250
250
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
251
251
  var newMeta;
252
- return _regeneratorRuntime.wrap(function _callee$(_context) {
252
+ return _regeneratorRuntime.wrap(function (_context) {
253
253
  while (1) switch (_context.prev = _context.next) {
254
254
  case 0:
255
255
  if (isValidSQLAlias(fieldAlias)) {
256
- _context.next = 3;
256
+ _context.next = 1;
257
257
  break;
258
258
  }
259
259
  Toast.warning(__('SqlQueryBuilder.aliasForRules'));
260
260
  return _context.abrupt("return", false);
261
- case 3:
261
+ case 1:
262
262
  newMeta = store.metaList[groupIndex].list.slice(); // @ts-ignore
263
263
  newMeta[index].by[i].sql = newMeta[index].by[i].sql.split('AS ')[0] + "AS ".concat(fieldAlias); //修改sql
264
264
  newMeta[index].by[i].fieldAlias = fieldAlias;
@@ -267,7 +267,7 @@ var GroupBy = function GroupBy(props) {
267
267
  obj: newMeta[index].by,
268
268
  type: ChangeType.by
269
269
  });
270
- case 8:
270
+ case 2:
271
271
  case "end":
272
272
  return _context.stop();
273
273
  }
@@ -247,16 +247,16 @@ var SelectIndex = function SelectIndex(props) {
247
247
  onOk: function () {
248
248
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
249
249
  var newMeta;
250
- return _regeneratorRuntime.wrap(function _callee$(_context) {
250
+ return _regeneratorRuntime.wrap(function (_context) {
251
251
  while (1) switch (_context.prev = _context.next) {
252
252
  case 0:
253
253
  if (isValidSQLAlias(fieldAlias)) {
254
- _context.next = 3;
254
+ _context.next = 1;
255
255
  break;
256
256
  }
257
257
  Toast.warning(__('SqlQueryBuilder.aliasForRules'));
258
258
  return _context.abrupt("return", false);
259
- case 3:
259
+ case 1:
260
260
  newMeta = store.metaList[groupIndex].list.slice(); // @ts-ignore
261
261
  newMeta[index].group[i].fieldAlias = fieldAlias;
262
262
  newMeta[index].group[i].sql = newMeta[index].group[i].sql.split('AS ')[0] + "AS ".concat(fieldAlias); //修改sql
@@ -265,7 +265,7 @@ var SelectIndex = function SelectIndex(props) {
265
265
  obj: newMeta[index].group,
266
266
  type: ChangeType.group
267
267
  });
268
- case 8:
268
+ case 2:
269
269
  case "end":
270
270
  return _context.stop();
271
271
  }
@@ -39,20 +39,20 @@ var TableData = function TableData(props) {
39
39
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
40
40
  var _meta$table, _meta$table2;
41
41
  var tableName, tables, names;
42
- return _regeneratorRuntime.wrap(function _callee$(_context) {
42
+ return _regeneratorRuntime.wrap(function (_context) {
43
43
  while (1) switch (_context.prev = _context.next) {
44
44
  case 0:
45
45
  tableName = (_meta$table = meta.table) === null || _meta$table === void 0 ? void 0 : _meta$table.name;
46
46
  if (meta !== null && meta !== void 0 && (_meta$table2 = meta.table) !== null && _meta$table2 !== void 0 && _meta$table2.datasourceId) {
47
- _context.next = 4;
47
+ _context.next = 1;
48
48
  break;
49
49
  }
50
50
  setIsDel(false);
51
51
  return _context.abrupt("return");
52
- case 4:
53
- _context.next = 6;
52
+ case 1:
53
+ _context.next = 2;
54
54
  return store === null || store === void 0 ? void 0 : store.fetchDataset(meta.table.datasourceId);
55
- case 6:
55
+ case 2:
56
56
  tables = _context.sent;
57
57
  names = (tables === null || tables === void 0 ? void 0 : tables.map(function (v) {
58
58
  return v.name;
@@ -62,7 +62,7 @@ var TableData = function TableData(props) {
62
62
  } else {
63
63
  setIsDel(false);
64
64
  }
65
- case 9:
65
+ case 3:
66
66
  case "end":
67
67
  return _context.stop();
68
68
  }
@@ -148,16 +148,16 @@ var TableData = function TableData(props) {
148
148
  onOk: function () {
149
149
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
150
150
  var newMetaList;
151
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
151
+ return _regeneratorRuntime.wrap(function (_context2) {
152
152
  while (1) switch (_context2.prev = _context2.next) {
153
153
  case 0:
154
154
  if (isValidSQLAlias(alias)) {
155
- _context2.next = 3;
155
+ _context2.next = 1;
156
156
  break;
157
157
  }
158
158
  Toast.warning(__('SqlQueryBuilder.aliasForRules'));
159
159
  return _context2.abrupt("return", false);
160
- case 3:
160
+ case 1:
161
161
  newMetaList = store.metaList[groupIndex].list.slice(); // @ts-ignore
162
162
  newMetaList[0].table.alias = alias;
163
163
  newMetaList = changeTableAlias(newMetaList, newMetaList[0].table);
@@ -165,7 +165,7 @@ var TableData = function TableData(props) {
165
165
  obj: newMetaList[0].table,
166
166
  type: ChangeType.tableAlias
167
167
  });
168
- case 7:
168
+ case 2:
169
169
  case "end":
170
170
  return _context2.stop();
171
171
  }