@finos/legend-query-builder 4.17.99 → 4.18.0
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/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +2 -1
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +9 -8
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +48 -5
- package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderRelationExplorerPanel.d.ts +24 -0
- package/lib/components/explorer/QueryBuilderRelationExplorerPanel.d.ts.map +1 -0
- package/lib/components/explorer/QueryBuilderRelationExplorerPanel.js +202 -0
- package/lib/components/explorer/QueryBuilderRelationExplorerPanel.js.map +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +3 -3
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +25 -6
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.js +1 -1
- package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.d.ts +42 -0
- package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.js +212 -0
- package/lib/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.d.ts +66 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.js +265 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStats.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.d.ts +28 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.js +148 -0
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.d.ts +19 -0
- package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.js +196 -0
- package/lib/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts +5 -0
- package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js +64 -87
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSGridShared.d.ts +26 -0
- package/lib/components/result/tds/QueryBuilderTDSGridShared.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSGridShared.js +51 -0
- package/lib/components/result/tds/QueryBuilderTDSGridShared.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts +5 -0
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +169 -60
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -1
- package/lib/components/workflows/AccessorQueryBuilder.d.ts +18 -0
- package/lib/components/workflows/AccessorQueryBuilder.d.ts.map +1 -0
- package/lib/components/workflows/AccessorQueryBuilder.js +87 -0
- package/lib/components/workflows/AccessorQueryBuilder.js.map +1 -0
- package/lib/components/workflows/ClassQueryBuilder.js +5 -5
- package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
- package/lib/data-access-overview.css +1 -1
- package/lib/graph/QueryBuilderMetaModelConst.d.ts +4 -0
- package/lib/graph/QueryBuilderMetaModelConst.d.ts.map +1 -1
- package/lib/graph/QueryBuilderMetaModelConst.js +4 -0
- package/lib/graph/QueryBuilderMetaModelConst.js.map +1 -1
- package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +7 -1
- package/lib/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts +2 -0
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js +93 -3
- package/lib/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderConfig.d.ts +3 -0
- package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
- package/lib/stores/QueryBuilderConfig.js +3 -0
- package/lib/stores/QueryBuilderConfig.js.map +1 -1
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js +13 -3
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +14 -4
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +41 -13
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +51 -20
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.d.ts +1 -0
- package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.js +1 -0
- package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
- package/lib/stores/QueryBuilderTypeaheadHelper.js +2 -2
- package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +54 -45
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +1 -1
- package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +12 -2
- package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.js +12 -2
- package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -2
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -2
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -3
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts +2 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js +19 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSHelper.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +7 -4
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +59 -12
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +16 -3
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +102 -24
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +2 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +16 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +3 -3
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.js +11 -2
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js +16 -12
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts +4 -3
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js +19 -9
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js +57 -5
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts +4 -3
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js +85 -6
- package/lib/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js +4 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.js.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts +1 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js +3 -0
- package/lib/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js +4 -4
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
- package/lib/stores/workflows/MappingQueryBuilderState.js +2 -2
- package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -2
- package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
- package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.d.ts +18 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.d.ts.map +1 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.js +32 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderHelper.js.map +1 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts +57 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts.map +1 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js +125 -0
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js.map +1 -0
- package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js +4 -4
- package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js.map +1 -1
- package/package.json +7 -7
- package/src/components/QueryBuilder.tsx +2 -1
- package/src/components/QueryBuilderSideBar.tsx +12 -8
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +77 -14
- package/src/components/explorer/QueryBuilderRelationExplorerPanel.tsx +536 -0
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +1 -0
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +3 -3
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +62 -4
- package/src/components/result/QueryBuilderResultPanel.tsx +6 -2
- package/src/components/result/tds/QueryBuilderTDSAsyncCellSelectionStats.ts +254 -0
- package/src/components/result/tds/QueryBuilderTDSCellSelectionStats.ts +397 -0
- package/src/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.tsx +439 -0
- package/src/components/result/tds/QueryBuilderTDSGridKeyboardShortcuts.ts +270 -0
- package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +107 -112
- package/src/components/result/tds/QueryBuilderTDSGridShared.ts +76 -0
- package/src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx +272 -99
- package/src/components/workflows/AccessorQueryBuilder.tsx +211 -0
- package/src/components/workflows/ClassQueryBuilder.tsx +5 -5
- package/src/graph/QueryBuilderMetaModelConst.ts +5 -0
- package/src/graph-manager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +28 -0
- package/src/graph-manager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts +223 -4
- package/src/index.ts +2 -0
- package/src/stores/QueryBuilderConfig.ts +3 -0
- package/src/stores/QueryBuilderResultState.ts +22 -9
- package/src/stores/QueryBuilderState.ts +47 -12
- package/src/stores/QueryBuilderStateBuilder.ts +107 -43
- package/src/stores/QueryBuilderStateHashUtils.ts +1 -0
- package/src/stores/QueryBuilderTypeaheadHelper.ts +2 -2
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +72 -59
- package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +1 -1
- package/src/stores/explorer/QueryBuilderExplorerState.ts +26 -2
- package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +1 -2
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +4 -3
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +1 -1
- package/src/stores/fetch-structure/tds/QueryBuilderTDSHelper.ts +42 -0
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +135 -19
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +197 -38
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +30 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +3 -3
- package/src/stores/fetch-structure/tds/projection/QueryBuilderRelationProjectValueSpecBuilder.ts +21 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderTypedProjectionStateBuilder.ts +25 -16
- package/src/stores/fetch-structure/tds/window/QueryBuilderWindowState.ts +23 -9
- package/src/stores/fetch-structure/tds/window/QueryBuilderWindowStateBuilder.ts +146 -4
- package/src/stores/fetch-structure/tds/window/QueryBuilderWindowValueSpecificationBuilder.ts +145 -10
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator.ts +2 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Average.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Count.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Max.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Min.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowOperator_Sum.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_AverageRank.ts +5 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_DenseRank.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_Rank.ts +4 -0
- package/src/stores/fetch-structure/tds/window/operators/QueryBuilderTDS_WindowRankOperator_RowNumber.ts +4 -0
- package/src/stores/milestoning/QueryBuilderMilestoningState.ts +4 -4
- package/src/stores/workflows/MappingQueryBuilderState.ts +2 -2
- package/src/stores/workflows/ServiceQueryBuilderState.ts +2 -2
- package/src/stores/workflows/accessor/AccessorQueryBuilderHelper.ts +51 -0
- package/src/stores/workflows/accessor/AccessorQueryBuilderState.ts +195 -0
- package/src/stores/workflows/dataProduct/DataProductQueryBuilderState.ts +4 -4
- package/tsconfig.json +9 -0
|
@@ -14,21 +14,23 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { WarningIcon, clsx } from '@finos/legend-art';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
19
|
import type { QueryBuilderState } from '../../../stores/QueryBuilderState.js';
|
|
20
20
|
import {
|
|
21
21
|
DataGrid,
|
|
22
22
|
type DataGridColumnDefinition,
|
|
23
23
|
type DataGridCustomHeaderProps,
|
|
24
|
+
type DataGridGetContextMenuItemsParams,
|
|
25
|
+
type DataGridMenuItemDef,
|
|
26
|
+
type DataGridDefaultMenuItem,
|
|
24
27
|
} from '@finos/legend-lego/data-grid';
|
|
25
28
|
import {
|
|
26
29
|
getRowDataFromExecutionResult,
|
|
27
|
-
QueryBuilderGridResultContextMenu,
|
|
28
30
|
type IQueryRendererParamsWithGridType,
|
|
29
31
|
} from './QueryBuilderTDSResultShared.js';
|
|
30
|
-
import { QueryBuilderTDSState } from '../../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
|
|
31
32
|
import { DEFAULT_LOCALE } from '../../../graph-manager/QueryBuilderConst.js';
|
|
33
|
+
import type { QueryBuilderResultState } from '../../../stores/QueryBuilderResultState.js';
|
|
32
34
|
import {
|
|
33
35
|
guaranteeNonNullable,
|
|
34
36
|
isBoolean,
|
|
@@ -36,6 +38,8 @@ import {
|
|
|
36
38
|
isString,
|
|
37
39
|
isValidURL,
|
|
38
40
|
} from '@finos/legend-shared';
|
|
41
|
+
import { useApplicationStore } from '@finos/legend-application';
|
|
42
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
39
43
|
import {
|
|
40
44
|
type TDSResultCellCoordinate,
|
|
41
45
|
type TDSResultCellData,
|
|
@@ -46,6 +50,9 @@ import {
|
|
|
46
50
|
PRIMITIVE_TYPE,
|
|
47
51
|
} from '@finos/legend-graph';
|
|
48
52
|
import { QUERY_BUILDER_TEST_ID } from '../../../__lib__/QueryBuilderTesting.js';
|
|
53
|
+
import { QueryBuilderTDSCellSelectionStatsBar } from './QueryBuilderTDSCellSelectionStatsBar.js';
|
|
54
|
+
import { useAsyncCellSelectionStats } from './QueryBuilderTDSAsyncCellSelectionStats.js';
|
|
55
|
+
import { buildTDSGridContextMenuItems } from './QueryBuilderTDSGridShared.js';
|
|
49
56
|
|
|
50
57
|
export const MAXIMUM_FRACTION_DIGITS = 4;
|
|
51
58
|
|
|
@@ -114,13 +121,8 @@ const QueryResultCellRenderer = observer(
|
|
|
114
121
|
(params: IQueryRendererParamsWithGridType) => {
|
|
115
122
|
const resultState = params.resultState;
|
|
116
123
|
const tdsExecutionResult = params.tdsExecutionResult;
|
|
117
|
-
const fetchStructureImplementation =
|
|
118
|
-
resultState.queryBuilderState.fetchStructureState.implementation;
|
|
119
|
-
const applicationStore = resultState.queryBuilderState.applicationStore;
|
|
120
124
|
const cellValue = params.value as TDSResultCellDataType;
|
|
121
125
|
const nodeRowIndex = guaranteeNonNullable(params.node.rowIndex);
|
|
122
|
-
const darkMode =
|
|
123
|
-
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
124
126
|
|
|
125
127
|
const formattedCellValue = (): TDSResultCellDataType => {
|
|
126
128
|
if (isNumber(cellValue)) {
|
|
@@ -321,104 +323,136 @@ const QueryResultCellRenderer = observer(
|
|
|
321
323
|
|
|
322
324
|
resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
|
|
323
325
|
};
|
|
324
|
-
const getContextMenuRenderer = (): React.ReactNode => {
|
|
325
|
-
if (fetchStructureImplementation instanceof QueryBuilderTDSState) {
|
|
326
|
-
const copyCellValue = applicationStore.guardUnhandledError(() =>
|
|
327
|
-
applicationStore.clipboardService.copyTextToClipboard(
|
|
328
|
-
fetchStructureImplementation.queryBuilderState.resultState.selectedCells
|
|
329
|
-
.map((cellData) => cellData.value)
|
|
330
|
-
.join(','),
|
|
331
|
-
),
|
|
332
|
-
);
|
|
333
|
-
const findRowFromRowIndex = (rowIndex: number): string => {
|
|
334
|
-
if (
|
|
335
|
-
!fetchStructureImplementation.queryBuilderState.resultState
|
|
336
|
-
.executionResult ||
|
|
337
|
-
!(
|
|
338
|
-
fetchStructureImplementation.queryBuilderState.resultState
|
|
339
|
-
.executionResult instanceof TDSExecutionResult
|
|
340
|
-
)
|
|
341
|
-
) {
|
|
342
|
-
return '';
|
|
343
|
-
}
|
|
344
|
-
// try to get the entire row value separated by comma
|
|
345
|
-
// rowData is in format of {columnName: value, columnName1: value, ...., rowNumber:value}
|
|
346
|
-
const valueArr: TDSResultCellDataType[] = [];
|
|
347
|
-
Object.entries(
|
|
348
|
-
params.api.getRenderedNodes().find((n) => n.rowIndex === rowIndex)
|
|
349
|
-
?.data as TDSRowDataType,
|
|
350
|
-
).forEach((entry) => {
|
|
351
|
-
if (entry[0] !== 'rowNumber') {
|
|
352
|
-
valueArr.push(entry[1]);
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
return valueArr.join(',');
|
|
356
|
-
};
|
|
357
|
-
const copyRowValue = applicationStore.guardUnhandledError(() =>
|
|
358
|
-
applicationStore.clipboardService.copyTextToClipboard(
|
|
359
|
-
findRowFromRowIndex(
|
|
360
|
-
fetchStructureImplementation.queryBuilderState.resultState
|
|
361
|
-
.selectedCells[0]?.coordinates.rowIndex ?? 0,
|
|
362
|
-
),
|
|
363
|
-
),
|
|
364
|
-
);
|
|
365
|
-
return (
|
|
366
|
-
<QueryBuilderGridResultContextMenu
|
|
367
|
-
data={resultState.mousedOverCell}
|
|
368
|
-
tdsState={fetchStructureImplementation}
|
|
369
|
-
copyCellValueFunc={copyCellValue}
|
|
370
|
-
copyCellRowValueFunc={copyRowValue}
|
|
371
|
-
/>
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
return null;
|
|
375
|
-
};
|
|
376
326
|
|
|
377
327
|
return (
|
|
378
|
-
<
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
resultState.queryBuilderState.fetchStructureState
|
|
383
|
-
.implementation instanceof QueryBuilderTDSState
|
|
384
|
-
) ||
|
|
385
|
-
!resultState.queryBuilderState.isQuerySupported ||
|
|
386
|
-
!resultState.mousedOverCell
|
|
387
|
-
}
|
|
388
|
-
menuProps={{ elevation: 7 }}
|
|
389
|
-
className={clsx('query-builder__result__tds-grid', {
|
|
390
|
-
'ag-theme-balham': !darkMode,
|
|
391
|
-
'ag-theme-balham-dark': darkMode,
|
|
328
|
+
<div
|
|
329
|
+
className={clsx('query-builder__result__values__table__cell', {
|
|
330
|
+
'query-builder__result__values__table__cell--active':
|
|
331
|
+
cellInFilteredResults,
|
|
392
332
|
})}
|
|
333
|
+
onMouseDown={(event) => mouseDown(event)}
|
|
334
|
+
onMouseUp={(event) => mouseUp(event)}
|
|
335
|
+
onMouseOver={(event) => mouseOver(event)}
|
|
393
336
|
>
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
>
|
|
403
|
-
{cellValueUrlLink ? (
|
|
404
|
-
<a href={cellValueUrlLink} target="_blank" rel="noreferrer">
|
|
405
|
-
{cellValueUrlLink}
|
|
406
|
-
</a>
|
|
407
|
-
) : (
|
|
408
|
-
<span>{formattedCellValue()}</span>
|
|
409
|
-
)}
|
|
410
|
-
</div>
|
|
411
|
-
</ContextMenu>
|
|
337
|
+
{cellValueUrlLink ? (
|
|
338
|
+
<a href={cellValueUrlLink} target="_blank" rel="noreferrer">
|
|
339
|
+
{cellValueUrlLink}
|
|
340
|
+
</a>
|
|
341
|
+
) : (
|
|
342
|
+
<span>{formattedCellValue()}</span>
|
|
343
|
+
)}
|
|
344
|
+
</div>
|
|
412
345
|
);
|
|
413
346
|
},
|
|
414
347
|
);
|
|
415
348
|
|
|
349
|
+
// ---------------------------------------------------------------------------
|
|
350
|
+
// Simple-grid keyboard shortcut helpers (extracted to avoid >4-level nesting)
|
|
351
|
+
// ---------------------------------------------------------------------------
|
|
352
|
+
|
|
353
|
+
type SimpleGridRow = { values: (string | number | boolean | null)[] };
|
|
354
|
+
|
|
355
|
+
/** Build TDSResultCellData[] for all cells in the grid. */
|
|
356
|
+
const buildAllCells = (
|
|
357
|
+
columns: string[],
|
|
358
|
+
rows: SimpleGridRow[],
|
|
359
|
+
): TDSResultCellData[] => {
|
|
360
|
+
const cells: TDSResultCellData[] = [];
|
|
361
|
+
rows.forEach((row, rowIndex) => {
|
|
362
|
+
columns.forEach((colName, colIndex) => {
|
|
363
|
+
cells.push({
|
|
364
|
+
value: row.values[colIndex],
|
|
365
|
+
columnName: colName,
|
|
366
|
+
coordinates: { rowIndex, colIndex },
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
return cells;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
/** Build TDSResultCellData[] for specific column indices across all rows. */
|
|
374
|
+
const buildColumnCells = (
|
|
375
|
+
columns: string[],
|
|
376
|
+
rows: SimpleGridRow[],
|
|
377
|
+
colIndices: number[],
|
|
378
|
+
): TDSResultCellData[] => {
|
|
379
|
+
const cells: TDSResultCellData[] = [];
|
|
380
|
+
rows.forEach((row, ri) => {
|
|
381
|
+
colIndices.forEach((ci) => {
|
|
382
|
+
cells.push({
|
|
383
|
+
value: row.values[ci],
|
|
384
|
+
columnName: columns[ci] ?? '',
|
|
385
|
+
coordinates: { rowIndex: ri, colIndex: ci },
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
return cells;
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
/** Build TDSResultCellData[] for specific row indices across all columns. */
|
|
393
|
+
const buildRowCells = (
|
|
394
|
+
columns: string[],
|
|
395
|
+
rows: SimpleGridRow[],
|
|
396
|
+
rowIndices: number[],
|
|
397
|
+
): TDSResultCellData[] => {
|
|
398
|
+
const cells: TDSResultCellData[] = [];
|
|
399
|
+
rowIndices.forEach((ri) => {
|
|
400
|
+
columns.forEach((cn, ci) => {
|
|
401
|
+
cells.push({
|
|
402
|
+
value: rows[ri]?.values[ci],
|
|
403
|
+
columnName: cn,
|
|
404
|
+
coordinates: { rowIndex: ri, colIndex: ci },
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
return cells;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
/** Resolve the distinct column indices to select for Ctrl+Space. */
|
|
412
|
+
const resolveColumnIndices = (
|
|
413
|
+
selectedCells: TDSResultCellData[],
|
|
414
|
+
fallbackColIndex: number,
|
|
415
|
+
): number[] =>
|
|
416
|
+
selectedCells.length > 0
|
|
417
|
+
? [...new Set(selectedCells.map((c) => c.coordinates.colIndex))]
|
|
418
|
+
: [fallbackColIndex];
|
|
419
|
+
|
|
420
|
+
/** Resolve the distinct row indices to select for Shift+Space. */
|
|
421
|
+
const resolveRowIndices = (
|
|
422
|
+
selectedCells: TDSResultCellData[],
|
|
423
|
+
fallbackRowIndex: number,
|
|
424
|
+
): number[] =>
|
|
425
|
+
selectedCells.length > 0
|
|
426
|
+
? [...new Set(selectedCells.map((c) => c.coordinates.rowIndex))]
|
|
427
|
+
: [fallbackRowIndex];
|
|
428
|
+
|
|
429
|
+
/** Apply a cell selection to the result state if non-empty. */
|
|
430
|
+
const applySelection = (
|
|
431
|
+
cells: TDSResultCellData[],
|
|
432
|
+
resultState: QueryBuilderResultState,
|
|
433
|
+
): void => {
|
|
434
|
+
if (cells.length > 0) {
|
|
435
|
+
resultState.setSelectedCells(cells);
|
|
436
|
+
resultState.setMouseOverCell(cells[0] ?? null);
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
|
|
416
440
|
export const QueryBuilderTDSSimpleGridResult = observer(
|
|
417
441
|
(props: {
|
|
418
442
|
executionResult: TDSExecutionResult;
|
|
419
443
|
queryBuilderState: QueryBuilderState;
|
|
444
|
+
/**
|
|
445
|
+
* Whether to show the cell-selection summary statistics bar below the grid.
|
|
446
|
+
* Defaults to `true`.
|
|
447
|
+
*/
|
|
448
|
+
showSummaryStats?: boolean;
|
|
420
449
|
}) => {
|
|
421
|
-
const {
|
|
450
|
+
const {
|
|
451
|
+
executionResult,
|
|
452
|
+
queryBuilderState,
|
|
453
|
+
showSummaryStats = true,
|
|
454
|
+
} = props;
|
|
455
|
+
const applicationStore = useApplicationStore();
|
|
422
456
|
const resultState = queryBuilderState.resultState;
|
|
423
457
|
const darkMode =
|
|
424
458
|
!queryBuilderState.applicationStore.layoutService
|
|
@@ -441,13 +475,129 @@ export const QueryBuilderTDSSimpleGridResult = observer(
|
|
|
441
475
|
}) as DataGridColumnDefinition,
|
|
442
476
|
);
|
|
443
477
|
|
|
478
|
+
// Simple grid: no AG Grid cell-range API, so we keep selectedCells in
|
|
479
|
+
// MobX and pass a null gridApiRef. The hook falls back to reading from
|
|
480
|
+
// selectedCells directly when the gridApiRef is null.
|
|
481
|
+
const selectedCells = resultState.selectedCells;
|
|
482
|
+
const columnTypes = new Map<string, string | undefined>(
|
|
483
|
+
executionResult.builder.columns.map((c) => [c.name, c.type]),
|
|
484
|
+
);
|
|
485
|
+
const simpleGridApiRef = useRef<null>(null);
|
|
486
|
+
const cellSelectionStats = useAsyncCellSelectionStats(
|
|
487
|
+
selectedCells.length, // version counter — changes when selection changes
|
|
488
|
+
columnTypes,
|
|
489
|
+
simpleGridApiRef,
|
|
490
|
+
selectedCells, // fallback cells for when gridApiRef is null
|
|
491
|
+
);
|
|
492
|
+
|
|
493
|
+
const gridContainerRef = useRef<HTMLDivElement>(null);
|
|
494
|
+
// Track the last cell the user clicked so keyboard shortcuts know
|
|
495
|
+
// which row/column to act on (AG Grid internal focus is not used here
|
|
496
|
+
// because we move DOM focus to the container div, not into a grid cell).
|
|
497
|
+
const lastClickedCellRef = useRef<{
|
|
498
|
+
colName: string;
|
|
499
|
+
colIndex: number;
|
|
500
|
+
rowIndex: number;
|
|
501
|
+
} | null>(null);
|
|
502
|
+
|
|
503
|
+
// All keyboard shortcuts handled in the native capture-phase listener so
|
|
504
|
+
// they fire reliably when the container div has focus.
|
|
505
|
+
useEffect(() => {
|
|
506
|
+
const el = gridContainerRef.current;
|
|
507
|
+
if (!el) {
|
|
508
|
+
return undefined;
|
|
509
|
+
}
|
|
510
|
+
const handler = (e: KeyboardEvent): void => {
|
|
511
|
+
const columns = executionResult.result.columns;
|
|
512
|
+
const rows = executionResult.result.rows;
|
|
513
|
+
|
|
514
|
+
// Ctrl+A — select all cells
|
|
515
|
+
if (e.ctrlKey && e.code === 'KeyA') {
|
|
516
|
+
e.preventDefault();
|
|
517
|
+
// eslint-disable-next-line no-console
|
|
518
|
+
console.debug(
|
|
519
|
+
`[TDS Simple Grid] Ctrl+A → selecting all: ${rows.length} rows × ${columns.length} columns`,
|
|
520
|
+
);
|
|
521
|
+
const allCells = buildAllCells(columns, rows);
|
|
522
|
+
applySelection(allCells, resultState);
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// Ctrl+Space — select entire columns for all columns in the current selection.
|
|
527
|
+
if (e.ctrlKey && e.code === 'Space') {
|
|
528
|
+
e.preventDefault();
|
|
529
|
+
const cell = lastClickedCellRef.current;
|
|
530
|
+
if (!cell) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
const colIndices = resolveColumnIndices(
|
|
534
|
+
resultState.selectedCells,
|
|
535
|
+
cell.colIndex,
|
|
536
|
+
);
|
|
537
|
+
// eslint-disable-next-line no-console
|
|
538
|
+
console.debug(
|
|
539
|
+
`[TDS Simple Grid] Ctrl+Space → selecting ${colIndices.length} column(s), ${rows.length} rows`,
|
|
540
|
+
);
|
|
541
|
+
const newCells = buildColumnCells(columns, rows, colIndices);
|
|
542
|
+
applySelection(newCells, resultState);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Shift+Space — select entire rows for all rows in the current selection.
|
|
547
|
+
if (e.shiftKey && e.code === 'Space') {
|
|
548
|
+
e.preventDefault();
|
|
549
|
+
const cell = lastClickedCellRef.current;
|
|
550
|
+
if (!cell) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
const rowIndices = resolveRowIndices(
|
|
554
|
+
resultState.selectedCells,
|
|
555
|
+
cell.rowIndex,
|
|
556
|
+
);
|
|
557
|
+
// eslint-disable-next-line no-console
|
|
558
|
+
console.debug(
|
|
559
|
+
`[TDS Simple Grid] Shift+Space → selecting ${rowIndices.length} row(s), ${columns.length} columns`,
|
|
560
|
+
);
|
|
561
|
+
const newCells = buildRowCells(columns, rows, rowIndices);
|
|
562
|
+
applySelection(newCells, resultState);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
el.addEventListener('keydown', handler, { capture: true });
|
|
566
|
+
return () =>
|
|
567
|
+
el.removeEventListener('keydown', handler, { capture: true });
|
|
568
|
+
}, [
|
|
569
|
+
executionResult.result.columns,
|
|
570
|
+
executionResult.result.rows,
|
|
571
|
+
resultState,
|
|
572
|
+
]);
|
|
573
|
+
|
|
574
|
+
const getContextMenuItems = useCallback(
|
|
575
|
+
(
|
|
576
|
+
params: DataGridGetContextMenuItemsParams<TDSRowDataType>,
|
|
577
|
+
): (DataGridDefaultMenuItem | DataGridMenuItemDef)[] =>
|
|
578
|
+
buildTDSGridContextMenuItems(
|
|
579
|
+
params,
|
|
580
|
+
applicationStore,
|
|
581
|
+
resultState,
|
|
582
|
+
queryBuilderState.applicationStore.alertUnhandledError,
|
|
583
|
+
),
|
|
584
|
+
[
|
|
585
|
+
applicationStore,
|
|
586
|
+
resultState,
|
|
587
|
+
queryBuilderState.applicationStore.alertUnhandledError,
|
|
588
|
+
],
|
|
589
|
+
);
|
|
590
|
+
|
|
444
591
|
return (
|
|
445
592
|
<div
|
|
446
593
|
data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_RESULT_VALUES_TDS}
|
|
447
594
|
className="query-builder__result__values__table"
|
|
448
595
|
>
|
|
449
596
|
<div
|
|
597
|
+
ref={gridContainerRef}
|
|
598
|
+
tabIndex={-1}
|
|
450
599
|
className={clsx('query-builder__result__tds-grid', {
|
|
600
|
+
'query-builder__result__tds-grid--with-stats-bar': showSummaryStats,
|
|
451
601
|
'ag-theme-balham': !darkMode,
|
|
452
602
|
'ag-theme-balham-dark': darkMode,
|
|
453
603
|
})}
|
|
@@ -457,11 +607,6 @@ export const QueryBuilderTDSSimpleGridResult = observer(
|
|
|
457
607
|
gridOptions={{
|
|
458
608
|
suppressScrollOnNewData: true,
|
|
459
609
|
getRowId: (data) => `${data.data.rowNumber}`,
|
|
460
|
-
rowSelection: {
|
|
461
|
-
mode: 'multiRow',
|
|
462
|
-
checkboxes: false,
|
|
463
|
-
headerCheckbox: false,
|
|
464
|
-
},
|
|
465
610
|
}}
|
|
466
611
|
// NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
|
|
467
612
|
// See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
|
|
@@ -469,9 +614,37 @@ export const QueryBuilderTDSSimpleGridResult = observer(
|
|
|
469
614
|
params.api.refreshCells({ force: true });
|
|
470
615
|
}}
|
|
471
616
|
suppressFieldDotNotation={true}
|
|
472
|
-
suppressContextMenu={false}
|
|
473
617
|
columnDefs={colDefs}
|
|
618
|
+
getContextMenuItems={(params) => getContextMenuItems(params)}
|
|
619
|
+
onCellClicked={(event) => {
|
|
620
|
+
// Skip clicks originated from keyboard shortcuts (Ctrl/Shift+Space fires
|
|
621
|
+
// a synthetic click that would reset the range selection we just set).
|
|
622
|
+
const e = event.event as MouseEvent | undefined;
|
|
623
|
+
if (e?.ctrlKey || e?.shiftKey) {
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
const colName = event.column.getColId();
|
|
627
|
+
const colIndex = executionResult.result.columns.indexOf(colName);
|
|
628
|
+
// eslint-disable-next-line no-console
|
|
629
|
+
console.debug(
|
|
630
|
+
`[TDS Simple Grid] onCellClicked: col=${colName} row=${event.rowIndex}`,
|
|
631
|
+
);
|
|
632
|
+
lastClickedCellRef.current = {
|
|
633
|
+
colName,
|
|
634
|
+
colIndex,
|
|
635
|
+
rowIndex: event.rowIndex ?? 0,
|
|
636
|
+
};
|
|
637
|
+
gridContainerRef.current?.focus({ preventScroll: true });
|
|
638
|
+
}}
|
|
474
639
|
/>
|
|
640
|
+
{showSummaryStats && cellSelectionStats !== undefined && (
|
|
641
|
+
<QueryBuilderTDSCellSelectionStatsBar
|
|
642
|
+
stats={cellSelectionStats.stats}
|
|
643
|
+
cellCount={cellSelectionStats.cellCount}
|
|
644
|
+
countReady={cellSelectionStats.countReady}
|
|
645
|
+
darkMode={darkMode}
|
|
646
|
+
/>
|
|
647
|
+
)}
|
|
475
648
|
</div>
|
|
476
649
|
</div>
|
|
477
650
|
);
|
|
@@ -0,0 +1,211 @@
|
|
|
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
|
+
|
|
17
|
+
import {
|
|
18
|
+
CustomSelectorInput,
|
|
19
|
+
PanelHeader,
|
|
20
|
+
compareLabelFn,
|
|
21
|
+
createFilter,
|
|
22
|
+
} from '@finos/legend-art';
|
|
23
|
+
import { observer } from 'mobx-react-lite';
|
|
24
|
+
import {
|
|
25
|
+
type Runtime,
|
|
26
|
+
RuntimePointer,
|
|
27
|
+
PackageableElementExplicitReference,
|
|
28
|
+
} from '@finos/legend-graph';
|
|
29
|
+
import { useApplicationStore } from '@finos/legend-application';
|
|
30
|
+
import {
|
|
31
|
+
buildRuntimeValueOption,
|
|
32
|
+
getRuntimeOptionFormatter,
|
|
33
|
+
} from '../QueryBuilderSideBar.js';
|
|
34
|
+
import type {
|
|
35
|
+
AccessorQueryBuilderState,
|
|
36
|
+
AccessorOwnerOption,
|
|
37
|
+
} from '../../stores/workflows/accessor/AccessorQueryBuilderState.js';
|
|
38
|
+
import { getPackageableElementOptionFormatter } from '@finos/legend-lego/graph-editor';
|
|
39
|
+
|
|
40
|
+
type AccessorOption = {
|
|
41
|
+
label: string;
|
|
42
|
+
value: { schemaName?: string | undefined; tableName: string };
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const AccessorQueryBuilderSetupPanelContent = observer(
|
|
46
|
+
(props: { queryBuilderState: AccessorQueryBuilderState }) => {
|
|
47
|
+
const { queryBuilderState } = props;
|
|
48
|
+
const applicationStore = useApplicationStore();
|
|
49
|
+
|
|
50
|
+
// accessor owner (IngestDefinition or Database)
|
|
51
|
+
const accessorOwnerOptions =
|
|
52
|
+
queryBuilderState.accessorOwnerOptions.sort(compareLabelFn);
|
|
53
|
+
const selectedAccessorOwnerOption = queryBuilderState.selectedAccessorOwner
|
|
54
|
+
? (queryBuilderState.accessorOwnerOptions.find(
|
|
55
|
+
(opt) => opt.value === queryBuilderState.selectedAccessorOwner,
|
|
56
|
+
) ?? null)
|
|
57
|
+
: null;
|
|
58
|
+
const changeAccessorOwner = (val: AccessorOwnerOption): void => {
|
|
59
|
+
if (val.value === queryBuilderState.selectedAccessorOwner) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
queryBuilderState.changeAccessorOwner(val.value);
|
|
63
|
+
};
|
|
64
|
+
const accessorOwnerFilterOption = createFilter({
|
|
65
|
+
ignoreCase: true,
|
|
66
|
+
ignoreAccents: false,
|
|
67
|
+
stringify: (option: { data: AccessorOwnerOption }): string =>
|
|
68
|
+
option.data.value.path,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// accessor (dataset / table)
|
|
72
|
+
const accessorOptions =
|
|
73
|
+
queryBuilderState.accessorsOptions.sort(compareLabelFn);
|
|
74
|
+
const selectedAccessorOption = queryBuilderState.sourceAccessor
|
|
75
|
+
? (queryBuilderState.accessorsOptions.find(
|
|
76
|
+
(opt) =>
|
|
77
|
+
opt.value.tableName ===
|
|
78
|
+
queryBuilderState.sourceAccessor?.accessor &&
|
|
79
|
+
opt.value.schemaName === queryBuilderState.sourceAccessor.schema,
|
|
80
|
+
) ?? null)
|
|
81
|
+
: null;
|
|
82
|
+
const changeAccessor = (val: AccessorOption): void => {
|
|
83
|
+
queryBuilderState.changeAccessor(val.value);
|
|
84
|
+
};
|
|
85
|
+
const showAccessorSelector = accessorOptions.length > 0;
|
|
86
|
+
|
|
87
|
+
// runtime
|
|
88
|
+
const runtimeOptions = queryBuilderState.compatibleRuntimes
|
|
89
|
+
.map(
|
|
90
|
+
(rt) =>
|
|
91
|
+
new RuntimePointer(PackageableElementExplicitReference.create(rt)),
|
|
92
|
+
)
|
|
93
|
+
.map(buildRuntimeValueOption)
|
|
94
|
+
.sort(compareLabelFn);
|
|
95
|
+
const selectedRuntimeOption = queryBuilderState.executionContextState
|
|
96
|
+
.runtimeValue
|
|
97
|
+
? buildRuntimeValueOption(
|
|
98
|
+
queryBuilderState.executionContextState.runtimeValue,
|
|
99
|
+
)
|
|
100
|
+
: null;
|
|
101
|
+
const changeRuntime = (val: { value: Runtime }): void => {
|
|
102
|
+
if (val.value === queryBuilderState.executionContextState.runtimeValue) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
queryBuilderState.changeRuntime(val.value);
|
|
106
|
+
};
|
|
107
|
+
const runtimeFilterOption = createFilter({
|
|
108
|
+
ignoreCase: true,
|
|
109
|
+
ignoreAccents: false,
|
|
110
|
+
stringify: (option: { data: { value: Runtime } }): string =>
|
|
111
|
+
option.data.value instanceof RuntimePointer
|
|
112
|
+
? option.data.value.packageableRuntime.value.path
|
|
113
|
+
: 'custom',
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div className="query-builder__setup__config-group">
|
|
118
|
+
<PanelHeader title="properties" />
|
|
119
|
+
<div className="query-builder__setup__config-group__content">
|
|
120
|
+
<div className="query-builder__setup__config-group__item">
|
|
121
|
+
<label
|
|
122
|
+
className="btn--sm query-builder__setup__config-group__item__label"
|
|
123
|
+
title="source"
|
|
124
|
+
htmlFor="query-builder__setup__source-selector"
|
|
125
|
+
>
|
|
126
|
+
Source
|
|
127
|
+
</label>
|
|
128
|
+
<CustomSelectorInput
|
|
129
|
+
inputId="query-builder__setup__source-selector"
|
|
130
|
+
className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
|
|
131
|
+
placeholder="Choose a source..."
|
|
132
|
+
options={accessorOwnerOptions}
|
|
133
|
+
onChange={changeAccessorOwner}
|
|
134
|
+
value={selectedAccessorOwnerOption}
|
|
135
|
+
darkMode={
|
|
136
|
+
!applicationStore.layoutService
|
|
137
|
+
.TEMPORARY__isLightColorThemeEnabled
|
|
138
|
+
}
|
|
139
|
+
filterOption={accessorOwnerFilterOption}
|
|
140
|
+
formatOptionLabel={getPackageableElementOptionFormatter({
|
|
141
|
+
darkMode:
|
|
142
|
+
!applicationStore.layoutService
|
|
143
|
+
.TEMPORARY__isLightColorThemeEnabled,
|
|
144
|
+
})}
|
|
145
|
+
/>
|
|
146
|
+
</div>
|
|
147
|
+
{showAccessorSelector && (
|
|
148
|
+
<div className="query-builder__setup__config-group__item">
|
|
149
|
+
<label
|
|
150
|
+
className="btn--sm query-builder__setup__config-group__item__label"
|
|
151
|
+
title="accessor"
|
|
152
|
+
htmlFor="query-builder__setup__accessor-selector"
|
|
153
|
+
>
|
|
154
|
+
Accessor
|
|
155
|
+
</label>
|
|
156
|
+
<CustomSelectorInput
|
|
157
|
+
inputId="query-builder__setup__accessor-selector"
|
|
158
|
+
className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
|
|
159
|
+
placeholder="Choose an accessor..."
|
|
160
|
+
options={accessorOptions}
|
|
161
|
+
onChange={changeAccessor}
|
|
162
|
+
value={selectedAccessorOption}
|
|
163
|
+
darkMode={
|
|
164
|
+
!applicationStore.layoutService
|
|
165
|
+
.TEMPORARY__isLightColorThemeEnabled
|
|
166
|
+
}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
<div className="query-builder__setup__config-group__item">
|
|
171
|
+
<label
|
|
172
|
+
className="btn--sm query-builder__setup__config-group__item__label"
|
|
173
|
+
title="runtime"
|
|
174
|
+
htmlFor="query-builder__setup__runtime-selector"
|
|
175
|
+
>
|
|
176
|
+
Runtime
|
|
177
|
+
</label>
|
|
178
|
+
<CustomSelectorInput
|
|
179
|
+
inputId="query-builder__setup__runtime-selector"
|
|
180
|
+
className="panel__content__form__section__dropdown query-builder__setup__config-group__item__selector"
|
|
181
|
+
placeholder="Choose a runtime..."
|
|
182
|
+
noMatchMessage="No compatible runtime found"
|
|
183
|
+
disabled={!queryBuilderState.selectedAccessorOwner}
|
|
184
|
+
options={runtimeOptions}
|
|
185
|
+
onChange={changeRuntime}
|
|
186
|
+
value={selectedRuntimeOption}
|
|
187
|
+
darkMode={
|
|
188
|
+
!applicationStore.layoutService
|
|
189
|
+
.TEMPORARY__isLightColorThemeEnabled
|
|
190
|
+
}
|
|
191
|
+
filterOption={runtimeFilterOption}
|
|
192
|
+
formatOptionLabel={getRuntimeOptionFormatter({
|
|
193
|
+
darkMode:
|
|
194
|
+
!applicationStore.layoutService
|
|
195
|
+
.TEMPORARY__isLightColorThemeEnabled,
|
|
196
|
+
})}
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
202
|
+
},
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
export const renderAccessorQueryBuilderSetupPanelContent = (
|
|
206
|
+
queryBuilderState: AccessorQueryBuilderState,
|
|
207
|
+
): React.ReactNode => (
|
|
208
|
+
<AccessorQueryBuilderSetupPanelContent
|
|
209
|
+
queryBuilderState={queryBuilderState}
|
|
210
|
+
/>
|
|
211
|
+
);
|