@finos/legend-cube-builder 0.0.4 → 0.0.6
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/README.md +9 -3
- package/docs/adding-an-operation.md +24 -12
- package/docs/demo/DEMO-FAST-NOTES.md +67 -0
- package/docs/demo/README.md +102 -0
- package/docs/demo/specs/duckdb-sales-pivot.cube.json +110 -0
- package/docs/demo/specs/trades-desks-1-joined.cube.json +123 -0
- package/docs/demo/specs/trades-desks-2-grouped.cube.json +140 -0
- package/docs/demo/specs/trades-desks-3-ranked.cube.json +158 -0
- package/docs/demo/specs/trades-desks-4-extended.cube.json +208 -0
- package/docs/demo/specs/trades-desks-5-final.cube.json +248 -0
- package/docs/hosting.md +83 -5
- package/docs/testing.md +32 -0
- package/lib/__lib__/LegendCubeCommand.d.ts +2 -0
- package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -1
- package/lib/__lib__/LegendCubeCommand.js +7 -0
- package/lib/__lib__/LegendCubeCommand.js.map +1 -1
- package/lib/__lib__/LegendCubeFunctionLabels.d.ts +29 -0
- package/lib/__lib__/LegendCubeFunctionLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeFunctionLabels.js +31 -0
- package/lib/__lib__/LegendCubeFunctionLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts +5 -1
- package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -1
- package/lib/__lib__/LegendCubeHelpText.js +16 -2
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -1
- package/lib/__lib__/LegendCubeLabels.d.ts +130 -9
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -1
- package/lib/__lib__/LegendCubeLabels.js +169 -17
- package/lib/__lib__/LegendCubeLabels.js.map +1 -1
- package/lib/__lib__/LegendCubeNavigation.d.ts +23 -0
- package/lib/__lib__/LegendCubeNavigation.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeNavigation.js +33 -0
- package/lib/__lib__/LegendCubeNavigation.js.map +1 -0
- package/lib/__lib__/LegendCubeProjectSourceLabels.d.ts +26 -0
- package/lib/__lib__/LegendCubeProjectSourceLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeProjectSourceLabels.js +26 -0
- package/lib/__lib__/LegendCubeProjectSourceLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeServiceLabels.d.ts +27 -0
- package/lib/__lib__/LegendCubeServiceLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeServiceLabels.js +32 -0
- package/lib/__lib__/LegendCubeServiceLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeTesting.d.ts +10 -1
- package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -1
- package/lib/__lib__/LegendCubeTesting.js +9 -0
- package/lib/__lib__/LegendCubeTesting.js.map +1 -1
- package/lib/__lib__/LegendCubeTour.d.ts +62 -0
- package/lib/__lib__/LegendCubeTour.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeTour.js +149 -0
- package/lib/__lib__/LegendCubeTour.js.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts +1 -1
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -1
- package/lib/__test-utils__/CubeEngineTestSupport.js +2 -2
- package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -1
- package/lib/__test-utils__/CubeExampleTestUtils.d.ts +34 -0
- package/lib/__test-utils__/CubeExampleTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeExampleTestUtils.js +72 -0
- package/lib/__test-utils__/CubeExampleTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeExpressionTestUtils.d.ts +8 -1
- package/lib/__test-utils__/CubeExpressionTestUtils.d.ts.map +1 -1
- package/lib/__test-utils__/CubeExpressionTestUtils.js +20 -3
- package/lib/__test-utils__/CubeExpressionTestUtils.js.map +1 -1
- package/lib/__test-utils__/CubeFunctionTestOutline.d.ts +26 -0
- package/lib/__test-utils__/CubeFunctionTestOutline.d.ts.map +1 -0
- package/lib/__test-utils__/CubeFunctionTestOutline.js +56 -0
- package/lib/__test-utils__/CubeFunctionTestOutline.js.map +1 -0
- package/lib/__test-utils__/CubeLambdaCorpus.d.ts +36 -0
- package/lib/__test-utils__/CubeLambdaCorpus.d.ts.map +1 -0
- package/lib/__test-utils__/CubeLambdaCorpus.js +83 -0
- package/lib/__test-utils__/CubeLambdaCorpus.js.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts +6 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -1
- package/lib/__test-utils__/CubePageTestUtils.js +21 -0
- package/lib/__test-utils__/CubePageTestUtils.js.map +1 -1
- package/lib/__test-utils__/CubeTestApplication.d.ts +9 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -1
- package/lib/__test-utils__/CubeTestApplication.js +16 -0
- package/lib/__test-utils__/CubeTestApplication.js.map +1 -1
- package/lib/__test-utils__/CubeVariantTestUtils.d.ts +16 -0
- package/lib/__test-utils__/CubeVariantTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeVariantTestUtils.js +66 -0
- package/lib/__test-utils__/CubeVariantTestUtils.js.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts +5 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -1
- package/lib/__test-utils__/FakeCubeEngine.js +17 -0
- package/lib/__test-utils__/FakeCubeEngine.js.map +1 -1
- package/lib/__test-utils__/FakeCubeIngestCatalog.d.ts +7 -1
- package/lib/__test-utils__/FakeCubeIngestCatalog.d.ts.map +1 -1
- package/lib/__test-utils__/FakeCubeIngestCatalog.js +16 -0
- package/lib/__test-utils__/FakeCubeIngestCatalog.js.map +1 -1
- package/lib/__test-utils__/FakeCubeServiceCatalog.d.ts +26 -0
- package/lib/__test-utils__/FakeCubeServiceCatalog.d.ts.map +1 -0
- package/lib/__test-utils__/FakeCubeServiceCatalog.js +40 -0
- package/lib/__test-utils__/FakeCubeServiceCatalog.js.map +1 -0
- package/lib/components/CubeAddItems.d.ts.map +1 -1
- package/lib/components/CubeAddItems.js +11 -7
- package/lib/components/CubeAddItems.js.map +1 -1
- package/lib/components/CubeDialogTheme.d.ts +25 -0
- package/lib/components/CubeDialogTheme.d.ts.map +1 -0
- package/lib/components/CubeDialogTheme.js +25 -0
- package/lib/components/CubeDialogTheme.js.map +1 -0
- package/lib/components/CubeEditor.d.ts +12 -1
- package/lib/components/CubeEditor.d.ts.map +1 -1
- package/lib/components/CubeEditor.js +22 -14
- package/lib/components/CubeEditor.js.map +1 -1
- package/lib/components/CubeFileMenu.d.ts +28 -0
- package/lib/components/CubeFileMenu.d.ts.map +1 -0
- package/lib/components/CubeFileMenu.js +78 -0
- package/lib/components/CubeFileMenu.js.map +1 -0
- package/lib/components/CubeLambdaImportBanner.d.ts +26 -0
- package/lib/components/CubeLambdaImportBanner.d.ts.map +1 -0
- package/lib/components/CubeLambdaImportBanner.js +47 -0
- package/lib/components/CubeLambdaImportBanner.js.map +1 -0
- package/lib/components/CubeNodeIcon.d.ts.map +1 -1
- package/lib/components/CubeNodeIcon.js +6 -1
- package/lib/components/CubeNodeIcon.js.map +1 -1
- package/lib/components/CubeSchemaColumnsTable.d.ts.map +1 -1
- package/lib/components/CubeSchemaColumnsTable.js +2 -2
- package/lib/components/CubeSchemaColumnsTable.js.map +1 -1
- package/lib/components/canvas/CubeCanvas.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvas.js +40 -6
- package/lib/components/canvas/CubeCanvas.js.map +1 -1
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvasContextMenu.js +2 -1
- package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -1
- package/lib/components/canvas/CubeCanvasElements.d.ts +18 -1
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvasElements.js +58 -3
- package/lib/components/canvas/CubeCanvasElements.js.map +1 -1
- package/lib/components/canvas/CubeCanvasLayout.js +1 -1
- package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvasNode.js +11 -4
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -1
- package/lib/components/dev-settings/CubeDevSettings.d.ts +35 -0
- package/lib/components/dev-settings/CubeDevSettings.d.ts.map +1 -0
- package/lib/components/dev-settings/CubeDevSettings.js +54 -0
- package/lib/components/dev-settings/CubeDevSettings.js.map +1 -0
- package/lib/components/editors/CubeColumnChecklist.d.ts.map +1 -1
- package/lib/components/editors/CubeColumnChecklist.js +2 -2
- package/lib/components/editors/CubeColumnChecklist.js.map +1 -1
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -1
- package/lib/components/editors/CubeColumnPicker.js +6 -4
- package/lib/components/editors/CubeColumnPicker.js.map +1 -1
- package/lib/components/editors/CubeConcatEditor.js +2 -2
- package/lib/components/editors/CubeConcatEditor.js.map +1 -1
- package/lib/components/editors/CubeExplodeEditor.d.ts +26 -0
- package/lib/components/editors/CubeExplodeEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeExplodeEditor.js +61 -0
- package/lib/components/editors/CubeExplodeEditor.js.map +1 -0
- package/lib/components/editors/CubeExpressionFilterEditor.d.ts +25 -0
- package/lib/components/editors/CubeExpressionFilterEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeExpressionFilterEditor.js +86 -0
- package/lib/components/editors/CubeExpressionFilterEditor.js.map +1 -0
- package/lib/components/editors/CubeExtendEditor.d.ts.map +1 -1
- package/lib/components/editors/CubeExtendEditor.js +13 -12
- package/lib/components/editors/CubeExtendEditor.js.map +1 -1
- package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -1
- package/lib/components/editors/CubeFilterEditor.js +13 -2
- package/lib/components/editors/CubeFilterEditor.js.map +1 -1
- package/lib/components/editors/CubeFunctionSourceEditor.d.ts +25 -0
- package/lib/components/editors/CubeFunctionSourceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeFunctionSourceEditor.js +55 -0
- package/lib/components/editors/CubeFunctionSourceEditor.js.map +1 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -1
- package/lib/components/editors/CubeJoinEditor.js +16 -4
- package/lib/components/editors/CubeJoinEditor.js.map +1 -1
- package/lib/components/editors/CubeJsonFieldsTree.d.ts +46 -0
- package/lib/components/editors/CubeJsonFieldsTree.d.ts.map +1 -0
- package/lib/components/editors/CubeJsonFieldsTree.js +93 -0
- package/lib/components/editors/CubeJsonFieldsTree.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -1
- package/lib/components/editors/CubeNodeEditorPanel.js +18 -8
- package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -1
- package/lib/components/editors/CubeNodeEditorPopper.d.ts +5 -1
- package/lib/components/editors/CubeNodeEditorPopper.d.ts.map +1 -1
- package/lib/components/editors/CubeNodeEditorPopper.js +10 -2
- package/lib/components/editors/CubeNodeEditorPopper.js.map +1 -1
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -1
- package/lib/components/editors/CubeNodeEditorRegistry.js +11 -1
- package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -1
- package/lib/components/editors/CubePivotEditor.d.ts +26 -0
- package/lib/components/editors/CubePivotEditor.d.ts.map +1 -0
- package/lib/components/editors/CubePivotEditor.js +93 -0
- package/lib/components/editors/CubePivotEditor.js.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -1
- package/lib/components/editors/CubeRestrictEditor.js +2 -2
- package/lib/components/editors/CubeRestrictEditor.js.map +1 -1
- package/lib/components/editors/CubeServiceSourceEditor.d.ts +25 -0
- package/lib/components/editors/CubeServiceSourceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeServiceSourceEditor.js +41 -0
- package/lib/components/editors/CubeServiceSourceEditor.js.map +1 -0
- package/lib/components/grid/CubeColumnFormatDialog.d.ts +28 -0
- package/lib/components/grid/CubeColumnFormatDialog.d.ts.map +1 -0
- package/lib/components/grid/CubeColumnFormatDialog.js +94 -0
- package/lib/components/grid/CubeColumnFormatDialog.js.map +1 -0
- package/lib/components/grid/CubeDrilldownBar.d.ts +37 -0
- package/lib/components/grid/CubeDrilldownBar.d.ts.map +1 -0
- package/lib/components/grid/CubeDrilldownBar.js +77 -0
- package/lib/components/grid/CubeDrilldownBar.js.map +1 -0
- package/lib/components/grid/CubeGridRegion.d.ts.map +1 -1
- package/lib/components/grid/CubeGridRegion.js +43 -28
- package/lib/components/grid/CubeGridRegion.js.map +1 -1
- package/lib/components/grid/CubeGridValues.d.ts +36 -4
- package/lib/components/grid/CubeGridValues.d.ts.map +1 -1
- package/lib/components/grid/CubeGridValues.js +116 -4
- package/lib/components/grid/CubeGridValues.js.map +1 -1
- package/lib/components/grid/CubeJsonExplorerDialog.d.ts +27 -0
- package/lib/components/grid/CubeJsonExplorerDialog.d.ts.map +1 -0
- package/lib/components/grid/CubeJsonExplorerDialog.js +102 -0
- package/lib/components/grid/CubeJsonExplorerDialog.js.map +1 -0
- package/lib/components/grid/CubeJsonViewerDialog.d.ts +27 -0
- package/lib/components/grid/CubeJsonViewerDialog.d.ts.map +1 -0
- package/lib/components/grid/CubeJsonViewerDialog.js +68 -0
- package/lib/components/grid/CubeJsonViewerDialog.js.map +1 -0
- package/lib/components/grid/CubeResultGrid.d.ts +81 -6
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -1
- package/lib/components/grid/CubeResultGrid.js +400 -35
- package/lib/components/grid/CubeResultGrid.js.map +1 -1
- package/lib/components/grid/CubeRunStatsPanel.d.ts +28 -0
- package/lib/components/grid/CubeRunStatsPanel.d.ts.map +1 -0
- package/lib/components/grid/CubeRunStatsPanel.js +61 -0
- package/lib/components/grid/CubeRunStatsPanel.js.map +1 -0
- package/lib/components/grid/CubeServerSideGrid.d.ts +36 -0
- package/lib/components/grid/CubeServerSideGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeServerSideGrid.js +116 -0
- package/lib/components/grid/CubeServerSideGrid.js.map +1 -0
- package/lib/components/grid/CubeSqlDialog.d.ts +24 -0
- package/lib/components/grid/CubeSqlDialog.d.ts.map +1 -0
- package/lib/components/grid/CubeSqlDialog.js +39 -0
- package/lib/components/grid/CubeSqlDialog.js.map +1 -0
- package/lib/components/grid/CubeSqlFormat.d.ts +20 -0
- package/lib/components/grid/CubeSqlFormat.d.ts.map +1 -0
- package/lib/components/grid/CubeSqlFormat.js +32 -0
- package/lib/components/grid/CubeSqlFormat.js.map +1 -0
- package/lib/components/palette/CubePalette.d.ts.map +1 -1
- package/lib/components/palette/CubePalette.js +36 -14
- package/lib/components/palette/CubePalette.js.map +1 -1
- package/lib/components/show-pure/CubeShowPureDialog.d.ts +4 -1
- package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -1
- package/lib/components/show-pure/CubeShowPureDialog.js +8 -4
- package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -1
- package/lib/components/source-picker/CubeDataProductTab.d.ts.map +1 -1
- package/lib/components/source-picker/CubeDataProductTab.js +37 -16
- package/lib/components/source-picker/CubeDataProductTab.js.map +1 -1
- package/lib/components/source-picker/CubeDirectConnectionTab.d.ts.map +1 -1
- package/lib/components/source-picker/CubeDirectConnectionTab.js +6 -4
- package/lib/components/source-picker/CubeDirectConnectionTab.js.map +1 -1
- package/lib/components/source-picker/CubeFunctionSteps.d.ts +36 -0
- package/lib/components/source-picker/CubeFunctionSteps.d.ts.map +1 -0
- package/lib/components/source-picker/CubeFunctionSteps.js +76 -0
- package/lib/components/source-picker/CubeFunctionSteps.js.map +1 -0
- package/lib/components/source-picker/CubeIngestTab.d.ts +2 -2
- package/lib/components/source-picker/CubeIngestTab.d.ts.map +1 -1
- package/lib/components/source-picker/CubeIngestTab.js +49 -20
- package/lib/components/source-picker/CubeIngestTab.js.map +1 -1
- package/lib/components/source-picker/CubeInlineModelTab.d.ts +3 -2
- package/lib/components/source-picker/CubeInlineModelTab.d.ts.map +1 -1
- package/lib/components/source-picker/CubeInlineModelTab.js +23 -13
- package/lib/components/source-picker/CubeInlineModelTab.js.map +1 -1
- package/lib/components/source-picker/CubePickerListItem.d.ts +47 -0
- package/lib/components/source-picker/CubePickerListItem.d.ts.map +1 -0
- package/lib/components/source-picker/CubePickerListItem.js +62 -0
- package/lib/components/source-picker/CubePickerListItem.js.map +1 -0
- package/lib/components/source-picker/CubeProjectTab.d.ts +4 -3
- package/lib/components/source-picker/CubeProjectTab.d.ts.map +1 -1
- package/lib/components/source-picker/CubeProjectTab.js +7 -4
- package/lib/components/source-picker/CubeProjectTab.js.map +1 -1
- package/lib/components/source-picker/CubeServiceTab.d.ts +27 -0
- package/lib/components/source-picker/CubeServiceTab.d.ts.map +1 -0
- package/lib/components/source-picker/CubeServiceTab.js +36 -0
- package/lib/components/source-picker/CubeServiceTab.js.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -1
- package/lib/components/source-picker/CubeSourcePicker.js +16 -3
- package/lib/components/source-picker/CubeSourcePicker.js.map +1 -1
- package/lib/components/source-picker/CubeTablePreview.d.ts +29 -0
- package/lib/components/source-picker/CubeTablePreview.d.ts.map +1 -0
- package/lib/components/source-picker/CubeTablePreview.js +10 -0
- package/lib/components/source-picker/CubeTablePreview.js.map +1 -0
- package/lib/components/spec-transfer/CubeImportPureDialog.d.ts +27 -0
- package/lib/components/spec-transfer/CubeImportPureDialog.d.ts.map +1 -0
- package/lib/components/spec-transfer/CubeImportPureDialog.js +38 -0
- package/lib/components/spec-transfer/CubeImportPureDialog.js.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -1
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js +9 -3
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -1
- package/lib/components/tour/CubeTour.d.ts +36 -0
- package/lib/components/tour/CubeTour.d.ts.map +1 -0
- package/lib/components/tour/CubeTour.js +183 -0
- package/lib/components/tour/CubeTour.js.map +1 -0
- package/lib/graph-manager/CubeDataProductCatalog.d.ts +10 -0
- package/lib/graph-manager/CubeDataProductCatalog.d.ts.map +1 -1
- package/lib/graph-manager/CubeDataProductCatalog.js.map +1 -1
- package/lib/graph-manager/CubeEngine.d.ts +46 -1
- package/lib/graph-manager/CubeEngine.d.ts.map +1 -1
- package/lib/graph-manager/CubeEngine.js.map +1 -1
- package/lib/graph-manager/CubeEngineClientSettings.d.ts +43 -0
- package/lib/graph-manager/CubeEngineClientSettings.d.ts.map +1 -0
- package/lib/graph-manager/CubeEngineClientSettings.js +51 -0
- package/lib/graph-manager/CubeEngineClientSettings.js.map +1 -0
- package/lib/graph-manager/CubeIngest.d.ts +5 -0
- package/lib/graph-manager/CubeIngest.d.ts.map +1 -1
- package/lib/graph-manager/CubeIngest.js +10 -0
- package/lib/graph-manager/CubeIngest.js.map +1 -1
- package/lib/graph-manager/CubeIngestCatalog.d.ts +26 -0
- package/lib/graph-manager/CubeIngestCatalog.d.ts.map +1 -1
- package/lib/graph-manager/CubeIngestCatalog.js +6 -0
- package/lib/graph-manager/CubeIngestCatalog.js.map +1 -1
- package/lib/graph-manager/CubeLakehouseRuntime.d.ts +29 -0
- package/lib/graph-manager/CubeLakehouseRuntime.d.ts.map +1 -0
- package/lib/graph-manager/CubeLakehouseRuntime.js +40 -0
- package/lib/graph-manager/CubeLakehouseRuntime.js.map +1 -0
- package/lib/graph-manager/CubeProjectCatalog.d.ts +3 -3
- package/lib/graph-manager/CubeService.d.ts +20 -0
- package/lib/graph-manager/CubeService.d.ts.map +1 -0
- package/lib/graph-manager/CubeService.js +22 -0
- package/lib/graph-manager/CubeService.js.map +1 -0
- package/lib/graph-manager/CubeServiceCatalog.d.ts +31 -0
- package/lib/graph-manager/CubeServiceCatalog.d.ts.map +1 -0
- package/lib/graph-manager/CubeServiceCatalog.js +17 -0
- package/lib/graph-manager/CubeServiceCatalog.js.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +52 -5
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +63 -5
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.d.ts +9 -6
- package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.js +12 -8
- package/lib/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.d.ts +30 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.js +229 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.js +18 -9
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.d.ts +4 -9
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.js +2 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeIngestModel.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.d.ts +34 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.js +332 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +49 -10
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +3 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.d.ts +2 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.js +2 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +18 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +74 -6
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.js +7 -4
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.d.ts +31 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.js +69 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +6 -2
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +13 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -1
- package/lib/index.js.map +1 -1
- package/lib/stores/CubeAddPlacement.d.ts +10 -3
- package/lib/stores/CubeAddPlacement.d.ts.map +1 -1
- package/lib/stores/CubeAddPlacement.js +16 -5
- package/lib/stores/CubeAddPlacement.js.map +1 -1
- package/lib/stores/CubeDevSettingsState.d.ts +47 -0
- package/lib/stores/CubeDevSettingsState.d.ts.map +1 -0
- package/lib/stores/CubeDevSettingsState.js +99 -0
- package/lib/stores/CubeDevSettingsState.js.map +1 -0
- package/lib/stores/CubeEditorState.d.ts +189 -43
- package/lib/stores/CubeEditorState.d.ts.map +1 -1
- package/lib/stores/CubeEditorState.js +532 -117
- package/lib/stores/CubeEditorState.js.map +1 -1
- package/lib/stores/CubeEngineChecks.d.ts +59 -0
- package/lib/stores/CubeEngineChecks.d.ts.map +1 -0
- package/lib/stores/CubeEngineChecks.js +100 -0
- package/lib/stores/CubeEngineChecks.js.map +1 -0
- package/lib/stores/CubeExamples.d.ts.map +1 -1
- package/lib/stores/CubeExamples.js +136 -2
- package/lib/stores/CubeExamples.js.map +1 -1
- package/lib/stores/CubeExamplesState.d.ts +1 -1
- package/lib/stores/CubeExamplesState.d.ts.map +1 -1
- package/lib/stores/CubeExamplesState.js +6 -3
- package/lib/stores/CubeExamplesState.js.map +1 -1
- package/lib/stores/CubeExecutionState.d.ts.map +1 -1
- package/lib/stores/CubeExecutionState.js +24 -33
- package/lib/stores/CubeExecutionState.js.map +1 -1
- package/lib/stores/CubeExportState.d.ts +41 -0
- package/lib/stores/CubeExportState.d.ts.map +1 -0
- package/lib/stores/CubeExportState.js +134 -0
- package/lib/stores/CubeExportState.js.map +1 -0
- package/lib/stores/CubeExpressionFilterCheck.d.ts +51 -0
- package/lib/stores/CubeExpressionFilterCheck.d.ts.map +1 -0
- package/lib/stores/CubeExpressionFilterCheck.js +134 -0
- package/lib/stores/CubeExpressionFilterCheck.js.map +1 -0
- package/lib/stores/CubeExtendTyping.d.ts +6 -14
- package/lib/stores/CubeExtendTyping.d.ts.map +1 -1
- package/lib/stores/CubeExtendTyping.js +6 -33
- package/lib/stores/CubeExtendTyping.js.map +1 -1
- package/lib/stores/CubeFunctionRecheck.d.ts +30 -0
- package/lib/stores/CubeFunctionRecheck.d.ts.map +1 -0
- package/lib/stores/CubeFunctionRecheck.js +67 -0
- package/lib/stores/CubeFunctionRecheck.js.map +1 -0
- package/lib/stores/CubeGridFetcher.d.ts +75 -0
- package/lib/stores/CubeGridFetcher.d.ts.map +1 -0
- package/lib/stores/CubeGridFetcher.js +197 -0
- package/lib/stores/CubeGridFetcher.js.map +1 -0
- package/lib/stores/CubeGridQuickActions.d.ts +25 -6
- package/lib/stores/CubeGridQuickActions.d.ts.map +1 -1
- package/lib/stores/CubeGridQuickActions.js +52 -23
- package/lib/stores/CubeGridQuickActions.js.map +1 -1
- package/lib/stores/CubeGridState.d.ts +136 -0
- package/lib/stores/CubeGridState.d.ts.map +1 -0
- package/lib/stores/CubeGridState.js +317 -0
- package/lib/stores/CubeGridState.js.map +1 -0
- package/lib/stores/CubeHost.d.ts +42 -0
- package/lib/stores/CubeHost.d.ts.map +1 -1
- package/lib/stores/CubeHost.js +4 -0
- package/lib/stores/CubeHost.js.map +1 -1
- package/lib/stores/CubeLambdaImportState.d.ts +118 -0
- package/lib/stores/CubeLambdaImportState.d.ts.map +1 -0
- package/lib/stores/CubeLambdaImportState.js +302 -0
- package/lib/stores/CubeLambdaImportState.js.map +1 -0
- package/lib/stores/CubeLambdaSources.d.ts +45 -0
- package/lib/stores/CubeLambdaSources.d.ts.map +1 -0
- package/lib/stores/CubeLambdaSources.js +261 -0
- package/lib/stores/CubeLambdaSources.js.map +1 -0
- package/lib/stores/CubePureText.d.ts +20 -0
- package/lib/stores/CubePureText.d.ts.map +1 -0
- package/lib/stores/CubePureText.js +24 -0
- package/lib/stores/CubePureText.js.map +1 -0
- package/lib/stores/CubeQueryRun.d.ts +59 -0
- package/lib/stores/CubeQueryRun.d.ts.map +1 -0
- package/lib/stores/CubeQueryRun.js +101 -0
- package/lib/stores/CubeQueryRun.js.map +1 -0
- package/lib/stores/CubeRunStatsState.d.ts +61 -0
- package/lib/stores/CubeRunStatsState.d.ts.map +1 -0
- package/lib/stores/CubeRunStatsState.js +54 -0
- package/lib/stores/CubeRunStatsState.js.map +1 -0
- package/lib/stores/CubeRunningStepLambda.d.ts +25 -0
- package/lib/stores/CubeRunningStepLambda.d.ts.map +1 -0
- package/lib/stores/CubeRunningStepLambda.js +45 -0
- package/lib/stores/CubeRunningStepLambda.js.map +1 -0
- package/lib/stores/CubeServiceRecheck.d.ts +29 -0
- package/lib/stores/CubeServiceRecheck.d.ts.map +1 -0
- package/lib/stores/CubeServiceRecheck.js +33 -0
- package/lib/stores/CubeServiceRecheck.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +14 -1
- package/lib/stores/CubeShowPureState.d.ts.map +1 -1
- package/lib/stores/CubeShowPureState.js +41 -11
- package/lib/stores/CubeShowPureState.js.map +1 -1
- package/lib/stores/CubeSourcePickerState.d.ts +20 -4
- package/lib/stores/CubeSourcePickerState.d.ts.map +1 -1
- package/lib/stores/CubeSourcePickerState.js +75 -14
- package/lib/stores/CubeSourcePickerState.js.map +1 -1
- package/lib/stores/CubeTourState.d.ts +49 -0
- package/lib/stores/CubeTourState.d.ts.map +1 -0
- package/lib/stores/CubeTourState.js +92 -0
- package/lib/stores/CubeTourState.js.map +1 -0
- package/lib/stores/LegendCubeHost.d.ts +88 -0
- package/lib/stores/LegendCubeHost.d.ts.map +1 -0
- package/lib/stores/LegendCubeHost.js +149 -0
- package/lib/stores/LegendCubeHost.js.map +1 -0
- package/lib/stores/LocalModelCatalog.d.ts.map +1 -1
- package/lib/stores/LocalModelCatalog.js +3 -1
- package/lib/stores/LocalModelCatalog.js.map +1 -1
- package/lib/stores/editors/CubeExplodeDraft.d.ts +87 -0
- package/lib/stores/editors/CubeExplodeDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeExplodeDraft.js +221 -0
- package/lib/stores/editors/CubeExplodeDraft.js.map +1 -0
- package/lib/stores/editors/CubeExpressionFilterDraft.d.ts +94 -0
- package/lib/stores/editors/CubeExpressionFilterDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeExpressionFilterDraft.js +258 -0
- package/lib/stores/editors/CubeExpressionFilterDraft.js.map +1 -0
- package/lib/stores/editors/CubeExtendDraft.d.ts +9 -0
- package/lib/stores/editors/CubeExtendDraft.d.ts.map +1 -1
- package/lib/stores/editors/CubeExtendDraft.js +26 -0
- package/lib/stores/editors/CubeExtendDraft.js.map +1 -1
- package/lib/stores/editors/CubeFunctionDraft.d.ts +34 -0
- package/lib/stores/editors/CubeFunctionDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeFunctionDraft.js +69 -0
- package/lib/stores/editors/CubeFunctionDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +4 -2
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -1
- package/lib/stores/editors/CubeNodeDraftRegistry.js +25 -3
- package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -1
- package/lib/stores/editors/CubePivotDraft.d.ts +93 -0
- package/lib/stores/editors/CubePivotDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubePivotDraft.js +267 -0
- package/lib/stores/editors/CubePivotDraft.js.map +1 -0
- package/lib/stores/fixtures/CubeSalesDuckDbModel.d.ts +27 -0
- package/lib/stores/fixtures/CubeSalesDuckDbModel.d.ts.map +1 -0
- package/lib/stores/fixtures/CubeSalesDuckDbModel.js +52 -0
- package/lib/stores/fixtures/CubeSalesDuckDbModel.js.map +1 -0
- package/lib/stores/fixtures/CubeTradesModel.d.ts +4 -0
- package/lib/stores/fixtures/CubeTradesModel.d.ts.map +1 -1
- package/lib/stores/fixtures/CubeTradesModel.js +31 -1
- package/lib/stores/fixtures/CubeTradesModel.js.map +1 -1
- package/lib/stores/source-picker/CubeDataProductTabState.d.ts +34 -5
- package/lib/stores/source-picker/CubeDataProductTabState.d.ts.map +1 -1
- package/lib/stores/source-picker/CubeDataProductTabState.js +111 -26
- package/lib/stores/source-picker/CubeDataProductTabState.js.map +1 -1
- package/lib/stores/source-picker/CubeDirectConnectionTabState.d.ts +25 -2
- package/lib/stores/source-picker/CubeDirectConnectionTabState.d.ts.map +1 -1
- package/lib/stores/source-picker/CubeDirectConnectionTabState.js +183 -31
- package/lib/stores/source-picker/CubeDirectConnectionTabState.js.map +1 -1
- package/lib/stores/source-picker/CubeIngestTabState.d.ts +62 -15
- package/lib/stores/source-picker/CubeIngestTabState.d.ts.map +1 -1
- package/lib/stores/source-picker/CubeIngestTabState.js +212 -60
- package/lib/stores/source-picker/CubeIngestTabState.js.map +1 -1
- package/lib/stores/source-picker/CubeInlineModelTabState.d.ts +100 -4
- package/lib/stores/source-picker/CubeInlineModelTabState.d.ts.map +1 -1
- package/lib/stores/source-picker/CubeInlineModelTabState.js +415 -28
- package/lib/stores/source-picker/CubeInlineModelTabState.js.map +1 -1
- package/lib/stores/source-picker/CubeProjectTabState.d.ts +18 -3
- package/lib/stores/source-picker/CubeProjectTabState.d.ts.map +1 -1
- package/lib/stores/source-picker/CubeProjectTabState.js +26 -1
- package/lib/stores/source-picker/CubeProjectTabState.js.map +1 -1
- package/lib/stores/source-picker/CubeServiceTabState.d.ts +74 -0
- package/lib/stores/source-picker/CubeServiceTabState.d.ts.map +1 -0
- package/lib/stores/source-picker/CubeServiceTabState.js +216 -0
- package/lib/stores/source-picker/CubeServiceTabState.js.map +1 -0
- package/lib/stores/source-picker/CubeSourcePickerTab.d.ts +15 -3
- package/lib/stores/source-picker/CubeSourcePickerTab.d.ts.map +1 -1
- package/lib/stores/source-picker/CubeSourcePickerTab.js +21 -0
- package/lib/stores/source-picker/CubeSourcePickerTab.js.map +1 -1
- package/lib/stores/variant/CubeJson.d.ts +48 -0
- package/lib/stores/variant/CubeJson.d.ts.map +1 -0
- package/lib/stores/variant/CubeJson.js +207 -0
- package/lib/stores/variant/CubeJson.js.map +1 -0
- package/lib/stores/variant/CubeJsonExplorerState.d.ts +88 -0
- package/lib/stores/variant/CubeJsonExplorerState.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonExplorerState.js +297 -0
- package/lib/stores/variant/CubeJsonExplorerState.js.map +1 -0
- package/lib/stores/variant/CubeJsonFieldsState.d.ts +83 -0
- package/lib/stores/variant/CubeJsonFieldsState.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonFieldsState.js +207 -0
- package/lib/stores/variant/CubeJsonFieldsState.js.map +1 -0
- package/lib/stores/variant/CubeJsonOffers.d.ts +76 -0
- package/lib/stores/variant/CubeJsonOffers.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonOffers.js +250 -0
- package/lib/stores/variant/CubeJsonOffers.js.map +1 -0
- package/lib/stores/variant/CubeJsonParse.d.ts +28 -0
- package/lib/stores/variant/CubeJsonParse.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonParse.js +53 -0
- package/lib/stores/variant/CubeJsonParse.js.map +1 -0
- package/lib/stores/variant/CubeJsonSampling.d.ts +41 -0
- package/lib/stores/variant/CubeJsonSampling.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonSampling.js +59 -0
- package/lib/stores/variant/CubeJsonSampling.js.map +1 -0
- package/lib/stores/variant/CubeJsonShape.d.ts +87 -0
- package/lib/stores/variant/CubeJsonShape.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonShape.js +209 -0
- package/lib/stores/variant/CubeJsonShape.js.map +1 -0
- package/lib/stores/variant/CubeJsonViewerState.d.ts +33 -0
- package/lib/stores/variant/CubeJsonViewerState.d.ts.map +1 -0
- package/lib/stores/variant/CubeJsonViewerState.js +53 -0
- package/lib/stores/variant/CubeJsonViewerState.js.map +1 -0
- package/package.json +10 -9
- package/src/__lib__/LegendCubeCommand.ts +7 -0
- package/src/__lib__/LegendCubeFunctionLabels.ts +41 -0
- package/src/__lib__/LegendCubeHelpText.ts +27 -1
- package/src/__lib__/LegendCubeLabels.ts +225 -16
- package/src/__lib__/LegendCubeNavigation.ts +48 -0
- package/src/__lib__/LegendCubeProjectSourceLabels.ts +26 -0
- package/src/__lib__/LegendCubeServiceLabels.ts +41 -0
- package/src/__lib__/LegendCubeTesting.ts +9 -0
- package/src/__lib__/LegendCubeTour.ts +173 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +2 -1
- package/src/__test-utils__/CubeExampleTestUtils.ts +119 -0
- package/src/__test-utils__/CubeExpressionTestUtils.ts +29 -2
- package/src/__test-utils__/CubeFunctionTestOutline.ts +78 -0
- package/src/__test-utils__/CubeLambdaCorpus.ts +137 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +34 -0
- package/src/__test-utils__/CubeTestApplication.ts +25 -0
- package/src/__test-utils__/CubeVariantTestUtils.ts +103 -0
- package/src/__test-utils__/FakeCubeEngine.ts +27 -0
- package/src/__test-utils__/FakeCubeIngestCatalog.ts +18 -0
- package/src/__test-utils__/FakeCubeServiceCatalog.ts +57 -0
- package/src/components/CubeAddItems.tsx +15 -6
- package/src/components/CubeDialogTheme.ts +25 -0
- package/src/components/CubeEditor.tsx +170 -129
- package/src/components/CubeFileMenu.tsx +129 -0
- package/src/components/CubeLambdaImportBanner.tsx +97 -0
- package/src/components/CubeNodeIcon.tsx +9 -0
- package/src/components/CubeSchemaColumnsTable.tsx +7 -2
- package/src/components/canvas/CubeCanvas.tsx +65 -10
- package/src/components/canvas/CubeCanvasContextMenu.tsx +33 -2
- package/src/components/canvas/CubeCanvasElements.ts +76 -3
- package/src/components/canvas/CubeCanvasLayout.ts +1 -1
- package/src/components/canvas/CubeCanvasNode.tsx +37 -3
- package/src/components/dev-settings/CubeDevSettings.tsx +169 -0
- package/src/components/editors/CubeColumnChecklist.tsx +8 -2
- package/src/components/editors/CubeColumnPicker.tsx +9 -3
- package/src/components/editors/CubeConcatEditor.tsx +2 -2
- package/src/components/editors/CubeExplodeEditor.tsx +207 -0
- package/src/components/editors/CubeExpressionFilterEditor.tsx +210 -0
- package/src/components/editors/CubeExtendEditor.tsx +34 -21
- package/src/components/editors/CubeFilterEditor.tsx +13 -1
- package/src/components/editors/CubeFunctionSourceEditor.tsx +140 -0
- package/src/components/editors/CubeJoinEditor.tsx +23 -4
- package/src/components/editors/CubeJsonFieldsTree.tsx +316 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +22 -10
- package/src/components/editors/CubeNodeEditorPopper.tsx +9 -1
- package/src/components/editors/CubeNodeEditorRegistry.ts +15 -0
- package/src/components/editors/CubePivotEditor.tsx +277 -0
- package/src/components/editors/CubeRestrictEditor.tsx +8 -2
- package/src/components/editors/CubeServiceSourceEditor.tsx +77 -0
- package/src/components/grid/CubeColumnFormatDialog.tsx +289 -0
- package/src/components/grid/CubeDrilldownBar.tsx +219 -0
- package/src/components/grid/CubeGridRegion.tsx +190 -56
- package/src/components/grid/CubeGridValues.ts +154 -4
- package/src/components/grid/CubeJsonExplorerDialog.tsx +304 -0
- package/src/components/grid/CubeJsonViewerDialog.tsx +190 -0
- package/src/components/grid/CubeResultGrid.tsx +586 -42
- package/src/components/grid/CubeRunStatsPanel.tsx +156 -0
- package/src/components/grid/CubeServerSideGrid.tsx +213 -0
- package/src/components/grid/CubeSqlDialog.tsx +90 -0
- package/src/components/grid/CubeSqlFormat.ts +37 -0
- package/src/components/palette/CubePalette.tsx +54 -12
- package/src/components/show-pure/CubeShowPureDialog.tsx +19 -5
- package/src/components/source-picker/CubeDataProductTab.tsx +169 -75
- package/src/components/source-picker/CubeDirectConnectionTab.tsx +42 -30
- package/src/components/source-picker/CubeFunctionSteps.tsx +244 -0
- package/src/components/source-picker/CubeIngestTab.tsx +195 -83
- package/src/components/source-picker/CubeInlineModelTab.tsx +110 -81
- package/src/components/source-picker/CubePickerListItem.tsx +118 -0
- package/src/components/source-picker/CubeProjectTab.tsx +6 -3
- package/src/components/source-picker/CubeServiceTab.tsx +151 -0
- package/src/components/source-picker/CubeSourcePicker.tsx +54 -18
- package/src/components/source-picker/CubeTablePreview.tsx +49 -0
- package/src/components/spec-transfer/CubeImportPureDialog.tsx +122 -0
- package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +21 -8
- package/src/components/tour/CubeTour.tsx +317 -0
- package/src/graph-manager/CubeDataProductCatalog.ts +11 -0
- package/src/graph-manager/CubeEngine.ts +51 -1
- package/src/graph-manager/CubeEngineClientSettings.ts +64 -0
- package/src/graph-manager/CubeIngest.ts +15 -0
- package/src/graph-manager/CubeIngestCatalog.ts +33 -0
- package/src/graph-manager/CubeLakehouseRuntime.ts +43 -0
- package/src/graph-manager/CubeProjectCatalog.ts +3 -3
- package/src/graph-manager/CubeService.ts +29 -0
- package/src/graph-manager/CubeServiceCatalog.ts +35 -0
- package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +115 -5
- package/src/graph-manager/protocol/pure/v1/V1_CubeDataProductModel.ts +13 -7
- package/src/graph-manager/protocol/pure/v1/V1_CubeFunctionOutlineBuilder.ts +312 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeIngestDefinition.ts +35 -9
- package/src/graph-manager/protocol/pure/v1/V1_CubeIngestModel.ts +6 -15
- package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaReader.ts +471 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +70 -15
- package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +3 -1
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeConnectionExplorer.ts +7 -1
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +122 -7
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeProjectCatalog.ts +9 -4
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeServiceCatalog.ts +92 -0
- package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +6 -1
- package/src/index.ts +39 -2
- package/src/stores/CubeAddPlacement.ts +25 -5
- package/src/stores/CubeDevSettingsState.ts +117 -0
- package/src/stores/CubeEditorState.ts +722 -201
- package/src/stores/CubeEngineChecks.ts +240 -0
- package/src/stores/CubeExamples.ts +188 -1
- package/src/stores/CubeExamplesState.ts +13 -3
- package/src/stores/CubeExecutionState.ts +26 -57
- package/src/stores/CubeExportState.ts +196 -0
- package/src/stores/CubeExpressionFilterCheck.ts +218 -0
- package/src/stores/CubeExtendTyping.ts +6 -46
- package/src/stores/CubeFunctionRecheck.ts +97 -0
- package/src/stores/CubeGridFetcher.ts +302 -0
- package/src/stores/CubeGridQuickActions.ts +56 -23
- package/src/stores/CubeGridState.ts +450 -0
- package/src/stores/CubeHost.ts +48 -0
- package/src/stores/CubeLambdaImportState.ts +434 -0
- package/src/stores/CubeLambdaSources.ts +390 -0
- package/src/stores/CubePureText.ts +28 -0
- package/src/stores/CubeQueryRun.ts +169 -0
- package/src/stores/CubeRunStatsState.ts +91 -0
- package/src/stores/CubeRunningStepLambda.ts +62 -0
- package/src/stores/CubeServiceRecheck.ts +53 -0
- package/src/stores/CubeShowPureState.ts +51 -12
- package/src/stores/CubeSourcePickerState.ts +89 -13
- package/src/stores/CubeTourState.ts +116 -0
- package/src/stores/LegendCubeHost.ts +243 -0
- package/src/stores/LocalModelCatalog.ts +6 -1
- package/src/stores/editors/CubeExplodeDraft.ts +272 -0
- package/src/stores/editors/CubeExpressionFilterDraft.ts +389 -0
- package/src/stores/editors/CubeExtendDraft.ts +29 -0
- package/src/stores/editors/CubeFunctionDraft.ts +92 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +34 -2
- package/src/stores/editors/CubePivotDraft.ts +355 -0
- package/src/stores/fixtures/CubeSalesDuckDbModel.ts +60 -0
- package/src/stores/fixtures/CubeTradesModel.ts +36 -1
- package/src/stores/source-picker/CubeDataProductTabState.ts +162 -35
- package/src/stores/source-picker/CubeDirectConnectionTabState.ts +246 -47
- package/src/stores/source-picker/CubeIngestTabState.ts +331 -106
- package/src/stores/source-picker/CubeInlineModelTabState.ts +514 -34
- package/src/stores/source-picker/CubeProjectTabState.ts +35 -3
- package/src/stores/source-picker/CubeServiceTabState.ts +288 -0
- package/src/stores/source-picker/CubeSourcePickerTab.ts +31 -2
- package/src/stores/variant/CubeJson.ts +229 -0
- package/src/stores/variant/CubeJsonExplorerState.ts +378 -0
- package/src/stores/variant/CubeJsonFieldsState.ts +252 -0
- package/src/stores/variant/CubeJsonOffers.ts +359 -0
- package/src/stores/variant/CubeJsonParse.ts +75 -0
- package/src/stores/variant/CubeJsonSampling.ts +90 -0
- package/src/stores/variant/CubeJsonShape.ts +279 -0
- package/src/stores/variant/CubeJsonViewerState.ts +59 -0
- package/tsconfig.json +72 -1
|
@@ -20,7 +20,7 @@ import { guaranteeType, noop } from '@finos/legend-shared';
|
|
|
20
20
|
import { flowResult } from 'mobx';
|
|
21
21
|
import { observer } from 'mobx-react-lite';
|
|
22
22
|
import { useEffect } from 'react';
|
|
23
|
-
import { CONCAT_CONVERT_FIX_TEXT, CONCAT_CONVERT_FIX_TITLE, CONCAT_CONVERT_TYPES_HINT, CONCAT_EDITOR_TEXT, CONCAT_FIX_NEEDS_CONVERT_TEXT, CONCAT_RENAME_FIX_TEXT, CONCAT_RENAME_FIX_TITLE, CUBE_TABLE_FLAG_LABELS,
|
|
23
|
+
import { CONCAT_CONVERT_FIX_TEXT, CONCAT_CONVERT_FIX_TITLE, CONCAT_CONVERT_TYPES_HINT, CONCAT_EDITOR_TEXT, CONCAT_FIX_NEEDS_CONVERT_TEXT, CONCAT_RENAME_FIX_TEXT, CONCAT_RENAME_FIX_TITLE, CUBE_TABLE_FLAG_LABELS, getExactColumnTypeLabel, getConcatRestrictFixText, getConcatRestrictFixTitle, getConcatUntypedWarning, READ_ONLY_CUBE_TITLE, } from '../../__lib__/LegendCubeLabels.js';
|
|
24
24
|
import { CubeTableFlag } from '../../graph-manager/CubeEngine.js';
|
|
25
25
|
import { CubeConcatDraft } from '../../stores/editors/CubeConcatDraft.js';
|
|
26
26
|
import { isUntypedColumn } from '../../stores/editors/CubeJoinDraft.js';
|
|
@@ -35,7 +35,7 @@ const typeLabel = (column, other) => other &&
|
|
|
35
35
|
!column.type.equals(other.type) &&
|
|
36
36
|
column.type.displayName === other.type.displayName
|
|
37
37
|
? `${column.type.fullName}${column.nullable ? '?' : ''}`
|
|
38
|
-
:
|
|
38
|
+
: getExactColumnTypeLabel(column);
|
|
39
39
|
/**
|
|
40
40
|
* One input's column at a position, its name and type marked where they
|
|
41
41
|
* differ from the other input's; converting types, a type converted to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubeConcatEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeConcatEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAGlB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"CubeConcatEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeConcatEditor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AAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,UAAU,CAAC,sBAAsB,EAC5C,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,EAAE,GAC7C,CACH,EACA,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,cACE,SAAS,EAAC,qDAAqD,EAC/D,KAAK,EAAE,YAAY,CAAC,WAAW,YAE9B,uBAAuB,CAAC,OAAO,CAAC,GAC7B,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-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 { CubeNodeEditorProps } from './CubeNodeEditorRegistry.js';
|
|
17
|
+
/**
|
|
18
|
+
* The Explode Array editor (PLAN §11.20): the Variant column; the keys to its
|
|
19
|
+
* array, typed or picked from the arrays a sample of the column holds; and
|
|
20
|
+
* the new column's name, which follows the keys until typed. The node's
|
|
21
|
+
* problems show under it, as for any node.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CubeExplodeEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CubeExplodeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeExplodeEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeExplodeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAKvE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,WAAoB,mBAAmB;;CAqKnE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-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, TimesIcon } from '@finos/legend-art';
|
|
18
|
+
import { TypeFamily } from '@finos/legend-cube';
|
|
19
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
20
|
+
import { flowResult } from 'mobx';
|
|
21
|
+
import { observer } from 'mobx-react-lite';
|
|
22
|
+
import { COLUMN_NAME_RULES_HINT, EXPLODE_COLUMN_DISABLED_REASON, EXPLODE_EDITOR_NOTES, EXPLODE_NO_ARRAYS_NOTICE, } from '../../__lib__/LegendCubeLabels.js';
|
|
23
|
+
import { CubeExplodeDraft } from '../../stores/editors/CubeExplodeDraft.js';
|
|
24
|
+
import { CubeButton } from '../CubeButton.js';
|
|
25
|
+
import { CubeColumnPicker } from './CubeColumnPicker.js';
|
|
26
|
+
const FIELD = 'h-6 min-w-0 flex-1 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base';
|
|
27
|
+
/**
|
|
28
|
+
* The Explode Array editor (PLAN §11.20): the Variant column; the keys to its
|
|
29
|
+
* array, typed or picked from the arrays a sample of the column holds; and
|
|
30
|
+
* the new column's name, which follows the keys until typed. The node's
|
|
31
|
+
* problems show under it, as for any node.
|
|
32
|
+
*/
|
|
33
|
+
export const CubeExplodeEditor = observer((props) => {
|
|
34
|
+
const { readOnly } = props;
|
|
35
|
+
const draft = guaranteeType(props.draft, CubeExplodeDraft);
|
|
36
|
+
const [schema] = props.inputSchemas;
|
|
37
|
+
const { arrays } = draft;
|
|
38
|
+
const findArrays = () => {
|
|
39
|
+
flowResult(draft.readSample()).catch(draft.editorState.host.applicationStore.alertUnhandledError);
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 text-base", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-16 shrink-0", children: "Column" }), _jsx(CubeColumnPicker, { label: "Explode column", schema: schema, value: draft.column, disabled: readOnly, onChange: (name) => draft.setColumn(name), isColumnDisabled: (column) => column.type.family === TypeFamily.VARIANT
|
|
42
|
+
? undefined
|
|
43
|
+
: EXPLODE_COLUMN_DISABLED_REASON.NOT_JSON })] }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-16 shrink-0", children: "Array" }), _jsx("span", { className: "min-w-0 flex-1 break-all font-mono text-sm text-[var(--color-text-secondary)]", children: [draft.column || '…', ...draft.path].join(' › ') }), _jsx(CubeButton, { title: draft.sampleProblem ??
|
|
44
|
+
"Read the column's first values, and list the arrays they hold", disabled: readOnly ||
|
|
45
|
+
!draft.column ||
|
|
46
|
+
draft.isSampling ||
|
|
47
|
+
draft.sampleProblem !== undefined, onClick: findArrays, children: draft.isSampling ? 'Reading…' : 'Find arrays' })] }), draft.sampleError && (_jsx("div", { className: "break-words text-sm text-[var(--color-status-error)]", children: draft.sampleError })), arrays && arrays.length === 0 && (_jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: EXPLODE_NO_ARRAYS_NOTICE })), arrays && arrays.length > 0 && (_jsx("ul", { "aria-label": "Arrays found", className: "rounded-sm border border-[var(--color-border-subtle)]", children: arrays.map((array) => {
|
|
48
|
+
const picked = array.path.length === draft.path.length &&
|
|
49
|
+
array.path.every((key, index) => key === draft.path[index]);
|
|
50
|
+
const label = [draft.column, ...array.path].join(' › ');
|
|
51
|
+
const share = Math.round(array.presence * 100);
|
|
52
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", "aria-label": `Array ${label}`, "aria-pressed": picked, disabled: readOnly, className: clsx('flex w-full items-baseline gap-2 px-2 py-0.5 text-left enabled:hover:bg-[var(--color-bg-hover)]', picked && 'bg-[var(--color-bg-selected)]'), onClick: () => draft.pickArray(array.path), children: [_jsx("span", { className: "min-w-0 break-all font-mono text-sm", children: label }), _jsxs("span", { className: "shrink-0 text-xs text-[var(--color-text-muted)]", children: [array.description, share < 100 ? ` · ${share}%` : ''] })] }) }, JSON.stringify(array.path)));
|
|
53
|
+
}) })), _jsx("ul", { "aria-label": "Path keys", className: "flex flex-col gap-1", children: draft.path.map((key, index) => {
|
|
54
|
+
const position = index + 1;
|
|
55
|
+
return (
|
|
56
|
+
// keys are edited in place: their position is their identity
|
|
57
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
58
|
+
_jsxs("li", { className: "flex items-center gap-1", children: [_jsx("span", { className: "w-16 shrink-0 text-sm text-[var(--color-text-secondary)]", children: `Key ${position}` }), _jsx("input", { "aria-label": `Path key ${position}`, "aria-invalid": key === '', className: clsx(FIELD, key === '' && 'border-[var(--color-status-error)]'), type: "text", spellCheck: false, value: key, disabled: readOnly, onChange: (event) => draft.setKey(index, event.target.value) }), _jsx("button", { type: "button", className: "flex h-6 w-6 items-center justify-center text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] disabled:text-[var(--color-text-disabled)]", "aria-label": `Remove path key ${position}`, title: "Remove this key", disabled: readOnly, onClick: () => draft.removeKey(index), children: _jsx(TimesIcon, {}) })] }, index));
|
|
59
|
+
}) }), _jsx("div", { children: _jsx(CubeButton, { title: "Add a key: the field of the object the keys before it reach", disabled: readOnly || !draft.column, onClick: () => draft.addKey(), children: "Add key" }) })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-16 shrink-0", children: "Into" }), _jsx("input", { "aria-label": "New column name", className: FIELD, type: "text", spellCheck: false, value: draft.name, disabled: readOnly, onChange: (event) => draft.setName(event.target.value) })] }), _jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: COLUMN_NAME_RULES_HINT }), _jsx("ul", { className: "flex list-disc flex-col gap-1 pl-4 text-sm text-[var(--color-text-secondary)]", children: EXPLODE_EDITOR_NOTES.map((note) => (_jsx("li", { children: note }, note))) })] }));
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=CubeExplodeEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeExplodeEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeExplodeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAe,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,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|
|
2
|
+
* Copyright (c) 2026-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 { CubeNodeEditorProps } from './CubeNodeEditorRegistry.js';
|
|
17
|
+
/**
|
|
18
|
+
* The Filter by Expression editor (PLAN §11.11): the condition's code in a
|
|
19
|
+
* code editor, Validate (F10), which the engine does, and the input's
|
|
20
|
+
* columns, which a click writes at the end of the code.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CubeExpressionFilterEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=CubeExpressionFilterEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeExpressionFilterEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeExpressionFilterEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA2BH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA8DvE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,WAC7B,mBAAmB;;CAoG5B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-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 { CompressIcon, ExpandIcon } from '@finos/legend-art';
|
|
18
|
+
import { CompilationError, SourceInformation } from '@finos/legend-graph';
|
|
19
|
+
import { CodeEditor } from '@finos/legend-lego/code-editor';
|
|
20
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
21
|
+
import { flowResult } from 'mobx';
|
|
22
|
+
import { observer } from 'mobx-react-lite';
|
|
23
|
+
import { useState } from 'react';
|
|
24
|
+
import { EXPRESSION_FILTER_EDITOR_NOTES, getExactColumnTypeLabel, READ_ONLY_CUBE_TITLE, } from '../../__lib__/LegendCubeLabels.js';
|
|
25
|
+
import { CubeExpressionFilterDraft, } from '../../stores/editors/CubeExpressionFilterDraft.js';
|
|
26
|
+
import { CubeButton } from '../CubeButton.js';
|
|
27
|
+
import { CubeColumnTypeIcon } from './CubeColumnPicker.js';
|
|
28
|
+
import { CubeJsonFieldsToggle, CubeJsonFieldsTree, isCubeJsonColumn, } from './CubeJsonFieldsTree.js';
|
|
29
|
+
import { columnAccessOf } from '../../stores/CubePureText.js';
|
|
30
|
+
/** The code editor's language: legend-code-editor's `CODE_EDITOR_LANGUAGE.PURE` */
|
|
31
|
+
const PURE = 'pure';
|
|
32
|
+
/** The error the code editor marks, from the condition's problem located in its code */
|
|
33
|
+
const markerOf = (problem) => {
|
|
34
|
+
const location = problem?.location;
|
|
35
|
+
if (!problem || !location) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const error = new CompilationError(problem.message);
|
|
39
|
+
error.sourceInformation = new SourceInformation(location.sourceId, location.startLine, location.startColumn, location.endLine, location.endColumn);
|
|
40
|
+
return error;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* What the editor says under the code: its problem, but one Cube refused,
|
|
44
|
+
* which the panel's problems show; that it is checked, or that it waits
|
|
45
|
+
*/
|
|
46
|
+
const CubeConditionStatus = observer((props) => {
|
|
47
|
+
const { draft } = props;
|
|
48
|
+
const { problem } = draft;
|
|
49
|
+
if (problem?.refused) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
if (problem) {
|
|
53
|
+
return (_jsxs("div", { className: "text-sm text-[var(--color-status-error)]", children: [_jsx("div", { children: problem.message }), problem.hint && (_jsx("div", { className: "text-[var(--color-text-secondary)]", children: problem.hint }))] }));
|
|
54
|
+
}
|
|
55
|
+
if (!draft.isValidated) {
|
|
56
|
+
return (_jsx("div", { className: "text-sm text-[var(--color-text-muted)]", children: "Not validated yet" }));
|
|
57
|
+
}
|
|
58
|
+
return draft.isChecked ? (_jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: "One Boolean of a row: the rows for which it is true are kept" })) : null;
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* The Filter by Expression editor (PLAN §11.11): the condition's code in a
|
|
62
|
+
* code editor, Validate (F10), which the engine does, and the input's
|
|
63
|
+
* columns, which a click writes at the end of the code.
|
|
64
|
+
*/
|
|
65
|
+
export const CubeExpressionFilterEditor = observer((props) => {
|
|
66
|
+
const { inputSchemas, readOnly } = props;
|
|
67
|
+
const draft = guaranteeType(props.draft, CubeExpressionFilterDraft);
|
|
68
|
+
const [schema] = inputSchemas;
|
|
69
|
+
const [expanded, setExpanded] = useState(false);
|
|
70
|
+
const disabled = readOnly || draft.validating;
|
|
71
|
+
/** Writes text at the end of the condition, as the chips do */
|
|
72
|
+
const write = (text) => {
|
|
73
|
+
const separator = /\s$/u.test(draft.code) ? '' : ' ';
|
|
74
|
+
draft.setCode(`${draft.code}${separator}${text}`);
|
|
75
|
+
};
|
|
76
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 text-base", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("span", { className: "flex-1", children: "Condition" }), _jsx("button", { className: "flex h-6 w-6 items-center justify-center text-[var(--color-text-secondary)]", "aria-label": "Expand the condition", title: expanded ? 'Show fewer lines' : 'Show more lines', onClick: () => setExpanded(!expanded), children: expanded ? _jsx(CompressIcon, {}) : _jsx(ExpandIcon, {}) })] }), _jsx("div", { "aria-label": "Condition", className: "overflow-hidden rounded-sm border border-[var(--color-border-default)]", style: { height: expanded ? 240 : 96 }, children: _jsx(CodeEditor, { inputValue: draft.code, updateInput: (code) => draft.setCode(code), language: PURE, isReadOnly: disabled, hideMinimap: true, hideGutter: true, hideActionBar: true, error: markerOf(draft.problem), extraEditorOptions: {
|
|
77
|
+
lineNumbers: 'off',
|
|
78
|
+
wordWrap: 'on',
|
|
79
|
+
scrollBeyondLastLine: false,
|
|
80
|
+
} }) }), _jsx(CubeConditionStatus, { draft: draft }), _jsx("div", { className: "flex items-center gap-2", children: _jsx(CubeButton, { primary: !draft.isValidated, title: readOnly
|
|
81
|
+
? READ_ONLY_CUBE_TITLE
|
|
82
|
+
: "Check the condition with the engine, and plan it for this cube's database (F10)", disabled: disabled, onClick: () => {
|
|
83
|
+
flowResult(draft.validate()).catch(props.editorState.host.applicationStore.alertUnhandledError);
|
|
84
|
+
}, children: draft.validating ? 'Validating…' : 'Validate' }) }), _jsx("span", { children: "Input columns" }), _jsx("ul", { "aria-label": "Input columns", className: "flex flex-wrap gap-1", children: schema.columns.map((column) => (_jsxs("li", { className: "flex items-stretch gap-0.5", children: [_jsxs("button", { className: "flex items-center gap-1 rounded-sm border border-[var(--color-border-subtle)] px-1 text-sm hover:bg-[var(--color-bg-hover)] disabled:text-[var(--color-text-disabled)]", title: `Write ${columnAccessOf(column.name)} at the end of the condition (${getExactColumnTypeLabel(column)})`, disabled: disabled, onClick: () => write(columnAccessOf(column.name)), children: [_jsx(CubeColumnTypeIcon, { type: column.type }), column.name] }), isCubeJsonColumn(column) && (_jsx(CubeJsonFieldsToggle, { fields: draft.jsonFields, column: column, disabled: readOnly }))] }, column.name))) }), _jsx(CubeJsonFieldsTree, { fields: draft.jsonFields, disabled: disabled, onInsert: write }), _jsx("ul", { className: "flex list-disc flex-col gap-1 pl-4 text-sm text-[var(--color-text-secondary)]", children: EXPRESSION_FILTER_EDITOR_NOTES.map((note) => (_jsx("li", { children: note }, note))) })] }));
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=CubeExpressionFilterEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeExpressionFilterEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeExpressionFilterEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAEL,yBAAyB,GAC1B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,E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AC,UAAU,GACnC,GACT,EACN,2CAA0B,EAC1B,2BAAe,eAAe,EAAC,SAAS,EAAC,sBAAsB,YAC5D,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC9B,cAAsB,SAAS,EAAC,4BAA4B,aAC1D,kBACE,SAAS,EAAC,wKAAwK,EAClL,KAAK,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,uBAAuB,CAAC,MAAM,CAAC,GAAG,EAC9G,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,aAEjD,KAAC,kBAAkB,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI,EACxC,MAAM,CAAC,IAAI,IACL,EACR,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAC3B,KAAC,oBAAoB,IACnB,MAAM,EAAE,KAAK,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GAClB,CACH,KAhBM,MAAM,CAAC,IAAI,CAiBf,CACN,CAAC,GACC,EACL,KAAC,kBAAkB,IACjB,MAAM,EAAE,KAAK,CAAC,UAAU,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,KAAK,GACf,EACF,aAAI,SAAS,EAAC,+EAA+E,YAC1F,8BAA8B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC5C,uBAAgB,IAAI,IAAX,IAAI,CAAa,CAC3B,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubeExtendEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeExtendEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"CubeExtendEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeExtendEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkCH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA8IvE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WAAoB,mBAAmB;;CAwFlE,CAAC"}
|
|
@@ -21,16 +21,14 @@ import { guaranteeType } from '@finos/legend-shared';
|
|
|
21
21
|
import { flowResult } from 'mobx';
|
|
22
22
|
import { observer } from 'mobx-react-lite';
|
|
23
23
|
import { useState } from 'react';
|
|
24
|
-
import { COLUMN_NAME_RULES_HINT, EXTEND_EDITOR_NOTES,
|
|
24
|
+
import { COLUMN_NAME_RULES_HINT, EXTEND_EDITOR_NOTES, getExactColumnTypeLabel, READ_ONLY_CUBE_TITLE, } from '../../__lib__/LegendCubeLabels.js';
|
|
25
25
|
import { CubeExtendDraft, } from '../../stores/editors/CubeExtendDraft.js';
|
|
26
|
+
import { columnAccessOf } from '../../stores/CubePureText.js';
|
|
26
27
|
import { CubeButton } from '../CubeButton.js';
|
|
27
28
|
import { CubeColumnTypeIcon } from './CubeColumnPicker.js';
|
|
29
|
+
import { CubeJsonFieldsToggle, CubeJsonFieldsTree, isCubeJsonColumn, } from './CubeJsonFieldsTree.js';
|
|
28
30
|
/** The code editor's language: legend-code-editor's `CODE_EDITOR_LANGUAGE.PURE` */
|
|
29
31
|
const PURE = 'pure';
|
|
30
|
-
/** How an expression reads a column: `$x.NAME`, or `$x.'a name'` for one that isn't an identifier */
|
|
31
|
-
const columnAccessOf = (name) => /^[A-Za-z_][A-Za-z0-9_]*$/u.test(name)
|
|
32
|
-
? `$x.${name}`
|
|
33
|
-
: `$x.'${name.replace(/\\/gu, '\\\\').replace(/'/gu, "\\'")}'`;
|
|
34
32
|
/** The error the code editor marks, from a row's problem located in its code */
|
|
35
33
|
const markerOf = (row) => {
|
|
36
34
|
const { problem } = row;
|
|
@@ -51,7 +49,7 @@ const CubeExtendRowStatus = observer((props) => {
|
|
|
51
49
|
if (row.checked?.code !== row.code) {
|
|
52
50
|
return (_jsx("div", { className: "text-sm text-[var(--color-text-muted)]", children: "Not validated yet" }));
|
|
53
51
|
}
|
|
54
|
-
return row.type ? (_jsxs("div", { className: "flex items-center gap-1 text-sm text-[var(--color-text-secondary)]", children: [_jsx(CubeColumnTypeIcon, { type: row.type }), `${row.type.displayName},
|
|
52
|
+
return row.type ? (_jsxs("div", { className: "flex items-center gap-1 text-sm text-[var(--color-text-secondary)]", children: [_jsx(CubeColumnTypeIcon, { type: row.type }), `${row.type.displayName}, optional`] })) : null;
|
|
55
53
|
});
|
|
56
54
|
const CubeExtendRowEditor = observer((props) => {
|
|
57
55
|
const { draft, row, position, count, readOnly, onFocus } = props;
|
|
@@ -74,13 +72,16 @@ export const CubeExtendEditor = observer((props) => {
|
|
|
74
72
|
const [schema] = inputSchemas;
|
|
75
73
|
const [focusedKey, setFocusedKey] = useState();
|
|
76
74
|
const target = draft.rows.find((row) => row.key === focusedKey) ?? draft.rows.at(-1);
|
|
75
|
+
const chipsDisabled = readOnly || draft.validating || !target;
|
|
76
|
+
/** Writes text at the end of the expression last used, as the chips do */
|
|
77
|
+
const write = (text) => {
|
|
78
|
+
if (target) {
|
|
79
|
+
const separator = /\s$/u.test(target.code) ? '' : ' ';
|
|
80
|
+
draft.setCode(target.key, `${target.code}${separator}${text}`);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
77
83
|
return (_jsxs("div", { className: "flex flex-col gap-2 text-base", children: [_jsx("span", { children: "New columns" }), _jsx("ul", { "aria-label": "New columns", children: draft.rows.map((row, index) => (_jsx(CubeExtendRowEditor, { draft: draft, row: row, position: index + 1, count: draft.rows.length, readOnly: readOnly, onFocus: () => setFocusedKey(row.key) }, row.key))) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CubeButton, { title: readOnly ? READ_ONLY_CUBE_TITLE : 'Add a new column', disabled: readOnly || draft.validating, onClick: () => draft.addRow(), children: "Add column" }), _jsx(CubeButton, { primary: !draft.isValidated, title: "Check the expressions with the engine, type them, and plan them for this cube's database (F10)", disabled: readOnly || draft.validating, onClick: () => {
|
|
78
84
|
flowResult(draft.validate()).catch(props.editorState.host.applicationStore.alertUnhandledError);
|
|
79
|
-
}, children: draft.validating ? 'Validating…' : 'Validate' })] }), _jsx("span", { children: "Input columns" }), _jsx("ul", { "aria-label": "Input columns", className: "flex flex-wrap gap-1", children: schema.columns.map((column) => (
|
|
80
|
-
if (target) {
|
|
81
|
-
const separator = /\s$/u.test(target.code) ? '' : ' ';
|
|
82
|
-
draft.setCode(target.key, `${target.code}${separator}${columnAccessOf(column.name)}`);
|
|
83
|
-
}
|
|
84
|
-
}, children: [_jsx(CubeColumnTypeIcon, { type: column.type }), column.name] }) }, column.name))) }), _jsx("ul", { className: "flex list-disc flex-col gap-1 pl-4 text-sm text-[var(--color-text-secondary)]", children: [...EXTEND_EDITOR_NOTES, COLUMN_NAME_RULES_HINT].map((note) => (_jsx("li", { children: note }, note))) })] }));
|
|
85
|
+
}, children: draft.validating ? 'Validating…' : 'Validate' })] }), _jsx("span", { children: "Input columns" }), _jsx("ul", { "aria-label": "Input columns", className: "flex flex-wrap gap-1", children: schema.columns.map((column) => (_jsxs("li", { className: "flex items-stretch gap-0.5", children: [_jsxs("button", { className: "flex items-center gap-1 rounded-sm border border-[var(--color-border-subtle)] px-1 text-sm hover:bg-[var(--color-bg-hover)] disabled:text-[var(--color-text-disabled)]", title: `Write ${columnAccessOf(column.name)} at the end of the expression last used (${getExactColumnTypeLabel(column)})`, disabled: chipsDisabled, onClick: () => write(columnAccessOf(column.name)), children: [_jsx(CubeColumnTypeIcon, { type: column.type }), column.name] }), isCubeJsonColumn(column) && (_jsx(CubeJsonFieldsToggle, { fields: draft.jsonFields, column: column, disabled: readOnly }))] }, column.name))) }), _jsx(CubeJsonFieldsTree, { fields: draft.jsonFields, disabled: chipsDisabled, onInsert: write, onAddColumn: (name, code) => draft.addColumn(name, code) }), _jsx("ul", { className: "flex list-disc flex-col gap-1 pl-4 text-sm text-[var(--color-text-secondary)]", children: [...EXTEND_EDITOR_NOTES, COLUMN_NAME_RULES_HINT].map((note) => (_jsx("li", { children: note }, note))) })] }));
|
|
85
86
|
});
|
|
86
87
|
//# sourceMappingURL=CubeExtendEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubeExtendEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeExtendEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"CubeExtendEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeExtendEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EA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AAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,GACxD,EACF,aAAI,SAAS,EAAC,+EAA+E,YAC1F,CAAC,GAAG,mBAAmB,EAAE,sBAAsB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC9D,uBAAgB,IAAI,IAAX,IAAI,CAAa,CAC3B,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubeFilterEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeFilterEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"CubeFilterEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeFilterEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiCH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAwPvE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,WAAoB,mBAAmB;;CA0BlE,CAAC"}
|
|
@@ -15,9 +15,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { clsx, TimesIcon } from '@finos/legend-art';
|
|
18
|
-
import { ColumnComparisonFilter, CompositeFilter, CompositeFilterOperator, FILTER_OPERATOR_DESCRIPTIONS, getAvailableOperators, getFilterValueShape, isDateOrTimestampType, isExactFloatComparison, isFilterOperator, MESSAGE_FILTER_UNSUPPORTED, NEGATIVE_OPERATORS, NotFilter, } from '@finos/legend-cube';
|
|
19
|
-
import { guaranteeType } from '@finos/legend-shared';
|
|
18
|
+
import { ColumnComparisonFilter, CompositeFilter, CompositeFilterOperator, FILTER_OPERATOR_DESCRIPTIONS, findPatternWildcardOperator, getAvailableOperators, getFilterValueShape, isDateOrTimestampType, isExactFloatComparison, isFilterOperator, MESSAGE_FILTER_UNSUPPORTED, NEGATIVE_OPERATORS, NotFilter, } from '@finos/legend-cube';
|
|
19
|
+
import { guaranteeType, noop } from '@finos/legend-shared';
|
|
20
|
+
import { flowResult } from 'mobx';
|
|
20
21
|
import { observer } from 'mobx-react-lite';
|
|
22
|
+
import { useEffect } from 'react';
|
|
21
23
|
import { DATE_OR_TIMESTAMP_WARNING, FILTER_FLOAT_COMPARISON_HINT, FILTER_NULL_NOTE, } from '../../__lib__/LegendCubeLabels.js';
|
|
22
24
|
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
23
25
|
import { CubeFilterDraft } from '../../stores/editors/CubeFilterDraft.js';
|
|
@@ -83,8 +85,17 @@ const CubeFilterGroup = observer((props) => {
|
|
|
83
85
|
* kept, marked, to be fixed. Blank conditions are not stored.
|
|
84
86
|
*/
|
|
85
87
|
export const CubeFilterEditor = observer((props) => {
|
|
88
|
+
const { editorState } = props;
|
|
86
89
|
const draft = guaranteeType(props.draft, CubeFilterDraft);
|
|
87
90
|
const [schema] = props.inputSchemas;
|
|
91
|
+
// a pattern given % or _ is refused on some databases, which the model's
|
|
92
|
+
// outline tells (PLAN §11.11)
|
|
93
|
+
const givesWildcard = findPatternWildcardOperator(draft.tree) !== undefined;
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (givesWildcard) {
|
|
96
|
+
flowResult(editorState.loadModelOutline()).catch(noop());
|
|
97
|
+
}
|
|
98
|
+
}, [editorState, givesWildcard]);
|
|
88
99
|
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(CubeFilterGroup, { draft: draft, schema: schema, readOnly: props.readOnly, group: draft.tree, isTop: true }), _jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: FILTER_NULL_NOTE })] }));
|
|
89
100
|
});
|
|
90
101
|
//# sourceMappingURL=CubeFilterEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubeFilterEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeFilterEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,4BAA4B,EAE5B,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,SAAS,GAEV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"CubeFilterEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeFilterEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,4BAA4B,EAE5B,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,SAAS,GAEV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAA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AAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-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 { CubeNodeEditorProps } from './CubeNodeEditorRegistry.js';
|
|
17
|
+
/**
|
|
18
|
+
* A function source (PLAN §6.5): the function, the runtime the cube runs
|
|
19
|
+
* on, a value for each parameter, which Apply stores, its columns, and
|
|
20
|
+
* Refresh, which types it again
|
|
21
|
+
*/
|
|
22
|
+
export declare const CubeFunctionSourceEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=CubeFunctionSourceEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeFunctionSourceEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeFunctionSourceEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AA+CvE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,WAC3B,mBAAmB;;CAyD5B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-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 { FunctionSource, getFunctionParameterValueError, } from '@finos/legend-cube';
|
|
18
|
+
import { PanelLoadingIndicator } from '@finos/legend-art';
|
|
19
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
20
|
+
import { flowResult } from 'mobx';
|
|
21
|
+
import { observer } from 'mobx-react-lite';
|
|
22
|
+
import { useId } from 'react';
|
|
23
|
+
import { CUBE_PENDING_LABEL } from '../../__lib__/LegendCubeLabels.js';
|
|
24
|
+
import { CubeFunctionDraft } from '../../stores/editors/CubeFunctionDraft.js';
|
|
25
|
+
import { CubeButton } from '../CubeButton.js';
|
|
26
|
+
import { CubeSchemaColumnsTable } from '../CubeSchemaColumnsTable.js';
|
|
27
|
+
const INPUT_CLASS = 'h-7 min-w-0 flex-1 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base text-[var(--color-text-primary)] disabled:text-[var(--color-text-secondary)]';
|
|
28
|
+
const CubeFunctionValueInput = observer((props) => {
|
|
29
|
+
const { draft, index, readOnly } = props;
|
|
30
|
+
const id = useId();
|
|
31
|
+
const parameter = draft.original.parameters[index];
|
|
32
|
+
if (!parameter) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const error = getFunctionParameterValueError(parameter, draft.values[index]);
|
|
36
|
+
return (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("label", { className: "w-32 shrink-0 truncate text-base", htmlFor: id, title: parameter.name, children: parameter.name }), _jsx("input", { id: id, className: INPUT_CLASS, placeholder: `${parameter.type.displayName}${parameter.optional ? ', optional' : ''}`, disabled: readOnly, "aria-invalid": error !== undefined, value: draft.valueTexts[index] ?? '', onChange: (event) => draft.setValueText(index, event.target.value) })] }), error !== undefined && (_jsx("span", { className: "pl-[8.5rem] text-sm text-[var(--color-status-error)]", children: error }))] }));
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* A function source (PLAN §6.5): the function, the runtime the cube runs
|
|
40
|
+
* on, a value for each parameter, which Apply stores, its columns, and
|
|
41
|
+
* Refresh, which types it again
|
|
42
|
+
*/
|
|
43
|
+
export const CubeFunctionSourceEditor = observer((props) => {
|
|
44
|
+
const { editorState, readOnly } = props;
|
|
45
|
+
const draft = guaranteeType(props.draft, CubeFunctionDraft);
|
|
46
|
+
const source = guaranteeType(draft.original, FunctionSource);
|
|
47
|
+
const { resolution } = source;
|
|
48
|
+
const refreshing = editorState.isPendingSource(source);
|
|
49
|
+
return (_jsxs("div", { className: "relative flex flex-col gap-2", children: [_jsxs("dl", { className: "grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-base", children: [_jsx("dt", { className: "text-[var(--color-text-secondary)]", children: "Function" }), _jsx("dd", { className: "min-w-0 break-all", title: source.signature, children: source.function }), _jsx("dt", { className: "text-[var(--color-text-secondary)]", children: "Runtime" }), _jsx("dd", { className: "min-w-0 break-all", children: editorState.document.context?.runtime ?? '' })] }), source.parameters.map((parameter, index) => (_jsx(CubeFunctionValueInput, { draft: draft, index: index, readOnly: readOnly }, parameter.name))), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CubeButton, { title: "Read the function's columns again", disabled: refreshing, onClick: () => {
|
|
50
|
+
flowResult(editorState.refreshSource(source.id)).catch(editorState.host.applicationStore.alertUnhandledError);
|
|
51
|
+
}, children: "Refresh" }), refreshing && (_jsx("span", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.REFRESHING_SOURCE }))] }), _jsx(PanelLoadingIndicator, { isLoading: refreshing }), resolution.kind === 'resolved' ? (_jsx(CubeSchemaColumnsTable, { schema: resolution.schema })) : (_jsx("div", { className: "whitespace-pre-wrap text-base text-[var(--color-text-secondary)]", children: resolution.kind === 'failed'
|
|
52
|
+
? resolution.message
|
|
53
|
+
: 'The function has not been typed yet.' }))] }));
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=CubeFunctionSourceEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeFunctionSourceEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeFunctionSourceEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,cAAc,EACd,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,MAAM,WAAW,GACf,kMAAkM,CAAC;AAErM,MAAM,sBAAsB,GAAG,QAAQ,CACrC,CAAC,KAAqE,EAAE,EAAE;IACxE,MAAM,EAAE,KA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C3D,kBAAkB,CAAC,iBAAiB,GAChC,CACR,IACG,EACN,KAAC,qBAAqB,IAAC,SAAS,EAAE,UAAU,GAAI,EAC/C,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CAChC,KAAC,sBAAsB,IAAC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAI,CACtD,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,kEAAkE,YAC9E,UAAU,CAAC,IAAI,KAAK,QAAQ;oBAC3B,CAAC,CAAC,UAAU,CAAC,OAAO;oBACpB,CAAC,CAAC,sCAAsC,GACtC,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CubeJoinEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeJoinEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"CubeJoinEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeJoinEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAqBvE;;;GAGG;AACH,eAAO,MAAM,cAAc,WAAoB,mBAAmB;;CAsFhE,CAAC"}
|