@gingkoo/pandora-metabase 1.0.108 → 1.0.110

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 (44) 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 +11 -12
  5. package/lib/cjs/components/dialog/formula/index.js +1 -2
  6. package/lib/cjs/components/dialog/formula-list/index.js +27 -28
  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-join-column/index.js +3 -3
  10. package/lib/cjs/components/dialog/select-table/index.js +12 -13
  11. package/lib/cjs/components/icons.js +36 -36
  12. package/lib/cjs/components/metabase/index.js +9 -9
  13. package/lib/cjs/components/modules/components/Wrapper.js +6 -6
  14. package/lib/cjs/components/modules/components/header.js +4 -4
  15. package/lib/cjs/components/modules/components/meta-icon.js +1 -2
  16. package/lib/cjs/components/modules/custom-column.js +4 -4
  17. package/lib/cjs/components/modules/join-data.js +13 -13
  18. package/lib/cjs/components/modules/summarize/group-by.js +4 -4
  19. package/lib/cjs/components/modules/summarize/select-index.js +4 -4
  20. package/lib/cjs/components/modules/table-data.js +10 -10
  21. package/lib/cjs/components/popup.js +1 -2
  22. package/lib/cjs/hooks/use-state.js +160 -161
  23. package/lib/cjs/index.js +1 -2
  24. package/lib/cjs/utils/transformSql.js +8 -8
  25. package/lib/cjs/utils.js +1 -1
  26. package/lib/es/common/SplitView/index.js +10 -10
  27. package/lib/es/components/dialog/expression/index.js +10 -10
  28. package/lib/es/components/dialog/formula-list/index.js +26 -26
  29. package/lib/es/components/dialog/select-column/index.js +4 -4
  30. package/lib/es/components/dialog/select-join-column/index.js +3 -3
  31. package/lib/es/components/dialog/select-table/index.js +11 -11
  32. package/lib/es/components/icons.js +36 -36
  33. package/lib/es/components/metabase/index.js +9 -9
  34. package/lib/es/components/modules/components/Wrapper.js +6 -6
  35. package/lib/es/components/modules/components/header.js +4 -4
  36. package/lib/es/components/modules/custom-column.js +4 -4
  37. package/lib/es/components/modules/join-data.js +13 -13
  38. package/lib/es/components/modules/summarize/group-by.js +4 -4
  39. package/lib/es/components/modules/summarize/select-index.js +4 -4
  40. package/lib/es/components/modules/table-data.js +10 -10
  41. package/lib/es/hooks/use-state.js +160 -161
  42. package/lib/es/utils/transformSql.js +8 -8
  43. package/lib/es/utils.js +1 -1
  44. package/package.json +1 -1
@@ -81,18 +81,18 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
81
81
  special_type = _useState8[0],
82
82
  setSpecial_type = _useState8[1];
83
83
  var _useState9 = useState(value.formula || {}),
84
- _useState10 = _slicedToArray(_useState9, 2),
85
- formula = _useState10[0],
86
- setFormula = _useState10[1];
84
+ _useState0 = _slicedToArray(_useState9, 2),
85
+ formula = _useState0[0],
86
+ setFormula = _useState0[1];
87
87
  var store = useStore();
88
- var _useState11 = useState(false),
88
+ var _useState1 = useState(false),
89
+ _useState10 = _slicedToArray(_useState1, 2),
90
+ popupVisible = _useState10[0],
91
+ setPopupVisible = _useState10[1];
92
+ var _useState11 = useState((value === null || value === void 0 || (_value$lhs = value.lhs) === null || _value$lhs === void 0 ? void 0 : _value$lhs.length) > 0 || false),
89
93
  _useState12 = _slicedToArray(_useState11, 2),
90
- popupVisible = _useState12[0],
91
- setPopupVisible = _useState12[1];
92
- var _useState13 = useState((value === null || value === void 0 || (_value$lhs = value.lhs) === null || _value$lhs === void 0 ? void 0 : _value$lhs.length) > 0 || false),
93
- _useState14 = _slicedToArray(_useState13, 2),
94
- isNext = _useState14[0],
95
- setIsNext = _useState14[1];
94
+ isNext = _useState12[0],
95
+ setIsNext = _useState12[1];
96
96
  var table2Selected = Boolean(rhsVal && (rhsVal === null || rhsVal === void 0 ? void 0 : rhsVal.length) > 0);
97
97
  var disabled = useMemo(function () {
98
98
  if (!condition) return true;
@@ -101,9 +101,9 @@ var FormulaList = forwardRef(function (props, ref) {
101
101
  setOldCode(getPreviewStr(caseList));
102
102
  }, []);
103
103
  var _useState9 = useState(''),
104
- _useState10 = _slicedToArray(_useState9, 2),
105
- filterVal = _useState10[0],
106
- setFilterVal = _useState10[1];
104
+ _useState0 = _slicedToArray(_useState9, 2),
105
+ filterVal = _useState0[0],
106
+ setFilterVal = _useState0[1];
107
107
  var setCaseList = function setCaseList(data) {
108
108
  var quotes = data.map(function (v, i) {
109
109
  if (v !== null && v !== void 0 && v.quotes) {
@@ -118,35 +118,35 @@ var FormulaList = forwardRef(function (props, ref) {
118
118
  caseList = data;
119
119
  caseListRef.current = data;
120
120
  };
121
- var _useState11 = useState(-1),
122
- _useState12 = _slicedToArray(_useState11, 2),
123
- ind = _useState12[0],
124
- setInd = _useState12[1];
121
+ var _useState1 = useState(-1),
122
+ _useState10 = _slicedToArray(_useState1, 2),
123
+ ind = _useState10[0],
124
+ setInd = _useState10[1];
125
125
  var filterCustomType = store.filterCustomType;
126
126
  var _ref = useRef(null);
127
- var _useState13 = useState({
127
+ var _useState11 = useState({
128
128
  isError: false
129
129
  }),
130
+ _useState12 = _slicedToArray(_useState11, 2),
131
+ errorInfo = _useState12[0],
132
+ setErrorInfo = _useState12[1];
133
+ var _useState13 = useState(false),
130
134
  _useState14 = _slicedToArray(_useState13, 2),
131
- errorInfo = _useState14[0],
132
- setErrorInfo = _useState14[1];
133
- var _useState15 = useState(false),
134
- _useState16 = _slicedToArray(_useState15, 2),
135
- isCheck = _useState16[0],
136
- setIsCheck = _useState16[1];
135
+ isCheck = _useState14[0],
136
+ setIsCheck = _useState14[1];
137
137
  var myInstanceIdRef = useRef(Math.random().toString(36).slice(2));
138
- var _useState17 = useState(!!window.__sqb_selection_active__),
138
+ var _useState15 = useState(!!window.__sqb_selection_active__),
139
+ _useState16 = _slicedToArray(_useState15, 2),
140
+ globalSelectionActive = _useState16[0],
141
+ setGlobalSelectionActive = _useState16[1];
142
+ var _useState17 = useState(window.__sqb_selection_owner__ || null),
139
143
  _useState18 = _slicedToArray(_useState17, 2),
140
- globalSelectionActive = _useState18[0],
141
- setGlobalSelectionActive = _useState18[1];
142
- var _useState19 = useState(window.__sqb_selection_owner__ || null),
144
+ globalSelectionOwner = _useState18[0],
145
+ setGlobalSelectionOwner = _useState18[1];
146
+ var _useState19 = useState([]),
143
147
  _useState20 = _slicedToArray(_useState19, 2),
144
- globalSelectionOwner = _useState20[0],
145
- setGlobalSelectionOwner = _useState20[1];
146
- var _useState21 = useState([]),
147
- _useState22 = _slicedToArray(_useState21, 2),
148
- selectedIndices = _useState22[0],
149
- setSelectedIndices = _useState22[1];
148
+ selectedIndices = _useState20[0],
149
+ setSelectedIndices = _useState20[1];
150
150
  useEffect(function () {
151
151
  var leftBrackets = caseList.filter(function (v) {
152
152
  return v.type === AtomsTypeEnum.OPERATOR && v.val === '(';
@@ -390,7 +390,7 @@ var FormulaList = forwardRef(function (props, ref) {
390
390
  onOk: function () {
391
391
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
392
392
  var _caseList;
393
- return _regeneratorRuntime.wrap(function _callee$(_context) {
393
+ return _regeneratorRuntime.wrap(function (_context) {
394
394
  while (1) switch (_context.prev = _context.next) {
395
395
  case 0:
396
396
  _caseList = caseList.slice(); // 删除选中项,selectedIndices 已经是排序好的了
@@ -399,7 +399,7 @@ var FormulaList = forwardRef(function (props, ref) {
399
399
  });
400
400
  setCaseList(_caseList);
401
401
  initPaste();
402
- case 4:
402
+ case 1:
403
403
  case "end":
404
404
  return _context.stop();
405
405
  }
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -66,7 +66,7 @@ var menuOperator = operators.map(function (v) {
66
66
  };
67
67
  });
68
68
  var JoinData = function JoinData(props) {
69
- 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;
69
+ 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;
70
70
  var meta = props.meta,
71
71
  groupIndex = props.groupIndex;
72
72
  var store = useStore();
@@ -88,20 +88,20 @@ var JoinData = function JoinData(props) {
88
88
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
89
89
  var _meta$table, _meta$table2;
90
90
  var tableName, tables, names;
91
- return _regeneratorRuntime.wrap(function _callee$(_context) {
91
+ return _regeneratorRuntime.wrap(function (_context) {
92
92
  while (1) switch (_context.prev = _context.next) {
93
93
  case 0:
94
94
  tableName = (_meta$table = meta.table2) === null || _meta$table === void 0 ? void 0 : _meta$table.name;
95
95
  if ((_meta$table2 = meta.table2) !== null && _meta$table2 !== void 0 && _meta$table2.datasourceId) {
96
- _context.next = 4;
96
+ _context.next = 1;
97
97
  break;
98
98
  }
99
99
  setIsDel(false);
100
100
  return _context.abrupt("return");
101
- case 4:
102
- _context.next = 6;
101
+ case 1:
102
+ _context.next = 2;
103
103
  return store === null || store === void 0 ? void 0 : store.fetchDataset(meta.table2.datasourceId);
104
- case 6:
104
+ case 2:
105
105
  tables = _context.sent;
106
106
  names = (tables === null || tables === void 0 ? void 0 : tables.map(function (v) {
107
107
  return v.name;
@@ -111,7 +111,7 @@ var JoinData = function JoinData(props) {
111
111
  } else {
112
112
  setIsDel(false);
113
113
  }
114
- case 9:
114
+ case 3:
115
115
  case "end":
116
116
  return _context.stop();
117
117
  }
@@ -1201,16 +1201,16 @@ var JoinData = function JoinData(props) {
1201
1201
  onOk: function () {
1202
1202
  var _onOk = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
1203
1203
  var index, newMeta;
1204
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1204
+ return _regeneratorRuntime.wrap(function (_context2) {
1205
1205
  while (1) switch (_context2.prev = _context2.next) {
1206
1206
  case 0:
1207
1207
  if (isValidSQLAlias(alias)) {
1208
- _context2.next = 3;
1208
+ _context2.next = 1;
1209
1209
  break;
1210
1210
  }
1211
1211
  Toast.warning(__('SqlQueryBuilder.aliasForRules'));
1212
1212
  return _context2.abrupt("return", false);
1213
- case 3:
1213
+ case 1:
1214
1214
  index = findIndex(store.metaList[groupIndex].list, meta);
1215
1215
  newMeta = store.metaList[groupIndex].list.slice();
1216
1216
  newMeta[index].table2.alias = alias;
@@ -1219,7 +1219,7 @@ var JoinData = function JoinData(props) {
1219
1219
  obj: newMeta[index].table2,
1220
1220
  type: ChangeType.tableAlias
1221
1221
  });
1222
- case 8:
1222
+ case 2:
1223
1223
  case "end":
1224
1224
  return _context2.stop();
1225
1225
  }
@@ -1664,7 +1664,7 @@ var JoinData = function JoinData(props) {
1664
1664
  icon: _jsx(RelatedWork, {}),
1665
1665
  onClick: switchSubQuery
1666
1666
  })
1667
- }), ((_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) {
1667
+ }), ((_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) {
1668
1668
  if (v.type === AtomsTypeEnum.JOIN_DEFAULT) {
1669
1669
  return _jsxs("div", {
1670
1670
  className: cx("Sqb-where block"),
@@ -1892,7 +1892,7 @@ var JoinData = function JoinData(props) {
1892
1892
  })]
1893
1893
  }, i);
1894
1894
  }
1895
- })), ((_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, {
1895
+ })), ((_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, {
1896
1896
  title: __('SqlQueryBuilder.add'),
1897
1897
  children: _jsx(Dropdown, {
1898
1898
  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
  }