@gingkoo/pandora-metabase 1.0.151 → 1.0.153
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/components/dialog/formula-list/CaseWhenGroup.d.ts +2 -1
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +7 -5
- package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +2 -1
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +4 -2
- package/lib/cjs/components/dialog/formula-list/index.js +23 -14
- package/lib/cjs/components/dialog/select-column/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-column/index.js +10 -1
- package/lib/cjs/components/metabase/index.js +30 -2
- package/lib/cjs/components/modules/components/header.js +1 -1
- package/lib/cjs/components/modules/components/item-name.js +4 -1
- package/lib/cjs/components/modules/components/item-wrapper.js +1 -1
- package/lib/cjs/components/modules/components/meta-icon.js +4 -2
- package/lib/cjs/components/modules/custom-column.js +2 -2
- package/lib/cjs/components/modules/join-data.js +40 -41
- package/lib/cjs/components/modules/permission-table.js +1 -0
- package/lib/cjs/components/modules/row-limit.js +1 -0
- package/lib/cjs/components/modules/sort.js +2 -2
- package/lib/cjs/components/modules/summarize/group-by.js +6 -3
- package/lib/cjs/components/modules/summarize/select-index.js +3 -3
- package/lib/cjs/components/modules/table-data.js +6 -4
- package/lib/cjs/components/modules/union.js +1 -1
- package/lib/cjs/hooks/use-state.js +66 -52
- package/lib/cjs/index.js +7 -2
- package/lib/cjs/types.d.ts +1 -0
- package/lib/cjs/utils.d.ts +2 -0
- package/lib/cjs/utils.js +4 -4
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +2 -1
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +7 -5
- package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +2 -1
- package/lib/es/components/dialog/formula-list/LogicGroup.js +4 -2
- package/lib/es/components/dialog/formula-list/index.js +24 -15
- package/lib/es/components/dialog/select-column/index.d.ts +2 -1
- package/lib/es/components/dialog/select-column/index.js +10 -1
- package/lib/es/components/metabase/index.js +30 -2
- package/lib/es/components/modules/components/header.js +1 -1
- package/lib/es/components/modules/components/item-name.js +4 -1
- package/lib/es/components/modules/components/item-wrapper.js +1 -1
- package/lib/es/components/modules/components/meta-icon.js +4 -2
- package/lib/es/components/modules/custom-column.js +2 -2
- package/lib/es/components/modules/join-data.js +40 -41
- package/lib/es/components/modules/permission-table.js +1 -0
- package/lib/es/components/modules/row-limit.js +1 -0
- package/lib/es/components/modules/sort.js +2 -2
- package/lib/es/components/modules/summarize/group-by.js +7 -4
- package/lib/es/components/modules/summarize/select-index.js +3 -3
- package/lib/es/components/modules/table-data.js +6 -4
- package/lib/es/components/modules/union.js +1 -1
- package/lib/es/hooks/use-state.js +66 -52
- package/lib/es/index.js +7 -2
- package/lib/es/types.d.ts +1 -0
- package/lib/es/utils.d.ts +2 -0
- package/lib/es/utils.js +2 -1
- package/package.json +1 -1
|
@@ -421,7 +421,7 @@ var SelectIndex = function SelectIndex(props) {
|
|
|
421
421
|
return handleUpdate(e, i);
|
|
422
422
|
},
|
|
423
423
|
children: [v.quotes && _jsx(_Fragment, {
|
|
424
|
-
children: store.groupByEnableAlias && _jsx(Tooltip, {
|
|
424
|
+
children: store.groupByEnableAlias && !store.snapshotMode && _jsx(Tooltip, {
|
|
425
425
|
title: !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias) ? __('SqlQueryBuilder.aliasForRules') : __('SqlQueryBuilder.alias'),
|
|
426
426
|
children: _jsx(Button, {
|
|
427
427
|
className: cx(':Sqb-TableName-as :Sqb-TableName green-name', _defineProperty({}, 'isError', !isValidSQLAlias(v === null || v === void 0 ? void 0 : v.fieldAlias))),
|
|
@@ -436,7 +436,7 @@ var SelectIndex = function SelectIndex(props) {
|
|
|
436
436
|
}
|
|
437
437
|
})
|
|
438
438
|
})
|
|
439
|
-
}), "".concat(v.quotes, " ").concat(v.fieldAlias ? "as ".concat(v.fieldAlias) : ''), _jsx("span", {
|
|
439
|
+
}), "".concat(v.quotes, " ").concat(v.fieldAlias ? "as ".concat(v.fieldAlias) : ''), !store.snapshotMode && _jsx("span", {
|
|
440
440
|
style: {
|
|
441
441
|
fontSize: 0
|
|
442
442
|
},
|
|
@@ -448,7 +448,7 @@ var SelectIndex = function SelectIndex(props) {
|
|
|
448
448
|
})
|
|
449
449
|
})
|
|
450
450
|
}, i);
|
|
451
|
-
}), _jsx("div", {
|
|
451
|
+
}), !store.snapshotMode && _jsx("div", {
|
|
452
452
|
className: cx("Sqb-TableName green-name", {
|
|
453
453
|
notSelected: notGroupSelected
|
|
454
454
|
}),
|
|
@@ -79,7 +79,7 @@ var TableData = function TableData(props) {
|
|
|
79
79
|
}, 0);
|
|
80
80
|
}, [meta]);
|
|
81
81
|
function selectTable(e) {
|
|
82
|
-
!meta.readonly && store.setPopup({
|
|
82
|
+
!meta.readonly && !store.snapshotMode && store.setPopup({
|
|
83
83
|
visible: true,
|
|
84
84
|
node: e.currentTarget,
|
|
85
85
|
content: _jsx(SelectTable, {
|
|
@@ -122,6 +122,7 @@ var TableData = function TableData(props) {
|
|
|
122
122
|
groupIndex: groupIndex,
|
|
123
123
|
table: meta.table,
|
|
124
124
|
metaIndex: 0,
|
|
125
|
+
readonly: store.snapshotMode,
|
|
125
126
|
data: columns,
|
|
126
127
|
onChange: function onChange(data, newMetaList) {
|
|
127
128
|
var _newMetaList = newMetaList || store.metaList[groupIndex].list.slice();
|
|
@@ -304,7 +305,7 @@ var TableData = function TableData(props) {
|
|
|
304
305
|
},
|
|
305
306
|
children: [subQuerySelected && _jsx(_Fragment, {
|
|
306
307
|
children: function () {
|
|
307
|
-
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
308
|
+
var showButton = !store.snapshotMode && (store.tableEnableAlias || tableIsError() && isDel);
|
|
308
309
|
var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
309
310
|
return showButton ? _jsx(Tooltip, {
|
|
310
311
|
title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
@@ -346,7 +347,7 @@ var TableData = function TableData(props) {
|
|
|
346
347
|
onClick: selectTable,
|
|
347
348
|
children: [selected && _jsx(_Fragment, {
|
|
348
349
|
children: function () {
|
|
349
|
-
var showButton = store.tableEnableAlias || tableIsError() && isDel;
|
|
350
|
+
var showButton = !store.snapshotMode && (store.tableEnableAlias || tableIsError() && isDel);
|
|
350
351
|
var icon = isDel ? _jsx(ExclamationCircleFill, {}) : store.tableEnableAlias ? 'As' : '';
|
|
351
352
|
return showButton ? _jsx(Tooltip, {
|
|
352
353
|
title: __(tableIsError() ? isDel ? 'metabase.verify' : 'SqlQueryBuilder.repeatAlias' : 'SqlQueryBuilder.alias'),
|
|
@@ -378,7 +379,7 @@ var TableData = function TableData(props) {
|
|
|
378
379
|
}()
|
|
379
380
|
}), selected ? "".concat(meta.table.datasourceName, ".").concat(meta.table.name, " ").concat((_meta$table7 = meta.table) !== null && _meta$table7 !== void 0 && _meta$table7.alias && store.tableEnableAlias ? "as ".concat((_meta$table8 = meta.table) === null || _meta$table8 === void 0 ? void 0 : _meta$table8.alias) : '') : __('SqlQueryBuilder.pickTable')]
|
|
380
381
|
})
|
|
381
|
-
}), store.showSubquery && _jsx(Tooltip, {
|
|
382
|
+
}), store.showSubquery && (!store.snapshotMode || meta.isSubquery) && _jsx(Tooltip, {
|
|
382
383
|
title: __('SqlQueryBuilder.switchSubQuery'),
|
|
383
384
|
children: _jsx(Button, {
|
|
384
385
|
disabled: meta.readonly,
|
|
@@ -390,6 +391,7 @@ var TableData = function TableData(props) {
|
|
|
390
391
|
})
|
|
391
392
|
}), selected && store.showFields && (!store.isExit || store.isSubquery) && ((_store$showMainColumn = store.showMainColumn[groupIndex]) === null || _store$showMainColumn === void 0 ? void 0 : _store$showMainColumn.showColumn) && _jsx("div", {
|
|
392
393
|
className: "Sqb-TableColumns",
|
|
394
|
+
"data-sqb-snapshot-allow": 'true',
|
|
393
395
|
onClick: selectColumns,
|
|
394
396
|
children: __('SqlQueryBuilder.columns')
|
|
395
397
|
})]
|
|
@@ -20,7 +20,7 @@ var RowLimit = function RowLimit(props) {
|
|
|
20
20
|
groupIndex = props.groupIndex;
|
|
21
21
|
var store = useStore();
|
|
22
22
|
function selectOperator(e) {
|
|
23
|
-
!meta.readonly && store.setPopup({
|
|
23
|
+
!meta.readonly && !store.snapshotMode && store.setPopup({
|
|
24
24
|
visible: true,
|
|
25
25
|
node: e.currentTarget,
|
|
26
26
|
content: _jsx(SelectList, {
|
|
@@ -160,80 +160,84 @@ var useStore = function useStore() {
|
|
|
160
160
|
_useState50 = _slicedToArray(_useState49, 2),
|
|
161
161
|
tableFlat = _useState50[0],
|
|
162
162
|
setTableFlat = _useState50[1];
|
|
163
|
-
var _useState51 = useState(
|
|
163
|
+
var _useState51 = useState(false),
|
|
164
164
|
_useState52 = _slicedToArray(_useState51, 2),
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
snapshotMode = _useState52[0],
|
|
166
|
+
setSnapshotMode = _useState52[1];
|
|
167
167
|
var _useState53 = useState([]),
|
|
168
168
|
_useState54 = _slicedToArray(_useState53, 2),
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
sourceTable = _useState54[0],
|
|
170
|
+
setSourceTable = _useState54[1];
|
|
171
171
|
var _useState55 = useState([]),
|
|
172
172
|
_useState56 = _slicedToArray(_useState55, 2),
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
var _useState57 = useState(
|
|
173
|
+
operatorList = _useState56[0],
|
|
174
|
+
setOperatorList = _useState56[1];
|
|
175
|
+
var _useState57 = useState([]),
|
|
176
176
|
_useState58 = _slicedToArray(_useState57, 2),
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
copyType = _useState58[0],
|
|
178
|
+
setCopyType = _useState58[1];
|
|
179
179
|
var _useState59 = useState(false),
|
|
180
180
|
_useState60 = _slicedToArray(_useState59, 2),
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
metabaseCopy = _useState60[0],
|
|
182
|
+
setMetabaseCopy = _useState60[1];
|
|
183
183
|
var _useState61 = useState(false),
|
|
184
184
|
_useState62 = _slicedToArray(_useState61, 2),
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
moduleDiff = _useState62[0],
|
|
186
|
+
setModuleDiff = _useState62[1];
|
|
187
187
|
var _useState63 = useState(false),
|
|
188
188
|
_useState64 = _slicedToArray(_useState63, 2),
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
var _useState65 = useState(
|
|
189
|
+
showFormulaSql = _useState64[0],
|
|
190
|
+
setShowFormulaSql = _useState64[1];
|
|
191
|
+
var _useState65 = useState(false),
|
|
192
192
|
_useState66 = _slicedToArray(_useState65, 2),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
var _useState67 = useState(
|
|
193
|
+
showFormulaDiff = _useState66[0],
|
|
194
|
+
setShowFormulaDiff = _useState66[1];
|
|
195
|
+
var _useState67 = useState(true),
|
|
196
196
|
_useState68 = _slicedToArray(_useState67, 2),
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
matchBrackets = _useState68[0],
|
|
198
|
+
setMatchBrackets = _useState68[1];
|
|
199
199
|
var _useState69 = useState(false),
|
|
200
200
|
_useState70 = _slicedToArray(_useState69, 2),
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var _useState71 = useState(
|
|
201
|
+
hasFormulaSqlCode = _useState70[0],
|
|
202
|
+
setHasFormulaSqlCode = _useState70[1];
|
|
203
|
+
var _useState71 = useState(false),
|
|
204
204
|
_useState72 = _slicedToArray(_useState71, 2),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var _useState73 = useState(
|
|
205
|
+
hasFormulaDiffCode = _useState72[0],
|
|
206
|
+
setHasFormulaDiffCode = _useState72[1];
|
|
207
|
+
var _useState73 = useState([]),
|
|
208
208
|
_useState74 = _slicedToArray(_useState73, 2),
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
sourceData = _useState74[0],
|
|
210
|
+
setSourceData = _useState74[1];
|
|
211
211
|
var _useState75 = useState(false),
|
|
212
212
|
_useState76 = _slicedToArray(_useState75, 2),
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
moduleCopy = _useState76[0],
|
|
214
|
+
setModuleCopy = _useState76[1];
|
|
215
215
|
var _useState77 = useState(false),
|
|
216
216
|
_useState78 = _slicedToArray(_useState77, 2),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
var _useState79 = useState(
|
|
217
|
+
isMetabaseCopy = _useState78[0],
|
|
218
|
+
setIsMetabaseCopy = _useState78[1];
|
|
219
|
+
var _useState79 = useState(false),
|
|
220
220
|
_useState80 = _slicedToArray(_useState79, 2),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
var rightClickButtonValueMap = useRef({});
|
|
221
|
+
joinAliasConflictCheck = _useState80[0],
|
|
222
|
+
setJoinAliasConflictCheck = _useState80[1];
|
|
224
223
|
var _useState81 = useState([]),
|
|
225
224
|
_useState82 = _slicedToArray(_useState81, 2),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
var
|
|
225
|
+
existsError = _useState82[0],
|
|
226
|
+
setExistsError = _useState82[1];
|
|
227
|
+
var rightClickButtonValueMap = useRef({});
|
|
228
|
+
var _useState83 = useState([]),
|
|
229
229
|
_useState84 = _slicedToArray(_useState83, 2),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
var
|
|
233
|
-
var _useState85 = useState(storage._metabaseCopyModule || []),
|
|
230
|
+
rightClickMenu = _useState84[0],
|
|
231
|
+
setRightClickMenu = _useState84[1];
|
|
232
|
+
var _useState85 = useState(null),
|
|
234
233
|
_useState86 = _slicedToArray(_useState85, 2),
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
rightClickMenuState = _useState86[0],
|
|
235
|
+
setRightClickMenuState = _useState86[1];
|
|
236
|
+
var rightClickMenuClickRef = useRef();
|
|
237
|
+
var _useState87 = useState(storage._metabaseCopyModule || []),
|
|
238
|
+
_useState88 = _slicedToArray(_useState87, 2),
|
|
239
|
+
metabaseCopyModule = _useState88[0],
|
|
240
|
+
setMetabaseCopyModule = _useState88[1];
|
|
237
241
|
var setRightClickMenuClick = function setRightClickMenuClick(fn) {
|
|
238
242
|
rightClickMenuClickRef.current = fn;
|
|
239
243
|
};
|
|
@@ -601,6 +605,12 @@ var useStore = function useStore() {
|
|
|
601
605
|
case 0:
|
|
602
606
|
changeObj = _args9.length > 2 && _args9[2] !== undefined ? _args9[2] : {};
|
|
603
607
|
_metaList = _args9.length > 3 ? _args9[3] : undefined;
|
|
608
|
+
if (!(snapshotMode && changeObj !== 'init')) {
|
|
609
|
+
_context9.next = 1;
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
return _context9.abrupt("return");
|
|
613
|
+
case 1:
|
|
604
614
|
prevMeta = cloneDeep(_metaList || latestMetaListRef.current);
|
|
605
615
|
newMeta = cloneDeep(prevMeta);
|
|
606
616
|
if (newMeta[groupInd]) {
|
|
@@ -608,23 +618,23 @@ var useStore = function useStore() {
|
|
|
608
618
|
_setMeta(newMeta);
|
|
609
619
|
}
|
|
610
620
|
if (!(changeObj === 'init')) {
|
|
611
|
-
_context9.next =
|
|
621
|
+
_context9.next = 2;
|
|
612
622
|
break;
|
|
613
623
|
}
|
|
614
624
|
return _context9.abrupt("return");
|
|
615
|
-
case
|
|
625
|
+
case 2:
|
|
616
626
|
oldData = splitByUnion(prevMeta);
|
|
617
627
|
newData = splitByUnion(newMeta);
|
|
618
|
-
_context9.next =
|
|
628
|
+
_context9.next = 3;
|
|
619
629
|
return fetchChangeFn.current(oldData, changeObj, {
|
|
620
630
|
isExit: isExit
|
|
621
631
|
}, newData);
|
|
622
|
-
case
|
|
632
|
+
case 3:
|
|
623
633
|
isChange = _context9.sent;
|
|
624
634
|
if (isChange === false) {
|
|
625
635
|
_setMeta(prevMeta);
|
|
626
636
|
}
|
|
627
|
-
case
|
|
637
|
+
case 4:
|
|
628
638
|
case "end":
|
|
629
639
|
return _context9.stop();
|
|
630
640
|
}
|
|
@@ -929,6 +939,7 @@ var useStore = function useStore() {
|
|
|
929
939
|
};
|
|
930
940
|
};
|
|
931
941
|
var addMeta = function addMeta(type, index, groupIndex, obj, onConflict) {
|
|
942
|
+
if (snapshotMode) return false;
|
|
932
943
|
if (joinAliasConflictCheck && obj && obj.length > 0) {
|
|
933
944
|
var conflict = checkTable1Conflict(obj, index, groupIndex);
|
|
934
945
|
if (conflict.hasConflict && conflict.conflictingAlias && onConflict) {
|
|
@@ -964,6 +975,7 @@ var useStore = function useStore() {
|
|
|
964
975
|
return true;
|
|
965
976
|
};
|
|
966
977
|
var delMeta = function delMeta(meta, groupIndex) {
|
|
978
|
+
if (snapshotMode) return;
|
|
967
979
|
if (meta.type === 'group') {
|
|
968
980
|
var _newMeta = metaList.slice();
|
|
969
981
|
_newMeta.splice(groupIndex, 1);
|
|
@@ -1105,6 +1117,8 @@ var useStore = function useStore() {
|
|
|
1105
1117
|
setIsSelectFields: setIsSelectFields,
|
|
1106
1118
|
tableFlat: tableFlat,
|
|
1107
1119
|
setTableFlat: setTableFlat,
|
|
1120
|
+
snapshotMode: snapshotMode,
|
|
1121
|
+
setSnapshotMode: setSnapshotMode,
|
|
1108
1122
|
getSourceTable: getSourceTable,
|
|
1109
1123
|
sourceTable: sourceTable,
|
|
1110
1124
|
copyType: copyType,
|
package/lib/es/index.js
CHANGED
|
@@ -17,6 +17,8 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
17
17
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
18
18
|
_props$showFields = props.showFields,
|
|
19
19
|
showFields = _props$showFields === void 0 ? true : _props$showFields,
|
|
20
|
+
_props$snapshotMode = props.snapshotMode,
|
|
21
|
+
snapshotMode = _props$snapshotMode === void 0 ? false : _props$snapshotMode,
|
|
20
22
|
getTables = props.getTables,
|
|
21
23
|
getColumns = props.getColumns,
|
|
22
24
|
onChange = props.onChange,
|
|
@@ -122,6 +124,7 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
122
124
|
store.setGroupByEnableAlias(groupByEnableAlias);
|
|
123
125
|
store.setIsSelectFields(isSelectFields);
|
|
124
126
|
store.setTableFlat(tableFlat);
|
|
127
|
+
store.setSnapshotMode(snapshotMode);
|
|
125
128
|
store.setCopyType(copyType || EMPTY_ARRAY);
|
|
126
129
|
store.setMetabaseCopy(metabaseCopy);
|
|
127
130
|
store.setModuleDiff(moduleDiff);
|
|
@@ -132,7 +135,7 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
132
135
|
store.setModuleCopy(moduleCopy);
|
|
133
136
|
store.setJoinAliasConflictCheck(joinAliasConflictCheck);
|
|
134
137
|
store.setOperatorList(operatorList || EMPTY_ARRAY);
|
|
135
|
-
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
138
|
+
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, snapshotMode, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
136
139
|
React.useImperativeHandle(ref, function () {
|
|
137
140
|
return {
|
|
138
141
|
reset: function reset() {
|
|
@@ -152,7 +155,9 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
152
155
|
msg: __('loading')
|
|
153
156
|
});
|
|
154
157
|
return _jsx(Provider, {
|
|
155
|
-
value: store,
|
|
158
|
+
value: _objectSpread(_objectSpread({}, store), {}, {
|
|
159
|
+
snapshotMode: snapshotMode
|
|
160
|
+
}),
|
|
156
161
|
children: _jsx(Metabase, _objectSpread({}, props))
|
|
157
162
|
});
|
|
158
163
|
});
|
package/lib/es/types.d.ts
CHANGED
package/lib/es/utils.d.ts
CHANGED
|
@@ -25,7 +25,9 @@ export declare const getHelper: (list: MetaListType[], item: MetaListType) => He
|
|
|
25
25
|
export declare const mergeSubQueryColumns: (columns: MetaData_ColumnsType[], oldColumns?: MetaData_ColumnsType[], isSelectFields?: boolean) => MetaData_ColumnsType[];
|
|
26
26
|
export declare const syncSubQueryFieldReferences: (list: MetaListType[], table: MetaData_TableType, columns: MetaData_ColumnsType[], oldColumns?: MetaData_ColumnsType[]) => MetaListType[];
|
|
27
27
|
export declare const getSubColumns: (metaList: any) => DataType[];
|
|
28
|
+
export declare const getAtomDisplayText: (item?: AtomsItem) => string;
|
|
28
29
|
export declare const normalizeAndOrStructure: <T>(data: T) => T;
|
|
30
|
+
export declare const syncAtomQuotes: (item: AtomsItem) => AtomsItem;
|
|
29
31
|
export declare function isValidSQLAlias(str: string): boolean;
|
|
30
32
|
export declare const changeTableAlias: (list: MetaListType[] | [], curObj: Pick<MetaData_TableType, "tableUuid" | "alias">) => MetaListType[];
|
|
31
33
|
export declare const changeFieldAlias: (list: MetaListType[], curObj: Pick<MetaData_ColumnsType, "fieldUuid" | "fieldAlias"> & Partial<Pick<MetaData_ColumnsType, "id" | "name" | "datasourceId">> & Partial<Pick<MetaSummarize_Group | MetaSummarize_By, "table" | "tableId" | "tableUuid" | "fieldId" | "name">>) => MetaListType[];
|
package/lib/es/utils.js
CHANGED
|
@@ -617,6 +617,7 @@ var _getAtomDisplayText = function getAtomDisplayText(item) {
|
|
|
617
617
|
if (Array.isArray(val)) return val.join(', ');
|
|
618
618
|
return val || val === 0 ? String(val) : '';
|
|
619
619
|
};
|
|
620
|
+
export { _getAtomDisplayText as getAtomDisplayText };
|
|
620
621
|
var buildFormulaQuotes = function buildFormulaQuotes(item) {
|
|
621
622
|
var argsText = (item.args || []).map(_getAtomDisplayText).join(' , ');
|
|
622
623
|
return normalizeAtomQuotes("".concat(item.name || '', " ( ").concat(argsText, " )"));
|
|
@@ -954,7 +955,7 @@ var buildExpressionQuotes = function buildExpressionQuotes(item) {
|
|
|
954
955
|
}
|
|
955
956
|
return normalizeAtomQuotes("".concat(lhsText, " ").concat(getExpressionConditionText(condition), " ").concat(rhsText || firstVal));
|
|
956
957
|
};
|
|
957
|
-
var syncAtomQuotes = function syncAtomQuotes(item) {
|
|
958
|
+
export var syncAtomQuotes = function syncAtomQuotes(item) {
|
|
958
959
|
if (item.type === AtomsTypeEnum.JOIN_DEFAULT) {
|
|
959
960
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
960
961
|
lhs: syncAtomQuotesList(item.lhs || []),
|