@gingkoo/pandora-metabase 1.0.126 → 1.0.128
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/expression/index.js +15 -5
- package/lib/cjs/components/dialog/expression/index.less +31 -16
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +14 -5
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +236 -62
- package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +3 -2
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +19 -11
- package/lib/cjs/components/dialog/formula-list/index.d.ts +1 -0
- package/lib/cjs/components/dialog/formula-list/index.js +658 -174
- package/lib/cjs/components/dialog/formula-list/index.less +1438 -145
- package/lib/cjs/components/dialog/formula-list/utils.js +50 -19
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +1 -0
- package/lib/cjs/components/dialog/select-column-multiple/index.js +42 -22
- package/lib/cjs/components/dialog/select-summarize/index.js +10 -2
- package/lib/cjs/components/dialog/select-table/index.d.ts +2 -1
- package/lib/cjs/components/dialog/select-table/index.js +197 -52
- package/lib/cjs/components/dialog/select-table/index.less +45 -2
- package/lib/cjs/components/metabase/index.less +156 -39
- package/lib/cjs/components/modules/custom-column.js +7 -3
- package/lib/cjs/components/modules/filter.js +6 -3
- package/lib/cjs/components/modules/join-data.js +67 -16
- package/lib/cjs/components/modules/permission-table.js +8 -4
- package/lib/cjs/components/modules/sort.js +2 -1
- package/lib/cjs/components/modules/summarize/group-by.js +20 -6
- package/lib/cjs/components/modules/summarize/select-index.js +9 -5
- package/lib/cjs/components/modules/table-data.js +26 -5
- package/lib/cjs/hooks/use-state.js +143 -17
- package/lib/cjs/index.js +7 -1
- package/lib/cjs/store/types.d.ts +14 -7
- package/lib/cjs/types.d.ts +8 -0
- package/lib/cjs/utils/transformSql.js +44 -21
- package/lib/cjs/utils.d.ts +2 -2
- package/lib/cjs/utils.js +349 -58
- package/lib/es/components/dialog/expression/index.js +15 -5
- package/lib/es/components/dialog/expression/index.less +31 -16
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +14 -5
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +238 -64
- package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +3 -2
- package/lib/es/components/dialog/formula-list/LogicGroup.js +19 -11
- package/lib/es/components/dialog/formula-list/index.d.ts +1 -0
- package/lib/es/components/dialog/formula-list/index.js +660 -176
- package/lib/es/components/dialog/formula-list/index.less +1438 -145
- package/lib/es/components/dialog/formula-list/utils.js +50 -19
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +1 -0
- package/lib/es/components/dialog/select-column-multiple/index.js +42 -22
- package/lib/es/components/dialog/select-summarize/index.js +10 -2
- package/lib/es/components/dialog/select-table/index.d.ts +2 -1
- package/lib/es/components/dialog/select-table/index.js +197 -52
- package/lib/es/components/dialog/select-table/index.less +45 -2
- package/lib/es/components/metabase/index.less +156 -39
- package/lib/es/components/modules/custom-column.js +7 -3
- package/lib/es/components/modules/filter.js +6 -3
- package/lib/es/components/modules/join-data.js +67 -16
- package/lib/es/components/modules/permission-table.js +8 -4
- package/lib/es/components/modules/sort.js +2 -1
- package/lib/es/components/modules/summarize/group-by.js +21 -7
- package/lib/es/components/modules/summarize/select-index.js +10 -6
- package/lib/es/components/modules/table-data.js +26 -5
- package/lib/es/hooks/use-state.js +143 -17
- package/lib/es/index.js +7 -1
- package/lib/es/store/types.d.ts +14 -7
- package/lib/es/types.d.ts +8 -0
- package/lib/es/utils/transformSql.js +45 -22
- package/lib/es/utils.d.ts +2 -2
- package/lib/es/utils.js +350 -59
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -21,6 +21,7 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
21
21
|
value = _ref.value,
|
|
22
22
|
_ref$onChange = _ref.onChange,
|
|
23
23
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
24
|
+
onDatasourceTypeChange = _ref.onDatasourceTypeChange,
|
|
24
25
|
didUpdate = _ref.didUpdate,
|
|
25
26
|
_ref$tableFlat = _ref.tableFlat,
|
|
26
27
|
tableFlat = _ref$tableFlat === void 0 ? false : _ref$tableFlat;
|
|
@@ -34,50 +35,198 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
34
35
|
datasource = _useState4[0];
|
|
35
36
|
var _useState5 = useState(sourceTable.slice()),
|
|
36
37
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _useState7 = useState(
|
|
38
|
+
originDatasourceTable = _useState6[0],
|
|
39
|
+
setOriginDatasourceTable = _useState6[1];
|
|
40
|
+
var _useState7 = useState(sourceTable.slice()),
|
|
40
41
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
datasourceTable = _useState8[0],
|
|
43
|
+
setDatasourceTable = _useState8[1];
|
|
43
44
|
var _useState9 = useState([]),
|
|
44
45
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var _useState1 = useState(
|
|
46
|
+
list = _useState0[0],
|
|
47
|
+
setList = _useState0[1];
|
|
48
|
+
var _useState1 = useState([]),
|
|
48
49
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
originList = _useState10[0],
|
|
51
|
+
setOriginList = _useState10[1];
|
|
52
|
+
var _useState11 = useState(value),
|
|
53
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
54
|
+
val = _useState12[0],
|
|
55
|
+
setVal = _useState12[1];
|
|
56
|
+
var _useState13 = useState(''),
|
|
57
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
58
|
+
tableFilterValue = _useState14[0],
|
|
59
|
+
setTableFilterValue = _useState14[1];
|
|
51
60
|
useEffect(function () {
|
|
52
61
|
if (value.datasourceId) {
|
|
53
|
-
|
|
62
|
+
var datasourceItem = getDatasource(value.datasourceId);
|
|
63
|
+
var _datasourceType = value.datasourceType || getDefaultDatasourceType(datasourceItem);
|
|
64
|
+
var nextVal = _objectSpread(_objectSpread({}, value), {}, {
|
|
65
|
+
datasourceType: _datasourceType
|
|
66
|
+
});
|
|
67
|
+
setVal(nextVal);
|
|
68
|
+
if (!value.datasourceType && _datasourceType) {
|
|
69
|
+
emitDatasourceTypeChange(nextVal);
|
|
70
|
+
}
|
|
71
|
+
loadTables(value.datasourceId, _datasourceType);
|
|
54
72
|
}
|
|
55
73
|
}, []);
|
|
56
|
-
function
|
|
57
|
-
|
|
74
|
+
function getDefaultDatasourceType(datasource) {
|
|
75
|
+
var _datasource$datasourc;
|
|
76
|
+
return (datasource === null || datasource === void 0 ? void 0 : datasource.defaultDatasourceType) || (datasource === null || datasource === void 0 ? void 0 : datasource.datasourceType) || (datasource === null || datasource === void 0 || (_datasource$datasourc = datasource.datasourceTypeList) === null || _datasource$datasourc === void 0 || (_datasource$datasourc = _datasource$datasourc[0]) === null || _datasource$datasourc === void 0 ? void 0 : _datasource$datasourc.value) || '';
|
|
77
|
+
}
|
|
78
|
+
function getDatasource(datasourceId) {
|
|
79
|
+
return datasource.find(function (v) {
|
|
80
|
+
return v.datasourceId === datasourceId;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function filterDatasourceTables(tables, keyword) {
|
|
84
|
+
var searchVal = keyword.toLocaleLowerCase();
|
|
85
|
+
if (!searchVal) return tables.slice();
|
|
86
|
+
return cloneDeep(tables.slice()).map(function (v) {
|
|
87
|
+
var _v$children;
|
|
88
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
89
|
+
children: v === null || v === void 0 || (_v$children = v.children) === null || _v$children === void 0 ? void 0 : _v$children.filter(function (vv) {
|
|
90
|
+
return ~(vv.name + (vv.name_zh || '')).toLocaleLowerCase().indexOf(searchVal);
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}).filter(function (v) {
|
|
94
|
+
return (v.children || []).length > 0;
|
|
95
|
+
});
|
|
58
96
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
97
|
+
function loadTables(_x) {
|
|
98
|
+
return _loadTables.apply(this, arguments);
|
|
99
|
+
}
|
|
100
|
+
function _loadTables() {
|
|
101
|
+
_loadTables = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(datasourceId) {
|
|
102
|
+
var datasourceType,
|
|
103
|
+
force,
|
|
104
|
+
tables,
|
|
105
|
+
_args = arguments;
|
|
62
106
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
63
107
|
while (1) switch (_context.prev = _context.next) {
|
|
64
108
|
case 0:
|
|
109
|
+
datasourceType = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
|
|
110
|
+
force = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
65
111
|
setLoading(true);
|
|
66
112
|
_context.next = 1;
|
|
67
|
-
return store.fetchDataset(datasourceId);
|
|
113
|
+
return store.fetchDataset(datasourceId, datasourceType, force);
|
|
68
114
|
case 1:
|
|
69
115
|
tables = _context.sent;
|
|
70
116
|
setLoading(false);
|
|
71
117
|
setList(tables);
|
|
72
118
|
setOriginList(tables);
|
|
119
|
+
return _context.abrupt("return", tables);
|
|
73
120
|
case 2:
|
|
74
121
|
case "end":
|
|
75
122
|
return _context.stop();
|
|
76
123
|
}
|
|
77
124
|
}, _callee);
|
|
78
125
|
}));
|
|
79
|
-
return
|
|
126
|
+
return _loadTables.apply(this, arguments);
|
|
127
|
+
}
|
|
128
|
+
function emitDatasourceTypeChange(nextVal) {
|
|
129
|
+
if (!nextVal.datasourceId || !nextVal.name) return;
|
|
130
|
+
onDatasourceTypeChange === null || onDatasourceTypeChange === void 0 || onDatasourceTypeChange(nextVal);
|
|
131
|
+
}
|
|
132
|
+
function handleSelectDatasource(datasource, datasourceType) {
|
|
133
|
+
var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
134
|
+
var nextDatasourceType = datasourceType || getDefaultDatasourceType(datasource);
|
|
135
|
+
setVal({
|
|
136
|
+
datasourceId: datasource.datasourceId,
|
|
137
|
+
datasourceName: datasource.datasourceName,
|
|
138
|
+
datasourceType: nextDatasourceType,
|
|
139
|
+
name: '',
|
|
140
|
+
name_zh: '',
|
|
141
|
+
id: '',
|
|
142
|
+
tableUuid: uuidv4('table'),
|
|
143
|
+
alias: ''
|
|
144
|
+
});
|
|
145
|
+
loadTables(datasource.datasourceId, nextDatasourceType, force);
|
|
146
|
+
}
|
|
147
|
+
function handleDatasourceTypeChange(datasourceType) {
|
|
148
|
+
var nextVal = _objectSpread(_objectSpread({}, val), {}, {
|
|
149
|
+
datasourceType: datasourceType
|
|
150
|
+
});
|
|
151
|
+
setVal(nextVal);
|
|
152
|
+
emitDatasourceTypeChange(nextVal);
|
|
153
|
+
loadTables(nextVal.datasourceId, datasourceType, true);
|
|
154
|
+
}
|
|
155
|
+
function handleFlatDatasourceTypeChange(_x2, _x3) {
|
|
156
|
+
return _handleFlatDatasourceTypeChange.apply(this, arguments);
|
|
157
|
+
}
|
|
158
|
+
function _handleFlatDatasourceTypeChange() {
|
|
159
|
+
_handleFlatDatasourceTypeChange = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(datasourceItem, datasourceType) {
|
|
160
|
+
var nextVal, tables, updateDatasourceTable, nextOriginDatasourceTable;
|
|
161
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
162
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
163
|
+
case 0:
|
|
164
|
+
if (val.datasourceId === datasourceItem.datasourceId) {
|
|
165
|
+
nextVal = _objectSpread(_objectSpread({}, val), {}, {
|
|
166
|
+
datasourceType: datasourceType
|
|
167
|
+
});
|
|
168
|
+
setVal(nextVal);
|
|
169
|
+
emitDatasourceTypeChange(nextVal);
|
|
170
|
+
}
|
|
171
|
+
_context2.next = 1;
|
|
172
|
+
return loadTables(datasourceItem.datasourceId, datasourceType, true);
|
|
173
|
+
case 1:
|
|
174
|
+
tables = _context2.sent;
|
|
175
|
+
updateDatasourceTable = function updateDatasourceTable(tablesData) {
|
|
176
|
+
return tablesData.map(function (v) {
|
|
177
|
+
if (v.datasourceId !== datasourceItem.datasourceId) return v;
|
|
178
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
179
|
+
datasourceType: datasourceType,
|
|
180
|
+
children: tables
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
nextOriginDatasourceTable = updateDatasourceTable(originDatasourceTable);
|
|
185
|
+
setOriginDatasourceTable(nextOriginDatasourceTable);
|
|
186
|
+
setDatasourceTable(filterDatasourceTables(nextOriginDatasourceTable, tableFilterValue));
|
|
187
|
+
case 2:
|
|
188
|
+
case "end":
|
|
189
|
+
return _context2.stop();
|
|
190
|
+
}
|
|
191
|
+
}, _callee2);
|
|
192
|
+
}));
|
|
193
|
+
return _handleFlatDatasourceTypeChange.apply(this, arguments);
|
|
194
|
+
}
|
|
195
|
+
function renderDatasourceTypeSelector(datasourceItem, datasourceType, onChange) {
|
|
196
|
+
var datasourceTypeList = datasourceItem.datasourceTypeList || [];
|
|
197
|
+
if (!datasourceTypeList.length) return null;
|
|
198
|
+
return _jsx("div", {
|
|
199
|
+
className: 'Sqb-DatasourceType-radio',
|
|
200
|
+
onClick: function onClick(e) {
|
|
201
|
+
return e.stopPropagation();
|
|
202
|
+
},
|
|
203
|
+
children: datasourceTypeList.map(function (item) {
|
|
204
|
+
var checked = datasourceType === item.value;
|
|
205
|
+
var handleChangeType = function handleChangeType(e) {
|
|
206
|
+
e.preventDefault();
|
|
207
|
+
e.stopPropagation();
|
|
208
|
+
if (!checked) onChange(item.value);
|
|
209
|
+
};
|
|
210
|
+
return _jsxs("label", {
|
|
211
|
+
className: 'Sqb-DatasourceType-radio-item',
|
|
212
|
+
onMouseDown: handleChangeType,
|
|
213
|
+
onClick: handleChangeType,
|
|
214
|
+
children: [_jsx("input", {
|
|
215
|
+
type: 'radio',
|
|
216
|
+
name: "datasourceType_".concat(datasourceItem.datasourceId || 'current'),
|
|
217
|
+
checked: checked,
|
|
218
|
+
readOnly: true
|
|
219
|
+
}), _jsx("span", {
|
|
220
|
+
children: item.label
|
|
221
|
+
})]
|
|
222
|
+
}, item.value);
|
|
223
|
+
})
|
|
224
|
+
});
|
|
80
225
|
}
|
|
226
|
+
useEffect(function () {
|
|
227
|
+
setOriginDatasourceTable(sourceTable.slice());
|
|
228
|
+
setDatasourceTable(filterDatasourceTables(sourceTable.slice(), tableFilterValue));
|
|
229
|
+
}, [sourceTable]);
|
|
81
230
|
useEffect(function () {
|
|
82
231
|
didUpdate === null || didUpdate === void 0 || didUpdate();
|
|
83
232
|
}, [list, loading, datasource]);
|
|
@@ -90,23 +239,14 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
90
239
|
}
|
|
91
240
|
function onInput1(e) {
|
|
92
241
|
var val = e.target.value;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var _v$children;
|
|
96
|
-
return _objectSpread(_objectSpread({}, v), {}, {
|
|
97
|
-
children: v === null || v === void 0 || (_v$children = v.children) === null || _v$children === void 0 ? void 0 : _v$children.filter(function (v) {
|
|
98
|
-
return ~(v.name + (v.name_zh || '')).toLocaleLowerCase().indexOf(val.toLocaleLowerCase());
|
|
99
|
-
})
|
|
100
|
-
});
|
|
101
|
-
}).filter(function (v) {
|
|
102
|
-
return v.children.length > 0;
|
|
103
|
-
});
|
|
104
|
-
setDatasourceTable(_new);
|
|
242
|
+
setTableFilterValue(val);
|
|
243
|
+
setDatasourceTable(filterDatasourceTables(originDatasourceTable, val));
|
|
105
244
|
}
|
|
106
245
|
function goPrevPage() {
|
|
107
246
|
setVal({
|
|
108
247
|
datasourceId: '',
|
|
109
248
|
datasourceName: '',
|
|
249
|
+
datasourceType: '',
|
|
110
250
|
name: '',
|
|
111
251
|
name_zh: '',
|
|
112
252
|
tableUuid: '',
|
|
@@ -142,14 +282,20 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
142
282
|
})
|
|
143
283
|
}), datasourceTable.map(function (table) {
|
|
144
284
|
var _table$children;
|
|
285
|
+
var datasourceType = table.datasourceType || getDefaultDatasourceType(table);
|
|
145
286
|
return _jsxs(React.Fragment, {
|
|
146
|
-
children: [
|
|
287
|
+
children: [_jsxs("div", {
|
|
147
288
|
className: cx("Sqb-List-title mx-4 pb-2 pt-2"),
|
|
148
|
-
children:
|
|
289
|
+
children: [_jsx("span", {
|
|
290
|
+
children: table.datasourceName
|
|
291
|
+
}), renderDatasourceTypeSelector(table, datasourceType, function (type) {
|
|
292
|
+
return handleFlatDatasourceTypeChange(table, type);
|
|
293
|
+
})]
|
|
149
294
|
}), Array.isArray(table.children) && (table === null || table === void 0 || (_table$children = table.children) === null || _table$children === void 0 ? void 0 : _table$children.map(function (v) {
|
|
150
295
|
var _val = {
|
|
151
296
|
datasourceId: table.datasourceId,
|
|
152
297
|
datasourceName: table.datasourceName,
|
|
298
|
+
datasourceType: datasourceType,
|
|
153
299
|
name: '',
|
|
154
300
|
name_zh: '',
|
|
155
301
|
id: '',
|
|
@@ -160,10 +306,12 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
160
306
|
className: cx("Sqb-List-section"),
|
|
161
307
|
children: _jsx("div", {
|
|
162
308
|
className: cx("Sqb-List-item mx-2", {
|
|
163
|
-
active:
|
|
309
|
+
active: val.datasourceId === table.datasourceId && val.name === v.name && (val.datasourceType || datasourceType) === datasourceType
|
|
164
310
|
}),
|
|
165
311
|
onClick: function onClick() {
|
|
166
|
-
onChange(_objectSpread(_objectSpread({}, _val), v)
|
|
312
|
+
onChange(_objectSpread(_objectSpread(_objectSpread({}, _val), v), {}, {
|
|
313
|
+
datasourceType: datasourceType
|
|
314
|
+
}));
|
|
167
315
|
},
|
|
168
316
|
children: _jsxs("a", {
|
|
169
317
|
className: 'p-2',
|
|
@@ -178,9 +326,9 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
178
326
|
})]
|
|
179
327
|
})
|
|
180
328
|
})
|
|
181
|
-
}, v.name);
|
|
329
|
+
}, "".concat(datasourceType, "_").concat(v.name));
|
|
182
330
|
}))]
|
|
183
|
-
}, table.datasourceId);
|
|
331
|
+
}, "".concat(table.datasourceId, "_").concat(datasourceType));
|
|
184
332
|
})]
|
|
185
333
|
})
|
|
186
334
|
})
|
|
@@ -206,16 +354,7 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
206
354
|
active: val.datasourceId === v.datasourceId
|
|
207
355
|
}),
|
|
208
356
|
onClick: function onClick() {
|
|
209
|
-
|
|
210
|
-
datasourceId: v.datasourceId,
|
|
211
|
-
datasourceName: v.datasourceName,
|
|
212
|
-
name: '',
|
|
213
|
-
name_zh: '',
|
|
214
|
-
id: '',
|
|
215
|
-
tableUuid: uuidv4('table'),
|
|
216
|
-
alias: ''
|
|
217
|
-
});
|
|
218
|
-
getTables(v.datasourceId);
|
|
357
|
+
handleSelectDatasource(v);
|
|
219
358
|
},
|
|
220
359
|
children: _jsxs("a", {
|
|
221
360
|
className: 'p-2',
|
|
@@ -236,6 +375,8 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
236
375
|
})
|
|
237
376
|
});
|
|
238
377
|
}
|
|
378
|
+
var selectedDatasource = getDatasource(val.datasourceId) || val;
|
|
379
|
+
var datasourceType = val.datasourceType || getDefaultDatasourceType(selectedDatasource);
|
|
239
380
|
return _jsx("div", {
|
|
240
381
|
className: cx("Sqb-SelectTable--box pb-2"),
|
|
241
382
|
children: _jsx("div", {
|
|
@@ -248,12 +389,14 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
248
389
|
},
|
|
249
390
|
children: [_jsx("div", {
|
|
250
391
|
className: 'header',
|
|
251
|
-
children:
|
|
392
|
+
children: _jsxs("div", {
|
|
252
393
|
className: 'left-info',
|
|
253
|
-
children: _jsxs("span", {
|
|
394
|
+
children: [_jsxs("span", {
|
|
254
395
|
onClick: goPrevPage,
|
|
255
396
|
children: [_jsx(LeftArrowIcon, {}), val.datasourceName]
|
|
256
|
-
})
|
|
397
|
+
}), renderDatasourceTypeSelector(selectedDatasource, datasourceType, function (type) {
|
|
398
|
+
return handleDatasourceTypeChange(type);
|
|
399
|
+
})]
|
|
257
400
|
})
|
|
258
401
|
}), loading ? _jsx("div", {
|
|
259
402
|
className: 'Sqb-SelectTable-loading',
|
|
@@ -282,10 +425,12 @@ var SelectTable = function SelectTable(_ref) {
|
|
|
282
425
|
className: cx("Sqb-List-section"),
|
|
283
426
|
children: _jsx("div", {
|
|
284
427
|
className: cx("Sqb-List-item mx-2", {
|
|
285
|
-
active: value.name === v.name
|
|
428
|
+
active: val.datasourceId === value.datasourceId && val.name === v.name && (val.datasourceType || datasourceType) === datasourceType
|
|
286
429
|
}),
|
|
287
430
|
onClick: function onClick() {
|
|
288
|
-
onChange(_objectSpread(_objectSpread({}, val), v)
|
|
431
|
+
onChange(_objectSpread(_objectSpread(_objectSpread({}, val), v), {}, {
|
|
432
|
+
datasourceType: datasourceType
|
|
433
|
+
}));
|
|
289
434
|
},
|
|
290
435
|
children: _jsxs("a", {
|
|
291
436
|
className: 'p-2',
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
color: #4c5773;
|
|
29
29
|
margin-top: 0;
|
|
30
30
|
margin-bottom: 0;
|
|
31
|
-
font-size:
|
|
31
|
+
font-size: 13px;
|
|
32
32
|
font-weight: 600;
|
|
33
33
|
}
|
|
34
34
|
&:not(.disabled):hover,
|
|
@@ -64,10 +64,16 @@
|
|
|
64
64
|
color: #949aab;
|
|
65
65
|
border-bottom: 1px solid #f0f0f0;
|
|
66
66
|
.left-info {
|
|
67
|
+
flex: 1;
|
|
67
68
|
padding: 0.5rem 0.5rem 0.5rem 0;
|
|
68
69
|
display: flex;
|
|
69
70
|
align-items: center;
|
|
70
|
-
|
|
71
|
+
flex-wrap: wrap;
|
|
72
|
+
gap: 0.5rem;
|
|
73
|
+
.Sqb-DatasourceType-radio {
|
|
74
|
+
margin-left: auto;
|
|
75
|
+
}
|
|
76
|
+
> span {
|
|
71
77
|
font-weight: 900;
|
|
72
78
|
font-size: 16px;
|
|
73
79
|
color: #4c5773;
|
|
@@ -95,6 +101,13 @@
|
|
|
95
101
|
.Sqb-List-section {
|
|
96
102
|
}
|
|
97
103
|
|
|
104
|
+
.Sqb-List-title {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
gap: 0.75rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
98
111
|
.Sqb-List-item {
|
|
99
112
|
display: flex;
|
|
100
113
|
border-radius: 4px;
|
|
@@ -167,3 +180,33 @@
|
|
|
167
180
|
}
|
|
168
181
|
}
|
|
169
182
|
}
|
|
183
|
+
|
|
184
|
+
.Sqb-DatasourceType-radio {
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
flex-wrap: wrap;
|
|
188
|
+
gap: 0.375rem;
|
|
189
|
+
justify-content: flex-end;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.Sqb-DatasourceType-radio-item {
|
|
193
|
+
display: inline-flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
gap: 2px;
|
|
196
|
+
color: #4c5773;
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
font-size: 13px !important;
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
line-height: 1.2;
|
|
201
|
+
|
|
202
|
+
span {
|
|
203
|
+
font-size: 13px !important;
|
|
204
|
+
line-height: 15px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
input {
|
|
208
|
+
margin: 0;
|
|
209
|
+
width: 13px;
|
|
210
|
+
height: 13px;
|
|
211
|
+
}
|
|
212
|
+
}
|