@gingkoo/pandora-metabase 1.0.94 → 1.0.95

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.
@@ -232,23 +232,30 @@ var useStore = function useStore() {
232
232
  fetchDiffFn.current = fn;
233
233
  };
234
234
  var setExistsErrorFn = /*#__PURE__*/function () {
235
- var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fn) {
235
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(fn, value) {
236
236
  var data;
237
237
  return _regenerator["default"].wrap(function (_context) {
238
238
  while (1) switch (_context.prev = _context.next) {
239
239
  case 0:
240
- _context.next = 1;
241
- return fn();
240
+ if (!(!value || value.length < 1)) {
241
+ _context.next = 1;
242
+ break;
243
+ }
244
+ setExistsError([]);
245
+ return _context.abrupt("return");
242
246
  case 1:
247
+ _context.next = 2;
248
+ return fn(value);
249
+ case 2:
243
250
  data = _context.sent;
244
251
  setExistsError(data || []);
245
- case 2:
252
+ case 3:
246
253
  case "end":
247
254
  return _context.stop();
248
255
  }
249
256
  }, _callee);
250
257
  }));
251
- return function setExistsErrorFn(_x) {
258
+ return function setExistsErrorFn(_x, _x2) {
252
259
  return _ref.apply(this, arguments);
253
260
  };
254
261
  }();
@@ -345,7 +352,7 @@ var useStore = function useStore() {
345
352
  }
346
353
  }, _callee3);
347
354
  }));
348
- return function (_x3) {
355
+ return function (_x4) {
349
356
  return _ref4.apply(this, arguments);
350
357
  };
351
358
  }()));
@@ -358,7 +365,7 @@ var useStore = function useStore() {
358
365
  }
359
366
  }, _callee4);
360
367
  }));
361
- return function getSourceTable(_x2) {
368
+ return function getSourceTable(_x3) {
362
369
  return _ref3.apply(this, arguments);
363
370
  };
364
371
  }();
@@ -404,7 +411,7 @@ var useStore = function useStore() {
404
411
  }
405
412
  }, _callee5);
406
413
  }));
407
- return function fetchDataset(_x4) {
414
+ return function fetchDataset(_x5) {
408
415
  return _ref5.apply(this, arguments);
409
416
  };
410
417
  }();
@@ -484,7 +491,7 @@ var useStore = function useStore() {
484
491
  }
485
492
  }, _callee6);
486
493
  }));
487
- return function fetchColumns(_x5, _x6) {
494
+ return function fetchColumns(_x6, _x7) {
488
495
  return _ref6.apply(this, arguments);
489
496
  };
490
497
  }();
@@ -528,7 +535,7 @@ var useStore = function useStore() {
528
535
  }
529
536
  }, _callee7);
530
537
  }));
531
- return function setMeta(_x7, _x8) {
538
+ return function setMeta(_x8, _x9) {
532
539
  return _ref7.apply(this, arguments);
533
540
  };
534
541
  }();
package/lib/cjs/index.js CHANGED
@@ -89,7 +89,6 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
89
89
  getColumns && store.setFetchColumnsFn(getColumns);
90
90
  onChange && store.setFetchChangeFn(onChange);
91
91
  getModuleDiffCode && store.setFetchDiffFn(getModuleDiffCode);
92
- getExistsError && store.setExistsErrorFn(getExistsError);
93
92
  }, []);
94
93
  (0, _react.useEffect)(function () {
95
94
  store.setProps(props);
@@ -99,6 +98,7 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
99
98
  var source_value = (0, _utils.patchData)(value);
100
99
  store.setPreData((0, _cloneDeep["default"])(_value), isSubquery, isExit);
101
100
  store.setSourceData(source_value);
101
+ getExistsError && store.setExistsErrorFn(getExistsError, value);
102
102
  }, [value]);
103
103
  (0, _react.useEffect)(function () {
104
104
  store.setSourceList(isExit && exitSourceList && Array.from(exitSourceList).length > 0 ? exitSourceList || sourceList : sourceList);
@@ -59,7 +59,7 @@ export interface MetabaseProps {
59
59
  oldCode: string;
60
60
  newCode: string;
61
61
  }>;
62
- getExistsError?: () => Promise<any[]>;
62
+ getExistsError?: (params: MetaListType[]) => Promise<any[]>;
63
63
  operatorList?: any[];
64
64
  }
65
65
  export interface OptionItem {
@@ -226,23 +226,30 @@ var useStore = function useStore() {
226
226
  fetchDiffFn.current = fn;
227
227
  };
228
228
  var setExistsErrorFn = /*#__PURE__*/function () {
229
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fn) {
229
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(fn, value) {
230
230
  var data;
231
231
  return _regeneratorRuntime.wrap(function (_context) {
232
232
  while (1) switch (_context.prev = _context.next) {
233
233
  case 0:
234
- _context.next = 1;
235
- return fn();
234
+ if (!(!value || value.length < 1)) {
235
+ _context.next = 1;
236
+ break;
237
+ }
238
+ setExistsError([]);
239
+ return _context.abrupt("return");
236
240
  case 1:
241
+ _context.next = 2;
242
+ return fn(value);
243
+ case 2:
237
244
  data = _context.sent;
238
245
  setExistsError(data || []);
239
- case 2:
246
+ case 3:
240
247
  case "end":
241
248
  return _context.stop();
242
249
  }
243
250
  }, _callee);
244
251
  }));
245
- return function setExistsErrorFn(_x) {
252
+ return function setExistsErrorFn(_x, _x2) {
246
253
  return _ref.apply(this, arguments);
247
254
  };
248
255
  }();
@@ -339,7 +346,7 @@ var useStore = function useStore() {
339
346
  }
340
347
  }, _callee3);
341
348
  }));
342
- return function (_x3) {
349
+ return function (_x4) {
343
350
  return _ref4.apply(this, arguments);
344
351
  };
345
352
  }()));
@@ -352,7 +359,7 @@ var useStore = function useStore() {
352
359
  }
353
360
  }, _callee4);
354
361
  }));
355
- return function getSourceTable(_x2) {
362
+ return function getSourceTable(_x3) {
356
363
  return _ref3.apply(this, arguments);
357
364
  };
358
365
  }();
@@ -398,7 +405,7 @@ var useStore = function useStore() {
398
405
  }
399
406
  }, _callee5);
400
407
  }));
401
- return function fetchDataset(_x4) {
408
+ return function fetchDataset(_x5) {
402
409
  return _ref5.apply(this, arguments);
403
410
  };
404
411
  }();
@@ -478,7 +485,7 @@ var useStore = function useStore() {
478
485
  }
479
486
  }, _callee6);
480
487
  }));
481
- return function fetchColumns(_x5, _x6) {
488
+ return function fetchColumns(_x6, _x7) {
482
489
  return _ref6.apply(this, arguments);
483
490
  };
484
491
  }();
@@ -522,7 +529,7 @@ var useStore = function useStore() {
522
529
  }
523
530
  }, _callee7);
524
531
  }));
525
- return function setMeta(_x7, _x8) {
532
+ return function setMeta(_x8, _x9) {
526
533
  return _ref7.apply(this, arguments);
527
534
  };
528
535
  }();
package/lib/es/index.js CHANGED
@@ -79,7 +79,6 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
79
79
  getColumns && store.setFetchColumnsFn(getColumns);
80
80
  onChange && store.setFetchChangeFn(onChange);
81
81
  getModuleDiffCode && store.setFetchDiffFn(getModuleDiffCode);
82
- getExistsError && store.setExistsErrorFn(getExistsError);
83
82
  }, []);
84
83
  useEffect(function () {
85
84
  store.setProps(props);
@@ -89,6 +88,7 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
89
88
  var source_value = patchData(value);
90
89
  store.setPreData(cloneDeep(_value), isSubquery, isExit);
91
90
  store.setSourceData(source_value);
91
+ getExistsError && store.setExistsErrorFn(getExistsError, value);
92
92
  }, [value]);
93
93
  useEffect(function () {
94
94
  store.setSourceList(isExit && exitSourceList && Array.from(exitSourceList).length > 0 ? exitSourceList || sourceList : sourceList);
package/lib/es/types.d.ts CHANGED
@@ -59,7 +59,7 @@ export interface MetabaseProps {
59
59
  oldCode: string;
60
60
  newCode: string;
61
61
  }>;
62
- getExistsError?: () => Promise<any[]>;
62
+ getExistsError?: (params: MetaListType[]) => Promise<any[]>;
63
63
  operatorList?: any[];
64
64
  }
65
65
  export interface OptionItem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",