@finos/legend-query-builder 4.11.4 → 4.11.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/lib/components/QueryBuilder.js +1 -1
  2. package/lib/components/QueryBuilder.js.map +1 -1
  3. package/lib/components/execution-plan/SQLExecutionNodeViewer.js +1 -1
  4. package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
  5. package/lib/components/{QueryBuilderResultPanel.d.ts → result/QueryBuilderResultPanel.d.ts} +1 -2
  6. package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -0
  7. package/lib/components/result/QueryBuilderResultPanel.js +185 -0
  8. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -0
  9. package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts +24 -0
  10. package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -0
  11. package/lib/components/result/tds/QueryBuilderTDSGridResult.js +140 -0
  12. package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -0
  13. package/lib/components/result/tds/QueryBuilderTDSResultShared.d.ts +41 -0
  14. package/lib/components/result/tds/QueryBuilderTDSResultShared.d.ts.map +1 -0
  15. package/lib/components/result/tds/QueryBuilderTDSResultShared.js +465 -0
  16. package/lib/components/result/tds/QueryBuilderTDSResultShared.js.map +1 -0
  17. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts +24 -0
  18. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts.map +1 -0
  19. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +47 -0
  20. package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -0
  21. package/lib/index.css +2 -2
  22. package/lib/index.css.map +1 -1
  23. package/lib/package.json +1 -1
  24. package/lib/stores/QueryBuilderResultState.d.ts +5 -1
  25. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  26. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  27. package/package.json +2 -2
  28. package/src/components/QueryBuilder.tsx +1 -1
  29. package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +1 -1
  30. package/src/components/result/QueryBuilderResultPanel.tsx +570 -0
  31. package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +239 -0
  32. package/src/components/result/tds/QueryBuilderTDSResultShared.tsx +866 -0
  33. package/src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx +80 -0
  34. package/src/stores/QueryBuilderResultState.ts +12 -1
  35. package/tsconfig.json +4 -1
  36. package/lib/components/QueryBuilderResultPanel.d.ts.map +0 -1
  37. package/lib/components/QueryBuilderResultPanel.js +0 -633
  38. package/lib/components/QueryBuilderResultPanel.js.map +0 -1
  39. package/src/components/QueryBuilderResultPanel.tsx +0 -1412
@@ -0,0 +1,465 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2020-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { MenuContent, MenuContentItem, ContextMenu, clsx, MenuContentDivider, } from '@finos/legend-art';
18
+ import { observer } from 'mobx-react-lite';
19
+ import { flowResult } from 'mobx';
20
+ import { InstanceValue, TDSExecutionResult, EnumValueInstanceValue, EnumValueExplicitReference, getTDSRowRankByColumnInAsc, PRIMITIVE_TYPE, RelationalExecutionActivities, } from '@finos/legend-graph';
21
+ import { format as formatSQL } from 'sql-formatter';
22
+ import { useApplicationStore } from '@finos/legend-application';
23
+ import { assertErrorThrown, guaranteeNonNullable, isValidURL, isString, isNumber, filterByType, isBoolean, } from '@finos/legend-shared';
24
+ import { forwardRef } from 'react';
25
+ import { QueryBuilderDerivationProjectionColumnState, QueryBuilderProjectionColumnState, } from '../../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
26
+ import { PostFilterConditionState, QueryBuilderPostFilterTreeConditionNodeData, PostFilterValueSpecConditionValueState, } from '../../../stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js';
27
+ import { QueryBuilderPostFilterOperator_Equal, QueryBuilderPostFilterOperator_NotEqual, } from '../../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js';
28
+ import { QueryBuilderPostFilterOperator_In, QueryBuilderPostFilterOperator_NotIn, } from '../../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js';
29
+ import { QueryBuilderTDSState } from '../../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
30
+ import { instanceValue_setValue, instanceValue_setValues, } from '../../../stores/shared/ValueSpecificationModifierHelper.js';
31
+ import { isEnterpriseModeEnabled, } from '@finos/legend-lego/data-grid';
32
+ import { QueryBuilderPostFilterOperator_IsEmpty, QueryBuilderPostFilterOperator_IsNotEmpty, } from '../../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js';
33
+ import { DEFAULT_LOCALE } from '../../../graph-manager/QueryBuilderConst.js';
34
+ export const tryToFormatSql = (sql) => {
35
+ try {
36
+ const formattedSql = formatSQL(sql, { language: 'mysql' });
37
+ return formattedSql;
38
+ }
39
+ catch {
40
+ try {
41
+ const formattedSql = formatSQL(sql);
42
+ return formattedSql;
43
+ }
44
+ catch {
45
+ return sql;
46
+ }
47
+ }
48
+ };
49
+ export const getExecutedSqlFromExecutionResult = (execResult) => {
50
+ const executedSqls = execResult.activities
51
+ ?.filter(filterByType(RelationalExecutionActivities))
52
+ .map((relationalActivity) => relationalActivity.sql);
53
+ if (executedSqls?.length) {
54
+ let executedSql = '';
55
+ if (executedSqls.length > 1) {
56
+ for (let i = 0; i < executedSqls.length; i++) {
57
+ executedSql += `\n--QUERY #${i + 1}\n`;
58
+ executedSql += `${executedSqls[i]}\n`;
59
+ }
60
+ }
61
+ else {
62
+ executedSql += executedSqls[0];
63
+ }
64
+ return executedSql;
65
+ }
66
+ return undefined;
67
+ };
68
+ export const getAggregationTDSColumnCustomizations = (result, columnName) => {
69
+ const columnType = result.builder.columns.find((col) => col.name === columnName)?.type;
70
+ switch (columnType) {
71
+ case PRIMITIVE_TYPE.STRING:
72
+ return {
73
+ filter: 'agTextColumnFilter',
74
+ allowedAggFuncs: ['count'],
75
+ };
76
+ case PRIMITIVE_TYPE.DATE:
77
+ case PRIMITIVE_TYPE.DATETIME:
78
+ case PRIMITIVE_TYPE.STRICTDATE:
79
+ return {
80
+ filter: 'agDateColumnFilter',
81
+ allowedAggFuncs: ['count'],
82
+ };
83
+ case PRIMITIVE_TYPE.DECIMAL:
84
+ case PRIMITIVE_TYPE.INTEGER:
85
+ case PRIMITIVE_TYPE.FLOAT:
86
+ return {
87
+ filter: 'agNumberColumnFilter',
88
+ allowedAggFuncs: ['count', 'sum', 'max', 'min', 'avg'],
89
+ };
90
+ default:
91
+ return {
92
+ allowedAggFuncs: ['count'],
93
+ };
94
+ }
95
+ };
96
+ export const getRowDataFromExecutionResult = (executionResult) => {
97
+ const rowData = executionResult.result.rows.map((_row, rowIdx) => {
98
+ const row = {};
99
+ const cols = executionResult.result.columns;
100
+ _row.values.forEach((value, colIdx) => {
101
+ // `ag-grid` shows `false` value as empty string so we have
102
+ // call `.toString()` to avoid this behavior.
103
+ // See https://github.com/finos/legend-studio/issues/1008
104
+ row[cols[colIdx]] = isBoolean(value) ? String(value) : value;
105
+ });
106
+ row.rowNumber = rowIdx;
107
+ return row;
108
+ });
109
+ return rowData;
110
+ };
111
+ export const QueryBuilderGridResultContextMenu = observer(forwardRef(function QueryBuilderResultContextMenu(props, ref) {
112
+ const { data, tdsState, dataGridApi } = props;
113
+ const applicationStore = useApplicationStore();
114
+ const postFilterEqualOperator = new QueryBuilderPostFilterOperator_Equal();
115
+ const postFilterInOperator = new QueryBuilderPostFilterOperator_In();
116
+ const postFilterEmptyOperator = new QueryBuilderPostFilterOperator_IsEmpty();
117
+ const postFilterNotEmptyOperator = new QueryBuilderPostFilterOperator_IsNotEmpty();
118
+ const postFilterNotEqualOperator = new QueryBuilderPostFilterOperator_NotEqual();
119
+ const postFilterNotInOperator = new QueryBuilderPostFilterOperator_NotIn();
120
+ const postFilterState = tdsState.postFilterState;
121
+ const projectionColumnState = tdsState.projectionColumns
122
+ .filter((c) => c.columnName === data?.columnName)
123
+ .concat(tdsState.aggregationState.columns
124
+ .filter((c) => c.columnName === data?.columnName)
125
+ .map((ag) => ag.projectionColumnState))[0];
126
+ const getExistingPostFilterNode = (operators, projectionColumnName) => Array.from(postFilterState.nodes.values())
127
+ .filter((v) => v instanceof QueryBuilderPostFilterTreeConditionNodeData &&
128
+ v.condition.leftConditionValue instanceof
129
+ QueryBuilderProjectionColumnState)
130
+ .filter((n) => n.condition
131
+ .leftConditionValue.columnName ===
132
+ (projectionColumnName ?? projectionColumnState?.columnName) &&
133
+ operators
134
+ .map((op) => op.getLabel())
135
+ .includes(n.condition.operator.getLabel()))[0];
136
+ const updateFilterConditionValue = (conditionValue, cellData) => {
137
+ if (cellData.value) {
138
+ instanceValue_setValue(conditionValue, conditionValue instanceof EnumValueInstanceValue
139
+ ? EnumValueExplicitReference.create(guaranteeNonNullable((conditionValue.genericType?.ownerReference
140
+ .value).values.filter((v) => v.name === cellData.value)[0]))
141
+ : cellData.value, 0, tdsState.queryBuilderState.observerContext);
142
+ }
143
+ };
144
+ const generateNewPostFilterConditionNodeData = async (operator, cellData) => {
145
+ let postFilterConditionState;
146
+ try {
147
+ const possibleProjectionColumnState = cellData.columnName
148
+ ? tdsState.projectionColumns
149
+ .filter((c) => c.columnName === cellData.columnName)
150
+ .concat(tdsState.aggregationState.columns
151
+ .filter((c) => c.columnName === cellData.columnName)
152
+ .map((ag) => ag.projectionColumnState))[0]
153
+ : projectionColumnState;
154
+ if (possibleProjectionColumnState) {
155
+ postFilterConditionState = new PostFilterConditionState(postFilterState, possibleProjectionColumnState, operator);
156
+ if (projectionColumnState instanceof
157
+ QueryBuilderDerivationProjectionColumnState) {
158
+ await flowResult(projectionColumnState.fetchDerivationLambdaReturnType());
159
+ }
160
+ const defaultFilterConditionValue = postFilterConditionState.operator.getDefaultFilterConditionValue(postFilterConditionState);
161
+ postFilterConditionState.buildFromValueSpec(defaultFilterConditionValue);
162
+ updateFilterConditionValue(defaultFilterConditionValue, cellData);
163
+ postFilterState.addNodeFromNode(new QueryBuilderPostFilterTreeConditionNodeData(undefined, postFilterConditionState), undefined);
164
+ }
165
+ }
166
+ catch (error) {
167
+ assertErrorThrown(error);
168
+ applicationStore.notificationService.notifyWarning(error.message);
169
+ return;
170
+ }
171
+ };
172
+ const updateExistingPostFilterConditionNodeData = (existingPostFilterNode, isFilterBy, cellData, operator) => {
173
+ if (operator === postFilterEmptyOperator ||
174
+ operator === postFilterNotEmptyOperator) {
175
+ const conditionState = existingPostFilterNode.condition;
176
+ if (conditionState.operator.getLabel() !== operator.getLabel()) {
177
+ conditionState.changeOperator(isFilterBy ? postFilterEmptyOperator : postFilterNotEmptyOperator);
178
+ }
179
+ return;
180
+ }
181
+ const conditionState = existingPostFilterNode.condition;
182
+ const rightSide = conditionState.rightConditionValue;
183
+ if (rightSide instanceof PostFilterValueSpecConditionValueState) {
184
+ if (conditionState.operator.getLabel() === operator.getLabel()) {
185
+ const doesValueAlreadyExist = rightSide.value instanceof InstanceValue &&
186
+ (rightSide.value instanceof EnumValueInstanceValue
187
+ ? rightSide.value.values.map((ef) => ef.value.name)
188
+ : rightSide.value.values).includes(cellData.value);
189
+ if (!doesValueAlreadyExist) {
190
+ const currentValueSpecificaton = rightSide.value;
191
+ const newValueSpecification = conditionState.operator.getDefaultFilterConditionValue(conditionState);
192
+ updateFilterConditionValue(newValueSpecification, cellData);
193
+ conditionState.changeOperator(isFilterBy ? postFilterInOperator : postFilterNotInOperator);
194
+ instanceValue_setValues(rightSide.value, [currentValueSpecificaton, newValueSpecification], tdsState.queryBuilderState.observerContext);
195
+ }
196
+ }
197
+ else {
198
+ const doesValueAlreadyExist = rightSide.value instanceof InstanceValue &&
199
+ rightSide.value.values
200
+ .filter((v) => v instanceof InstanceValue)
201
+ .map((v) => v instanceof EnumValueInstanceValue
202
+ ? v.values.map((ef) => ef.value.name)
203
+ : v.values)
204
+ .flat()
205
+ .includes(cellData.value ?? data?.value);
206
+ if (!doesValueAlreadyExist) {
207
+ const newValueSpecification = (isFilterBy ? postFilterEqualOperator : postFilterNotEqualOperator).getDefaultFilterConditionValue(conditionState);
208
+ updateFilterConditionValue(newValueSpecification, cellData);
209
+ instanceValue_setValues(rightSide.value, [
210
+ ...rightSide.value.values,
211
+ newValueSpecification,
212
+ ], tdsState.queryBuilderState.observerContext);
213
+ }
214
+ }
215
+ }
216
+ };
217
+ const getFilterOperator = (isFilterBy, cellData) => {
218
+ if (isFilterBy === true) {
219
+ if (cellData.value === null) {
220
+ return postFilterEmptyOperator;
221
+ }
222
+ else {
223
+ return postFilterEqualOperator;
224
+ }
225
+ }
226
+ else {
227
+ if (cellData.value === null) {
228
+ return postFilterNotEmptyOperator;
229
+ }
230
+ else {
231
+ return postFilterNotEqualOperator;
232
+ }
233
+ }
234
+ };
235
+ const filterByOrOutValue = (isFilterBy, cellData) => {
236
+ tdsState.setShowPostFilterPanel(true);
237
+ const operator = getFilterOperator(isFilterBy, cellData);
238
+ const existingPostFilterNode = getExistingPostFilterNode(cellData.value === null
239
+ ? [postFilterEmptyOperator, postFilterNotEmptyOperator]
240
+ : isFilterBy
241
+ ? [postFilterEqualOperator, postFilterInOperator]
242
+ : [postFilterNotEqualOperator, postFilterNotInOperator], cellData.columnName);
243
+ existingPostFilterNode === undefined
244
+ ? generateNewPostFilterConditionNodeData(operator, cellData).catch(applicationStore.alertUnhandledError)
245
+ : updateExistingPostFilterConditionNodeData(existingPostFilterNode, isFilterBy, cellData, operator);
246
+ };
247
+ const filterByOrOutValues = (isFilterBy) => {
248
+ tdsState.queryBuilderState.resultState.selectedCells.forEach((cellData) => {
249
+ filterByOrOutValue(isFilterBy, cellData);
250
+ });
251
+ };
252
+ const handleCopyCellValue = isEnterpriseModeEnabled
253
+ ? () => {
254
+ dataGridApi.copySelectedRangeToClipboard();
255
+ }
256
+ : applicationStore.guardUnhandledError(() => applicationStore.clipboardService.copyTextToClipboard(tdsState.queryBuilderState.resultState.selectedCells
257
+ .map((cellData) => cellData.value)
258
+ .join(',')));
259
+ const findRowFromRowIndex = (rowIndex) => {
260
+ if (!tdsState.queryBuilderState.resultState.executionResult ||
261
+ !(tdsState.queryBuilderState.resultState.executionResult instanceof
262
+ TDSExecutionResult)) {
263
+ return '';
264
+ }
265
+ // try to get the entire row value separated by comma
266
+ // rowData is in format of {columnName: value, columnName1: value, ...., rowNumber:value}
267
+ const valueArr = [];
268
+ Object.entries(dataGridApi.getRenderedNodes().find((n) => n.rowIndex === rowIndex)
269
+ ?.data).forEach((entry) => {
270
+ if (entry[0] !== 'rowNumber') {
271
+ valueArr.push(entry[1]);
272
+ }
273
+ });
274
+ return valueArr.join(',');
275
+ };
276
+ const handleCopyRowValue = isEnterpriseModeEnabled
277
+ ? () => {
278
+ dataGridApi.copySelectedRowsToClipboard();
279
+ }
280
+ : applicationStore.guardUnhandledError(() => applicationStore.clipboardService.copyTextToClipboard(findRowFromRowIndex(tdsState.queryBuilderState.resultState.selectedCells[0]
281
+ ?.coordinates.rowIndex ?? 0)));
282
+ return (_jsxs(MenuContent, { ref: ref, children: [_jsx(MenuContentItem, { disabled: !projectionColumnState, onClick: () => {
283
+ filterByOrOutValues(true);
284
+ }, children: "Filter By" }), _jsx(MenuContentItem, { disabled: !projectionColumnState, onClick: () => {
285
+ filterByOrOutValues(false);
286
+ }, children: "Filter Out" }), _jsx(MenuContentDivider, {}), _jsx(MenuContentItem, { onClick: handleCopyCellValue, children: "Copy Cell Value" }), _jsx(MenuContentItem, { onClick: handleCopyRowValue, children: "Copy Row Value" })] }));
287
+ }));
288
+ export const QueryResultEnterpriseCellRenderer = observer((params) => {
289
+ const resultState = params.resultState;
290
+ const fetchStructureImplementation = resultState.queryBuilderState.fetchStructureState.implementation;
291
+ const cellValue = params.value;
292
+ const formattedCellValue = () => {
293
+ if (isNumber(cellValue)) {
294
+ return Intl.NumberFormat(DEFAULT_LOCALE, {
295
+ maximumFractionDigits: 4,
296
+ }).format(Number(cellValue));
297
+ }
298
+ return cellValue;
299
+ };
300
+ const cellValueUrlLink = isString(cellValue) && isValidURL(cellValue) ? cellValue : undefined;
301
+ const mouseDown = (event) => {
302
+ event.preventDefault();
303
+ if (event.button === 0 || event.button === 2) {
304
+ resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
305
+ }
306
+ };
307
+ const mouseUp = (event) => {
308
+ resultState.setIsSelectingCells(false);
309
+ };
310
+ const mouseOver = (event) => {
311
+ resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
312
+ };
313
+ return (_jsx(ContextMenu, { content:
314
+ // NOTE: we only support this functionality for grid result with a projection fetch-structure
315
+ fetchStructureImplementation instanceof QueryBuilderTDSState ? (_jsx(QueryBuilderGridResultContextMenu, { data: resultState.mousedOverCell, tdsState: fetchStructureImplementation, dataGridApi: params.api })) : null, disabled: !(resultState.queryBuilderState.fetchStructureState
316
+ .implementation instanceof QueryBuilderTDSState) ||
317
+ !resultState.queryBuilderState.isQuerySupported ||
318
+ !resultState.mousedOverCell, menuProps: { elevation: 7 }, className: clsx('ag-theme-balham-dark query-builder__result__tds-grid'), children: _jsx("div", { className: clsx('query-builder__result__values__table__cell'), onMouseDown: (event) => mouseDown(event), onMouseUp: (event) => mouseUp(event), onMouseOver: (event) => mouseOver(event), children: cellValueUrlLink ? (_jsx("a", { href: cellValueUrlLink, target: "_blank", rel: "noreferrer", children: cellValueUrlLink })) : (_jsx("span", { children: formattedCellValue() })) }) }));
319
+ });
320
+ export const QueryResultCellRenderer = observer((params) => {
321
+ const resultState = params.resultState;
322
+ const tdsExecutionResult = params.tdsExecutionResult;
323
+ const fetchStructureImplementation = resultState.queryBuilderState.fetchStructureState.implementation;
324
+ const cellValue = params.value;
325
+ const formattedCellValue = () => {
326
+ if (isNumber(cellValue)) {
327
+ return Intl.NumberFormat(DEFAULT_LOCALE, {
328
+ maximumFractionDigits: 4,
329
+ }).format(Number(cellValue));
330
+ }
331
+ return cellValue;
332
+ };
333
+ const cellValueUrlLink = isString(cellValue) && isValidURL(cellValue) ? cellValue : undefined;
334
+ const columnName = params.column?.getColId() ?? '';
335
+ const findCoordinatesFromResultValue = (colId, rowNumber) => {
336
+ const colIndex = tdsExecutionResult.result.columns.findIndex((col) => col === colId);
337
+ return { rowIndex: rowNumber, colIndex: colIndex };
338
+ };
339
+ const currentCellCoordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
340
+ const cellInFilteredResults = resultState.selectedCells.some((result) => result.coordinates.colIndex === currentCellCoordinates.colIndex &&
341
+ result.coordinates.rowIndex === currentCellCoordinates.rowIndex);
342
+ const findColumnFromCoordinates = (colIndex) => {
343
+ if (!resultState.executionResult ||
344
+ !(resultState.executionResult instanceof TDSExecutionResult)) {
345
+ return undefined;
346
+ }
347
+ return resultState.executionResult.result.columns[colIndex];
348
+ };
349
+ const findResultValueFromCoordinates = (resultCoordinate) => {
350
+ const rowIndex = resultCoordinate[0];
351
+ const colIndex = resultCoordinate[1];
352
+ if (!resultState.executionResult ||
353
+ !(resultState.executionResult instanceof TDSExecutionResult)) {
354
+ return undefined;
355
+ }
356
+ if (params.columnApi.getColumnState()[colIndex]?.sort === 'asc') {
357
+ resultState.executionResult.result.rows.sort((a, b) => getTDSRowRankByColumnInAsc(a, b, colIndex));
358
+ }
359
+ else if (params.columnApi.getColumnState()[colIndex]?.sort === 'desc') {
360
+ resultState.executionResult.result.rows.sort((a, b) => getTDSRowRankByColumnInAsc(b, a, colIndex));
361
+ }
362
+ return resultState.executionResult.result.rows[rowIndex]?.values[colIndex];
363
+ };
364
+ const isCoordinatesSelected = (resultCoordinate) => resultState.selectedCells.some((cell) => cell.coordinates.rowIndex === resultCoordinate.rowIndex &&
365
+ cell.coordinates.colIndex === resultCoordinate.colIndex);
366
+ const mouseDown = (event) => {
367
+ event.preventDefault();
368
+ if (event.shiftKey) {
369
+ const coordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
370
+ const actualValue = findResultValueFromCoordinates([
371
+ coordinates.rowIndex,
372
+ coordinates.colIndex,
373
+ ]);
374
+ resultState.addSelectedCell({
375
+ value: actualValue,
376
+ columnName: columnName,
377
+ coordinates: coordinates,
378
+ });
379
+ return;
380
+ }
381
+ if (event.button === 0) {
382
+ resultState.setIsSelectingCells(true);
383
+ resultState.setSelectedCells([]);
384
+ const coordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
385
+ const actualValue = findResultValueFromCoordinates([
386
+ coordinates.rowIndex,
387
+ coordinates.colIndex,
388
+ ]);
389
+ resultState.setSelectedCells([
390
+ {
391
+ value: actualValue,
392
+ columnName: columnName,
393
+ coordinates: coordinates,
394
+ },
395
+ ]);
396
+ resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
397
+ }
398
+ if (event.button === 2) {
399
+ const coordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
400
+ const isInSelected = isCoordinatesSelected(coordinates);
401
+ if (!isInSelected) {
402
+ const actualValue = findResultValueFromCoordinates([
403
+ coordinates.rowIndex,
404
+ coordinates.colIndex,
405
+ ]);
406
+ resultState.setSelectedCells([
407
+ {
408
+ value: actualValue,
409
+ columnName: columnName,
410
+ coordinates: coordinates,
411
+ },
412
+ ]);
413
+ resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
414
+ }
415
+ }
416
+ };
417
+ const mouseUp = (event) => {
418
+ resultState.setIsSelectingCells(false);
419
+ };
420
+ const mouseOver = (event) => {
421
+ if (resultState.isSelectingCells) {
422
+ if (resultState.selectedCells.length < 1) {
423
+ return;
424
+ }
425
+ const results = resultState.selectedCells[0];
426
+ if (!results) {
427
+ return;
428
+ }
429
+ const firstCorner = results.coordinates;
430
+ const secondCorner = findCoordinatesFromResultValue(columnName, params.rowIndex);
431
+ resultState.setSelectedCells([results]);
432
+ const minRow = Math.min(firstCorner.rowIndex, secondCorner.rowIndex);
433
+ const minCol = Math.min(firstCorner.colIndex, secondCorner.colIndex);
434
+ const maxRow = Math.max(firstCorner.rowIndex, secondCorner.rowIndex);
435
+ const maxCol = Math.max(firstCorner.colIndex, secondCorner.colIndex);
436
+ for (let x = minRow; x <= maxRow; x++) {
437
+ for (let y = minCol; y <= maxCol; y++) {
438
+ const actualValue = findResultValueFromCoordinates([x, y]);
439
+ const valueAndColumnId = {
440
+ value: actualValue,
441
+ columnName: findColumnFromCoordinates(y),
442
+ coordinates: {
443
+ rowIndex: x,
444
+ colIndex: y,
445
+ },
446
+ };
447
+ if (!resultState.selectedCells.find((result) => result.coordinates.colIndex === y &&
448
+ result.coordinates.rowIndex === x)) {
449
+ resultState.addSelectedCell(valueAndColumnId);
450
+ }
451
+ }
452
+ }
453
+ }
454
+ resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
455
+ };
456
+ return (_jsx(ContextMenu, { content:
457
+ // NOTE: we only support this functionality for grid result with a projection fetch-structure
458
+ fetchStructureImplementation instanceof QueryBuilderTDSState ? (_jsx(QueryBuilderGridResultContextMenu, { data: resultState.mousedOverCell, tdsState: fetchStructureImplementation, dataGridApi: params.api })) : null, disabled: !(resultState.queryBuilderState.fetchStructureState
459
+ .implementation instanceof QueryBuilderTDSState) ||
460
+ !resultState.queryBuilderState.isQuerySupported ||
461
+ !resultState.mousedOverCell, menuProps: { elevation: 7 }, className: clsx('ag-theme-balham-dark query-builder__result__tds-grid'), children: _jsx("div", { className: clsx('query-builder__result__values__table__cell', {
462
+ 'query-builder__result__values__table__cell--active': cellInFilteredResults,
463
+ }), onMouseDown: (event) => mouseDown(event), onMouseUp: (event) => mouseUp(event), onMouseOver: (event) => mouseOver(event), children: cellValueUrlLink ? (_jsx("a", { href: cellValueUrlLink, target: "_blank", rel: "noreferrer", children: cellValueUrlLink })) : (_jsx("span", { children: formattedCellValue() })) }) }));
464
+ });
465
+ //# sourceMappingURL=QueryBuilderTDSResultShared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderTDSResultShared.js","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSResultShared.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,IAAI,EACJ,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAEL,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,cAAc,EAEd,6BAA6B,GAC9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,GAEV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EACL,2CAA2C,EAC3C,iCAAiC,GAClC,MAAM,qFAAqF,CAAC;AAC7F,OAAO,EAEL,wBAAwB,EACxB,2CAA2C,EAC3C,sCAAsC,GACvC,MAAM,gFAAgF,CAAC;AACxF,OAAO,EACL,oCAAoC,EACpC,uCAAuC,GACxC,MAAM,mGAAmG,CAAC;AAC3G,OAAO,EACL,iCAAiC,EACjC,oCAAoC,GACrC,MAAM,gGAAgG,CAAC;AAExG,OAAO,EAAE,o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,EAAE,MAAM,CAAC,GAAG,GACvB,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,QAAQ,EACN,CAAC,CACC,WAAW,CAAC,iBAAiB,CAAC,mBAAmB;aAC9C,cAAc,YAAY,oBAAoB,CAClD;YACD,CAAC,WAAW,CAAC,iBAAiB,CAAC,gBAAgB;YAC/C,CAAC,WAAW,CAAC,cAAc,EAE7B,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,EAC3B,SAAS,EAAE,IAAI,CAAC,sDAAsD,CAAC,YAEvE,cACE,SAAS,EAAE,IAAI,CAAC,4CAA4C,EAAE;gBAC5D,oDAAoD,EAClD,qBAAqB;aACxB,CAAC,EACF,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,EACxC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACpC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,YAEvC,gBAAgB,CAAC,CAAC,CAAC,CAClB,YAAG,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,YACxD,gBAAgB,GACf,CACL,CAAC,CAAC,CAAC,CACF,yBAAO,kBAAkB,EAAE,GAAQ,CACpC,GACG,GACM,CACf,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { QueryBuilderState } from '../../../stores/QueryBuilderState.js';
17
+ import type { TDSExecutionResult } from '@finos/legend-graph';
18
+ export declare const QueryBuilderTDSSimpleGridResult: ((props: {
19
+ executionResult: TDSExecutionResult;
20
+ queryBuilderState: QueryBuilderState;
21
+ }) => import("react/jsx-runtime").JSX.Element) & {
22
+ displayName: string;
23
+ };
24
+ //# sourceMappingURL=QueryBuilderTDSSimpleGridResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderTDSSimpleGridResult.d.ts","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAU9D,eAAO,MAAM,+BAA+B,WAClC;IACN,eAAe,EAAE,kBAAkB,CAAC;IACpC,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;;CA8CF,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2020-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { clsx } from '@finos/legend-art';
18
+ import { observer } from 'mobx-react-lite';
19
+ import { DataGrid, } from '@finos/legend-lego/data-grid';
20
+ import { getRowDataFromExecutionResult, QueryResultCellRenderer, } from './QueryBuilderTDSResultShared.js';
21
+ export const QueryBuilderTDSSimpleGridResult = observer((props) => {
22
+ const { executionResult, queryBuilderState } = props;
23
+ const resultState = queryBuilderState.resultState;
24
+ const colDefs = executionResult.result.columns.map((colName) => ({
25
+ minWidth: 50,
26
+ sortable: true,
27
+ resizable: true,
28
+ field: colName,
29
+ flex: 1,
30
+ cellRenderer: QueryResultCellRenderer,
31
+ cellRendererParams: {
32
+ resultState: resultState,
33
+ tdsExecutionResult: executionResult,
34
+ },
35
+ }));
36
+ return (_jsx("div", { className: "query-builder__result__values__table", children: _jsx("div", { className: clsx('ag-theme-balham-dark query-builder__result__tds-grid'), children: _jsx(DataGrid, { rowData: getRowDataFromExecutionResult(executionResult), gridOptions: {
37
+ suppressScrollOnNewData: true,
38
+ getRowId: (data) => data.data.rowNumber,
39
+ rowSelection: 'multiple',
40
+ },
41
+ // NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
42
+ // See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
43
+ onRowDataUpdated: (params) => {
44
+ params.api.refreshCells({ force: true });
45
+ }, suppressFieldDotNotation: true, suppressContextMenu: false, columnDefs: colDefs }) }) }));
46
+ });
47
+ //# sourceMappingURL=QueryBuilderTDSSimpleGridResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryBuilderTDSSimpleGridResult.js","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EACL,QAAQ,GAET,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,kCAAkC,CAAC;AAE1C,MAAM,CAAC,MAAM,+BAA+B,GAAG,QA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