@gingkoo/pandora-metabase 1.0.158-alpha.4 → 1.0.158-alpha.5
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/hooks/use-state.js +4 -10
- package/lib/cjs/index.js +1 -1
- package/lib/es/hooks/use-state.js +4 -10
- package/lib/es/index.js +1 -1
- package/package.json +1 -1
|
@@ -523,7 +523,6 @@ var useStore = function useStore() {
|
|
|
523
523
|
var oldColumns,
|
|
524
524
|
callback,
|
|
525
525
|
isSelect,
|
|
526
|
-
_isSubquery,
|
|
527
526
|
_isExit,
|
|
528
527
|
_table$alias,
|
|
529
528
|
alias,
|
|
@@ -541,11 +540,7 @@ var useStore = function useStore() {
|
|
|
541
540
|
oldColumns = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : [];
|
|
542
541
|
callback = _args8.length > 3 ? _args8[3] : undefined;
|
|
543
542
|
isSelect = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : isSelectFields;
|
|
544
|
-
|
|
545
|
-
_isExit = _args8.length > 6 && _args8[6] !== undefined ? _args8[6] : isExit;
|
|
546
|
-
if (_isSubquery && oldColumns.length < 1) {
|
|
547
|
-
isSelect = false;
|
|
548
|
-
}
|
|
543
|
+
_isExit = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : isExit;
|
|
549
544
|
_table$alias = table.alias, alias = _table$alias === void 0 ? '' : _table$alias, datasourceName = table.datasourceName, did = table.datasourceId, column = table.column, extra = (0, _objectWithoutProperties2["default"])(table, _excluded);
|
|
550
545
|
tableName = table.name;
|
|
551
546
|
columns = getColumns(tableName);
|
|
@@ -639,8 +634,7 @@ var useStore = function useStore() {
|
|
|
639
634
|
};
|
|
640
635
|
}();
|
|
641
636
|
var setPreData = function setPreData(data) {
|
|
642
|
-
var
|
|
643
|
-
var _isExit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isExit;
|
|
637
|
+
var _isExit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isExit;
|
|
644
638
|
if (data.length) {
|
|
645
639
|
var _metaList = data === null || data === void 0 ? void 0 : data.map(function (item, groupIndex) {
|
|
646
640
|
var _item$list;
|
|
@@ -657,7 +651,7 @@ var useStore = function useStore() {
|
|
|
657
651
|
newMeta[i].columns = columns || [];
|
|
658
652
|
}
|
|
659
653
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
660
|
-
}, false,
|
|
654
|
+
}, false, _isExit);
|
|
661
655
|
return (0, _objectSpread2["default"])({}, v);
|
|
662
656
|
}
|
|
663
657
|
if ((_v$table2 = v.table) !== null && _v$table2 !== void 0 && _v$table2.datasourceId) {
|
|
@@ -667,7 +661,7 @@ var useStore = function useStore() {
|
|
|
667
661
|
newMeta[i].columns = columns || [];
|
|
668
662
|
}
|
|
669
663
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
670
|
-
}, false,
|
|
664
|
+
}, false, _isExit);
|
|
671
665
|
return (0, _objectSpread2["default"])({}, v);
|
|
672
666
|
}
|
|
673
667
|
return (0, _objectSpread2["default"])({}, v);
|
package/lib/cjs/index.js
CHANGED
|
@@ -116,7 +116,7 @@ var SqlVisionBuilder = _react["default"].forwardRef(function (props, ref) {
|
|
|
116
116
|
(0, _react.useEffect)(function () {
|
|
117
117
|
var source_value = (0, _utils.normalizeAndOrStructure)((0, _utils.patchData)(value, constantList, formulaTemplates));
|
|
118
118
|
var _value = (0, _utils.reassembleByUnion)(source_value);
|
|
119
|
-
store.setPreData((0, _cloneDeep["default"])(_value),
|
|
119
|
+
store.setPreData((0, _cloneDeep["default"])(_value), isExit);
|
|
120
120
|
store.setSourceData(source_value);
|
|
121
121
|
getExistsError && store.setExistsErrorFn(getExistsError, value);
|
|
122
122
|
}, [value, constantList, formulaTemplates]);
|
|
@@ -517,7 +517,6 @@ var useStore = function useStore() {
|
|
|
517
517
|
var oldColumns,
|
|
518
518
|
callback,
|
|
519
519
|
isSelect,
|
|
520
|
-
_isSubquery,
|
|
521
520
|
_isExit,
|
|
522
521
|
_table$alias,
|
|
523
522
|
alias,
|
|
@@ -535,11 +534,7 @@ var useStore = function useStore() {
|
|
|
535
534
|
oldColumns = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : [];
|
|
536
535
|
callback = _args8.length > 3 ? _args8[3] : undefined;
|
|
537
536
|
isSelect = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : isSelectFields;
|
|
538
|
-
|
|
539
|
-
_isExit = _args8.length > 6 && _args8[6] !== undefined ? _args8[6] : isExit;
|
|
540
|
-
if (_isSubquery && oldColumns.length < 1) {
|
|
541
|
-
isSelect = false;
|
|
542
|
-
}
|
|
537
|
+
_isExit = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : isExit;
|
|
543
538
|
_table$alias = table.alias, alias = _table$alias === void 0 ? '' : _table$alias, datasourceName = table.datasourceName, did = table.datasourceId, column = table.column, extra = _objectWithoutProperties(table, _excluded);
|
|
544
539
|
tableName = table.name;
|
|
545
540
|
columns = getColumns(tableName);
|
|
@@ -633,8 +628,7 @@ var useStore = function useStore() {
|
|
|
633
628
|
};
|
|
634
629
|
}();
|
|
635
630
|
var setPreData = function setPreData(data) {
|
|
636
|
-
var
|
|
637
|
-
var _isExit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isExit;
|
|
631
|
+
var _isExit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isExit;
|
|
638
632
|
if (data.length) {
|
|
639
633
|
var _metaList = data === null || data === void 0 ? void 0 : data.map(function (item, groupIndex) {
|
|
640
634
|
var _item$list;
|
|
@@ -651,7 +645,7 @@ var useStore = function useStore() {
|
|
|
651
645
|
newMeta[i].columns = columns || [];
|
|
652
646
|
}
|
|
653
647
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
654
|
-
}, false,
|
|
648
|
+
}, false, _isExit);
|
|
655
649
|
return _objectSpread({}, v);
|
|
656
650
|
}
|
|
657
651
|
if ((_v$table2 = v.table) !== null && _v$table2 !== void 0 && _v$table2.datasourceId) {
|
|
@@ -661,7 +655,7 @@ var useStore = function useStore() {
|
|
|
661
655
|
newMeta[i].columns = columns || [];
|
|
662
656
|
}
|
|
663
657
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
664
|
-
}, false,
|
|
658
|
+
}, false, _isExit);
|
|
665
659
|
return _objectSpread({}, v);
|
|
666
660
|
}
|
|
667
661
|
return _objectSpread({}, v);
|
package/lib/es/index.js
CHANGED
|
@@ -101,7 +101,7 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
101
101
|
useEffect(function () {
|
|
102
102
|
var source_value = normalizeAndOrStructure(patchData(value, constantList, formulaTemplates));
|
|
103
103
|
var _value = reassembleByUnion(source_value);
|
|
104
|
-
store.setPreData(cloneDeep(_value),
|
|
104
|
+
store.setPreData(cloneDeep(_value), isExit);
|
|
105
105
|
store.setSourceData(source_value);
|
|
106
106
|
getExistsError && store.setExistsErrorFn(getExistsError, value);
|
|
107
107
|
}, [value, constantList, formulaTemplates]);
|