@finos/legend-cube-builder 0.0.0-stage → 0.0.3
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/LICENSE +201 -0
- package/README.md +64 -2
- package/docs/adding-an-operation.md +92 -0
- package/docs/hosting.md +79 -0
- package/docs/testing.md +83 -0
- package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
- package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeCommand.js +40 -0
- package/lib/__lib__/LegendCubeCommand.js.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.js +35 -0
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
- package/lib/__lib__/LegendCubeLabels.d.ts +87 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeLabels.js +128 -0
- package/lib/__lib__/LegendCubeLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
- package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeTesting.js +34 -0
- package/lib/__lib__/LegendCubeTesting.js.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts +47 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js +106 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.d.ts +42 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.js +92 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.js +68 -0
- package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.js +57 -0
- package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.js +91 -0
- package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
- package/lib/components/CubeButton.d.ts +20 -0
- package/lib/components/CubeButton.d.ts.map +1 -0
- package/lib/components/CubeButton.js +24 -0
- package/lib/components/CubeButton.js.map +1 -0
- package/lib/components/CubeEditor.d.ts +31 -0
- package/lib/components/CubeEditor.d.ts.map +1 -0
- package/lib/components/CubeEditor.js +90 -0
- package/lib/components/CubeEditor.js.map +1 -0
- package/lib/components/CubeNodeIcon.d.ts +23 -0
- package/lib/components/CubeNodeIcon.d.ts.map +1 -0
- package/lib/components/CubeNodeIcon.js +42 -0
- package/lib/components/CubeNodeIcon.js.map +1 -0
- package/lib/components/canvas/CubeCanvas.d.ts +37 -0
- package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvas.js +137 -0
- package/lib/components/canvas/CubeCanvas.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.js +22 -0
- package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.js +51 -0
- package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.js +33 -0
- package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts +66 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.js +97 -0
- package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.js +63 -0
- package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.js +75 -0
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
- package/lib/components/editors/CubeColumnPicker.d.ts +47 -0
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
- package/lib/components/editors/CubeColumnPicker.js +56 -0
- package/lib/components/editors/CubeColumnPicker.js.map +1 -0
- package/lib/components/editors/CubeDistinctEditor.d.ts +23 -0
- package/lib/components/editors/CubeDistinctEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeDistinctEditor.js +24 -0
- package/lib/components/editors/CubeDistinctEditor.js.map +1 -0
- package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
- package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeFilterEditor.js +90 -0
- package/lib/components/editors/CubeFilterEditor.js.map +1 -0
- package/lib/components/editors/CubeIntegerField.d.ts +29 -0
- package/lib/components/editors/CubeIntegerField.d.ts.map +1 -0
- package/lib/components/editors/CubeIntegerField.js +30 -0
- package/lib/components/editors/CubeIntegerField.js.map +1 -0
- package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeJoinEditor.js +84 -0
- package/lib/components/editors/CubeJoinEditor.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.js +72 -0
- package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js +43 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
- package/lib/components/editors/CubeRenameEditor.d.ts +26 -0
- package/lib/components/editors/CubeRenameEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRenameEditor.js +58 -0
- package/lib/components/editors/CubeRenameEditor.js.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts +26 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.js +23 -0
- package/lib/components/editors/CubeRestrictEditor.js.map +1 -0
- package/lib/components/editors/CubeRowCountEditor.d.ts +25 -0
- package/lib/components/editors/CubeRowCountEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRowCountEditor.js +38 -0
- package/lib/components/editors/CubeRowCountEditor.js.map +1 -0
- package/lib/components/editors/CubeSliceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSliceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSliceEditor.js +40 -0
- package/lib/components/editors/CubeSliceEditor.js.map +1 -0
- package/lib/components/editors/CubeSortEditor.d.ts +27 -0
- package/lib/components/editors/CubeSortEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSortEditor.js +72 -0
- package/lib/components/editors/CubeSortEditor.js.map +1 -0
- package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSourceEditor.js +41 -0
- package/lib/components/editors/CubeSourceEditor.js.map +1 -0
- package/lib/components/editors/CubeValueEditor.d.ts +40 -0
- package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeValueEditor.js +178 -0
- package/lib/components/editors/CubeValueEditor.js.map +1 -0
- package/lib/components/grid/CubeGridRegion.d.ts +23 -0
- package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
- package/lib/components/grid/CubeGridRegion.js +94 -0
- package/lib/components/grid/CubeGridRegion.js.map +1 -0
- package/lib/components/grid/CubeGridValues.d.ts +25 -0
- package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
- package/lib/components/grid/CubeGridValues.js +95 -0
- package/lib/components/grid/CubeGridValues.js.map +1 -0
- package/lib/components/grid/CubeResultGrid.d.ts +39 -0
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeResultGrid.js +86 -0
- package/lib/components/grid/CubeResultGrid.js.map +1 -0
- package/lib/components/palette/CubePalette.d.ts +29 -0
- package/lib/components/palette/CubePalette.d.ts.map +1 -0
- package/lib/components/palette/CubePalette.js +73 -0
- package/lib/components/palette/CubePalette.js.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
- package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.js +89 -0
- package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
- package/lib/graph-manager/CubeEngine.d.ts +128 -0
- package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/CubeEngine.js +61 -0
- package/lib/graph-manager/CubeEngine.js.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts +33 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js +45 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +174 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/stores/CubeEditorState.d.ts +236 -0
- package/lib/stores/CubeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeEditorState.js +632 -0
- package/lib/stores/CubeEditorState.js.map +1 -0
- package/lib/stores/CubeExecutionState.d.ts +67 -0
- package/lib/stores/CubeExecutionState.d.ts.map +1 -0
- package/lib/stores/CubeExecutionState.js +212 -0
- package/lib/stores/CubeExecutionState.js.map +1 -0
- package/lib/stores/CubeGridQuickActions.d.ts +40 -0
- package/lib/stores/CubeGridQuickActions.d.ts.map +1 -0
- package/lib/stores/CubeGridQuickActions.js +86 -0
- package/lib/stores/CubeGridQuickActions.js.map +1 -0
- package/lib/stores/CubeHost.d.ts +31 -0
- package/lib/stores/CubeHost.d.ts.map +1 -0
- package/lib/stores/CubeHost.js +17 -0
- package/lib/stores/CubeHost.js.map +1 -0
- package/lib/stores/CubeNodeEditorState.d.ts +103 -0
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeNodeEditorState.js +262 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +41 -0
- package/lib/stores/CubeShowPureState.d.ts.map +1 -0
- package/lib/stores/CubeShowPureState.js +100 -0
- package/lib/stores/CubeShowPureState.js.map +1 -0
- package/lib/stores/CubeSourcePickerState.d.ts +98 -0
- package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
- package/lib/stores/CubeSourcePickerState.js +334 -0
- package/lib/stores/CubeSourcePickerState.js.map +1 -0
- package/lib/stores/CubeSpecTransferState.d.ts +60 -0
- package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
- package/lib/stores/CubeSpecTransferState.js +167 -0
- package/lib/stores/CubeSpecTransferState.js.map +1 -0
- package/lib/stores/LocalModelCatalog.d.ts +37 -0
- package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
- package/lib/stores/LocalModelCatalog.js +49 -0
- package/lib/stores/LocalModelCatalog.js.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.js +186 -0
- package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
- package/lib/stores/editors/CubeIntegerText.d.ts +24 -0
- package/lib/stores/editors/CubeIntegerText.d.ts.map +1 -0
- package/lib/stores/editors/CubeIntegerText.js +33 -0
- package/lib/stores/editors/CubeIntegerText.js.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts +71 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.js +145 -0
- package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.js +35 -0
- package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +35 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js +55 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
- package/lib/stores/editors/CubeRenameDraft.d.ts +44 -0
- package/lib/stores/editors/CubeRenameDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRenameDraft.js +79 -0
- package/lib/stores/editors/CubeRenameDraft.js.map +1 -0
- package/lib/stores/editors/CubeRestrictDraft.d.ts +37 -0
- package/lib/stores/editors/CubeRestrictDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRestrictDraft.js +73 -0
- package/lib/stores/editors/CubeRestrictDraft.js.map +1 -0
- package/lib/stores/editors/CubeRowCountDraft.d.ts +42 -0
- package/lib/stores/editors/CubeRowCountDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRowCountDraft.js +55 -0
- package/lib/stores/editors/CubeRowCountDraft.js.map +1 -0
- package/lib/stores/editors/CubeSliceDraft.d.ts +42 -0
- package/lib/stores/editors/CubeSliceDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeSliceDraft.js +72 -0
- package/lib/stores/editors/CubeSliceDraft.js.map +1 -0
- package/lib/stores/editors/CubeSortDraft.d.ts +49 -0
- package/lib/stores/editors/CubeSortDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeSortDraft.js +99 -0
- package/lib/stores/editors/CubeSortDraft.js.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
- package/package.json +81 -3
- package/src/__lib__/LegendCubeCommand.ts +44 -0
- package/src/__lib__/LegendCubeHelpText.ts +58 -0
- package/src/__lib__/LegendCubeLabels.ts +171 -0
- package/src/__lib__/LegendCubeTesting.ts +33 -0
- package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +172 -0
- package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
- package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
- package/src/__test-utils__/CubeTestApplication.ts +82 -0
- package/src/__test-utils__/FakeCubeEngine.ts +145 -0
- package/src/components/CubeButton.tsx +35 -0
- package/src/components/CubeEditor.tsx +239 -0
- package/src/components/CubeNodeIcon.tsx +64 -0
- package/src/components/canvas/CubeCanvas.tsx +262 -0
- package/src/components/canvas/CubeCanvasContext.ts +31 -0
- package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
- package/src/components/canvas/CubeCanvasDnd.ts +82 -0
- package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
- package/src/components/canvas/CubeCanvasElements.ts +153 -0
- package/src/components/canvas/CubeCanvasLayout.ts +88 -0
- package/src/components/canvas/CubeCanvasNode.tsx +149 -0
- package/src/components/editors/CubeColumnPicker.tsx +138 -0
- package/src/components/editors/CubeDistinctEditor.tsx +28 -0
- package/src/components/editors/CubeFilterEditor.tsx +309 -0
- package/src/components/editors/CubeIntegerField.tsx +51 -0
- package/src/components/editors/CubeJoinEditor.tsx +247 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +215 -0
- package/src/components/editors/CubeNodeEditorRegistry.ts +81 -0
- package/src/components/editors/CubeRenameEditor.tsx +143 -0
- package/src/components/editors/CubeRestrictEditor.tsx +103 -0
- package/src/components/editors/CubeRowCountEditor.tsx +53 -0
- package/src/components/editors/CubeSliceEditor.tsx +69 -0
- package/src/components/editors/CubeSortEditor.tsx +206 -0
- package/src/components/editors/CubeSourceEditor.tsx +106 -0
- package/src/components/editors/CubeValueEditor.tsx +333 -0
- package/src/components/grid/CubeGridRegion.tsx +275 -0
- package/src/components/grid/CubeGridValues.ts +125 -0
- package/src/components/grid/CubeResultGrid.tsx +138 -0
- package/src/components/palette/CubePalette.tsx +177 -0
- package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
- package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
- package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
- package/src/graph-manager/CubeEngine.ts +169 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +58 -0
- package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +243 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
- package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +127 -0
- package/src/index.ts +41 -0
- package/src/stores/CubeEditorState.ts +807 -0
- package/src/stores/CubeExecutionState.ts +288 -0
- package/src/stores/CubeGridQuickActions.ts +129 -0
- package/src/stores/CubeHost.ts +32 -0
- package/src/stores/CubeNodeEditorState.ts +324 -0
- package/src/stores/CubeShowPureState.ts +118 -0
- package/src/stores/CubeSourcePickerState.ts +426 -0
- package/src/stores/CubeSpecTransferState.ts +198 -0
- package/src/stores/LocalModelCatalog.ts +70 -0
- package/src/stores/editors/CubeFilterDraft.ts +241 -0
- package/src/stores/editors/CubeIntegerText.ts +34 -0
- package/src/stores/editors/CubeJoinDraft.ts +224 -0
- package/src/stores/editors/CubeNodeDraft.ts +46 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +83 -0
- package/src/stores/editors/CubeRenameDraft.ts +110 -0
- package/src/stores/editors/CubeRestrictDraft.ts +83 -0
- package/src/stores/editors/CubeRowCountDraft.ts +69 -0
- package/src/stores/editors/CubeSliceDraft.ts +87 -0
- package/src/stores/editors/CubeSortDraft.ts +135 -0
- package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
- package/tsconfig.json +133 -0
|
@@ -0,0 +1,38 @@
|
|
|
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 { QueryNode } from '@finos/legend-cube';
|
|
17
|
+
/**
|
|
18
|
+
* The edits of one node in the side panel, kept until Apply (PLAN §7.4,
|
|
19
|
+
* spec §17.5). A node type's editor edits its draft, never the document:
|
|
20
|
+
* only the panel's Apply stores `build()`, as one undo step. A draft is
|
|
21
|
+
* made once each time the panel opens on a node, and again after an Apply.
|
|
22
|
+
*/
|
|
23
|
+
export declare abstract class CubeNodeDraft<N extends QueryNode = QueryNode> {
|
|
24
|
+
/** The node the draft was made from */
|
|
25
|
+
readonly original: N;
|
|
26
|
+
constructor(original: N);
|
|
27
|
+
/**
|
|
28
|
+
* The node Apply would store. Return `original` itself while nothing was
|
|
29
|
+
* edited; the panel also treats a node that saves the same as `original`
|
|
30
|
+
* as no change.
|
|
31
|
+
*/
|
|
32
|
+
abstract build(): N;
|
|
33
|
+
}
|
|
34
|
+
/** A node with nothing to edit in the panel, such as a source or an Unknown node */
|
|
35
|
+
export declare class CubeReadOnlyNodeDraft extends CubeNodeDraft {
|
|
36
|
+
build(): QueryNode;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=CubeNodeDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;GAKG;AACH,8BAAsB,aAAa,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IACjE,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAET,QAAQ,EAAE,CAAC;IAIvB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,IAAI,CAAC;CACpB;AAED,oFAAoF;AACpF,qBAAa,qBAAsB,SAAQ,aAAa;IACtD,KAAK,IAAI,SAAS;CAGnB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* The edits of one node in the side panel, kept until Apply (PLAN §7.4,
|
|
18
|
+
* spec §17.5). A node type's editor edits its draft, never the document:
|
|
19
|
+
* only the panel's Apply stores `build()`, as one undo step. A draft is
|
|
20
|
+
* made once each time the panel opens on a node, and again after an Apply.
|
|
21
|
+
*/
|
|
22
|
+
export class CubeNodeDraft {
|
|
23
|
+
/** The node the draft was made from */
|
|
24
|
+
original;
|
|
25
|
+
constructor(original) {
|
|
26
|
+
this.original = original;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** A node with nothing to edit in the panel, such as a source or an Unknown node */
|
|
30
|
+
export class CubeReadOnlyNodeDraft extends CubeNodeDraft {
|
|
31
|
+
build() {
|
|
32
|
+
return this.original;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=CubeNodeDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IACjC,uCAAuC;IAC9B,QAAQ,CAAI;IAErB,YAAY,QAAW;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CAQF;AAED,oFAAoF;AACpF,MAAM,OAAO,qBAAsB,SAAQ,aAAa;IACtD,KAAK;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 QueryNode } from '@finos/legend-cube';
|
|
17
|
+
import type { CubeEditorState } from '../CubeEditorState.js';
|
|
18
|
+
import { type CubeNodeDraft } from './CubeNodeDraft.js';
|
|
19
|
+
/** Makes the draft of a node of one type */
|
|
20
|
+
export type CubeNodeDraftFactory = (node: QueryNode, editorState: CubeEditorState) => CubeNodeDraft;
|
|
21
|
+
/**
|
|
22
|
+
* The draft of each node type the panel edits, by type (PLAN §7.4). A
|
|
23
|
+
* transform with an editor in `CUBE_NODE_EDITORS` has its factory here; a
|
|
24
|
+
* source, which has nothing to edit, has none, and so no Apply or Cancel.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CUBE_NODE_DRAFT_FACTORIES: ReadonlyMap<string, CubeNodeDraftFactory>;
|
|
27
|
+
/**
|
|
28
|
+
* The transforms with nothing to set (spec §17.6: Distinct is "description
|
|
29
|
+
* only"): an editor in `CUBE_NODE_EDITORS` and no draft factory, so the panel
|
|
30
|
+
* shows no Apply or Cancel (PLAN §7.4 item 2)
|
|
31
|
+
*/
|
|
32
|
+
export declare const CUBE_NODE_TYPES_WITHOUT_SETTINGS: readonly string[];
|
|
33
|
+
/** The node's draft; a node with nothing to edit gets a read-only one */
|
|
34
|
+
export declare const createCubeNodeDraft: (node: QueryNode, editorState: CubeEditorState) => CubeNodeDraft;
|
|
35
|
+
//# sourceMappingURL=CubeNodeDraftRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraftRegistry.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraftRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAML,KAAK,SAAS,EAKf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,oBAAoB,CAAC;AAO/E,4CAA4C;AAC5C,MAAM,MAAM,oBAAoB,GAAG,CACjC,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,eAAe,KACzB,aAAa,CAAC;AAEnB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CACjD,MAAM,EACN,oBAAoB,CAapB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,EAAE,SAAS,MAAM,EAE7D,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,GAC9B,MAAM,SAAS,EACf,aAAa,eAAe,KAC3B,aAE8B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { Distinct, Drop, Filter, Join, Limit, Rename, Restrict, Slice, Sort, } from '@finos/legend-cube';
|
|
17
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
18
|
+
import { CubeFilterDraft } from './CubeFilterDraft.js';
|
|
19
|
+
import { CubeJoinDraft } from './CubeJoinDraft.js';
|
|
20
|
+
import { CubeReadOnlyNodeDraft } from './CubeNodeDraft.js';
|
|
21
|
+
import { CubeRenameDraft } from './CubeRenameDraft.js';
|
|
22
|
+
import { CubeRestrictDraft } from './CubeRestrictDraft.js';
|
|
23
|
+
import { CubeRowCountDraft } from './CubeRowCountDraft.js';
|
|
24
|
+
import { CubeSliceDraft } from './CubeSliceDraft.js';
|
|
25
|
+
import { CubeSortDraft } from './CubeSortDraft.js';
|
|
26
|
+
/**
|
|
27
|
+
* The draft of each node type the panel edits, by type (PLAN §7.4). A
|
|
28
|
+
* transform with an editor in `CUBE_NODE_EDITORS` has its factory here; a
|
|
29
|
+
* source, which has nothing to edit, has none, and so no Apply or Cancel.
|
|
30
|
+
*/
|
|
31
|
+
export const CUBE_NODE_DRAFT_FACTORIES = new Map([
|
|
32
|
+
[Sort.TYPE, (node) => new CubeSortDraft(guaranteeType(node, Sort))],
|
|
33
|
+
[Filter.TYPE, (node) => new CubeFilterDraft(guaranteeType(node, Filter))],
|
|
34
|
+
[
|
|
35
|
+
Restrict.TYPE,
|
|
36
|
+
(node) => new CubeRestrictDraft(guaranteeType(node, Restrict)),
|
|
37
|
+
],
|
|
38
|
+
[Rename.TYPE, (node) => new CubeRenameDraft(guaranteeType(node, Rename))],
|
|
39
|
+
[Join.TYPE, (node) => new CubeJoinDraft(guaranteeType(node, Join))],
|
|
40
|
+
[Drop.TYPE, (node) => new CubeRowCountDraft(guaranteeType(node, Drop))],
|
|
41
|
+
[Limit.TYPE, (node) => new CubeRowCountDraft(guaranteeType(node, Limit))],
|
|
42
|
+
[Slice.TYPE, (node) => new CubeSliceDraft(guaranteeType(node, Slice))],
|
|
43
|
+
]);
|
|
44
|
+
/**
|
|
45
|
+
* The transforms with nothing to set (spec §17.6: Distinct is "description
|
|
46
|
+
* only"): an editor in `CUBE_NODE_EDITORS` and no draft factory, so the panel
|
|
47
|
+
* shows no Apply or Cancel (PLAN §7.4 item 2)
|
|
48
|
+
*/
|
|
49
|
+
export const CUBE_NODE_TYPES_WITHOUT_SETTINGS = [
|
|
50
|
+
Distinct.TYPE,
|
|
51
|
+
];
|
|
52
|
+
/** The node's draft; a node with nothing to edit gets a read-only one */
|
|
53
|
+
export const createCubeNodeDraft = (node, editorState) => CUBE_NODE_DRAFT_FACTORIES.get(node.type)?.(node, editorState) ??
|
|
54
|
+
new CubeReadOnlyNodeDraft(node);
|
|
55
|
+
//# sourceMappingURL=CubeNodeDraftRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeDraftRegistry.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeNodeDraftRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,IAA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aAAa,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACnE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACvE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACzE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;CACvE,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAsB;IACjE,QAAQ,CAAC,IAAI;CACd,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAAe,EACf,WAA4B,EACb,EAAE,CACjB,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC7D,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { Rename, RenameMapping } from '@finos/legend-cube';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
/** One row of the Rename editor: an old column and its new name, `''` until picked or typed */
|
|
19
|
+
export interface CubeRenameRow {
|
|
20
|
+
/** Identifies the row in the editor */
|
|
21
|
+
readonly key: number;
|
|
22
|
+
readonly from: string;
|
|
23
|
+
readonly to: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The Rename editor's draft (spec §17.6: a list of old column and new name
|
|
27
|
+
* rows). A new name is kept exactly as typed, never trimmed. A row with
|
|
28
|
+
* neither name is left out when built, as a Filter's blank rows are; a row
|
|
29
|
+
* with only one is kept, so validation reports it.
|
|
30
|
+
*/
|
|
31
|
+
export declare class CubeRenameDraft extends CubeNodeDraft<Rename> {
|
|
32
|
+
rows: readonly CubeRenameRow[];
|
|
33
|
+
/** Anything was changed; until then, `build()` gives the original back */
|
|
34
|
+
private touched;
|
|
35
|
+
constructor(original: Rename);
|
|
36
|
+
/** The mappings the rows build, in order: a row with neither name is left out */
|
|
37
|
+
get mappings(): RenameMapping[];
|
|
38
|
+
addRow(): void;
|
|
39
|
+
removeRow(key: number): void;
|
|
40
|
+
setFrom(key: number, from: string): void;
|
|
41
|
+
setTo(key: number, to: string): void;
|
|
42
|
+
build(): Rename;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=CubeRenameDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeRenameDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeRenameDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAgBD;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,aAAa,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;IAC/B,0EAA0E;IAC1E,OAAO,CAAC,OAAO,CAAS;gBAEZ,QAAQ,EAAE,MAAM;IAmB5B,iFAAiF;IACjF,IAAI,QAAQ,IAAI,aAAa,EAAE,CAI9B;IAED,MAAM,IAAI,IAAI;IAKd,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK5B,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAOxC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAOpC,KAAK,IAAI,MAAM;CAMhB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { action, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
let nextRowKey = 1;
|
|
19
|
+
const blankRow = () => ({ key: nextRowKey++, from: '', to: '' });
|
|
20
|
+
const isSameMappings = (a, b) => a.length === b.length &&
|
|
21
|
+
a.every((mapping, index) => mapping.from === b[index]?.from && mapping.to === b[index]?.to);
|
|
22
|
+
/**
|
|
23
|
+
* The Rename editor's draft (spec §17.6: a list of old column and new name
|
|
24
|
+
* rows). A new name is kept exactly as typed, never trimmed. A row with
|
|
25
|
+
* neither name is left out when built, as a Filter's blank rows are; a row
|
|
26
|
+
* with only one is kept, so validation reports it.
|
|
27
|
+
*/
|
|
28
|
+
export class CubeRenameDraft extends CubeNodeDraft {
|
|
29
|
+
rows;
|
|
30
|
+
/** Anything was changed; until then, `build()` gives the original back */
|
|
31
|
+
touched = false;
|
|
32
|
+
constructor(original) {
|
|
33
|
+
super(original);
|
|
34
|
+
makeObservable(this, {
|
|
35
|
+
rows: observable.ref,
|
|
36
|
+
touched: observable,
|
|
37
|
+
addRow: action,
|
|
38
|
+
removeRow: action,
|
|
39
|
+
setFrom: action,
|
|
40
|
+
setTo: action,
|
|
41
|
+
});
|
|
42
|
+
this.rows = original.mappings.length
|
|
43
|
+
? original.mappings.map(({ from, to }) => ({
|
|
44
|
+
key: nextRowKey++,
|
|
45
|
+
from,
|
|
46
|
+
to,
|
|
47
|
+
}))
|
|
48
|
+
: [blankRow()];
|
|
49
|
+
}
|
|
50
|
+
/** The mappings the rows build, in order: a row with neither name is left out */
|
|
51
|
+
get mappings() {
|
|
52
|
+
return this.rows
|
|
53
|
+
.filter((row) => row.from || row.to)
|
|
54
|
+
.map(({ from, to }) => ({ from, to }));
|
|
55
|
+
}
|
|
56
|
+
addRow() {
|
|
57
|
+
this.rows = [...this.rows, blankRow()];
|
|
58
|
+
this.touched = true;
|
|
59
|
+
}
|
|
60
|
+
removeRow(key) {
|
|
61
|
+
this.rows = this.rows.filter((row) => row.key !== key);
|
|
62
|
+
this.touched = true;
|
|
63
|
+
}
|
|
64
|
+
setFrom(key, from) {
|
|
65
|
+
this.rows = this.rows.map((row) => row.key === key ? { ...row, from } : row);
|
|
66
|
+
this.touched = true;
|
|
67
|
+
}
|
|
68
|
+
setTo(key, to) {
|
|
69
|
+
this.rows = this.rows.map((row) => row.key === key ? { ...row, to } : row);
|
|
70
|
+
this.touched = true;
|
|
71
|
+
}
|
|
72
|
+
build() {
|
|
73
|
+
const { original, mappings } = this;
|
|
74
|
+
return !this.touched || isSameMappings(mappings, original.mappings)
|
|
75
|
+
? original
|
|
76
|
+
: original.withMappings(mappings);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=CubeRenameDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeRenameDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeRenameDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,MAAM,QAAQ,GAAG,GAAkB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAEhF,MAAM,cAAc,GAAG,CACrB,CAA2B,EAC3B,CAA2B,EAClB,EAAE,CACX,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;IACrB,CAAC,CAAC,KAAK,CACL,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACjB,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CACjE,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,OAAO,eA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AG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,OAAO,CAAC,GAAW,EAAE,IAAY;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAChC,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CACzC,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,GAAW,EAAE,EAAU;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAChC,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CACvC,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,KAAK;QACH,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;YACjE,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { Restrict, Schema } from '@finos/legend-cube';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
/**
|
|
19
|
+
* The Restrict editor's draft (spec §17.6: a multi-select of the columns to
|
|
20
|
+
* keep). It keeps the picked columns in the input's order, as the node's
|
|
21
|
+
* output has them.
|
|
22
|
+
*/
|
|
23
|
+
export declare class CubeRestrictDraft extends CubeNodeDraft<Restrict> {
|
|
24
|
+
columns: readonly string[];
|
|
25
|
+
/** Anything was changed; until then, `build()` gives the original back */
|
|
26
|
+
private touched;
|
|
27
|
+
constructor(original: Restrict);
|
|
28
|
+
/** Ticks or unticks the column */
|
|
29
|
+
toggleColumn(name: string, schema: Schema): void;
|
|
30
|
+
/** Ticks every column of the input */
|
|
31
|
+
selectAll(schema: Schema): void;
|
|
32
|
+
/** Unticks every column */
|
|
33
|
+
clear(): void;
|
|
34
|
+
/** The original while the same columns are picked, whatever their order */
|
|
35
|
+
build(): Restrict;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=CubeRestrictDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeRestrictDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeRestrictDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAenD;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,aAAa,CAAC,QAAQ,CAAC;IAC5D,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,0EAA0E;IAC1E,OAAO,CAAC,OAAO,CAAS;gBAEZ,QAAQ,EAAE,QAAQ;IAY9B,kCAAkC;IAClC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAOhD,sCAAsC;IACtC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B,2BAA2B;IAC3B,KAAK,IAAI,IAAI;IAKb,2EAA2E;IAC3E,KAAK,IAAI,QAAQ;CAMlB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { action, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
/**
|
|
19
|
+
* The columns in the input's order, then those the input doesn't have, in
|
|
20
|
+
* the order they were picked: a saved column the input lost stays listed
|
|
21
|
+
* until it is unticked
|
|
22
|
+
*/
|
|
23
|
+
const inInputOrder = (names, schema) => [
|
|
24
|
+
...schema.names().filter((name) => names.includes(name)),
|
|
25
|
+
...names.filter((name) => schema.lookup(name) === undefined),
|
|
26
|
+
];
|
|
27
|
+
const isSameSet = (a, b) => a.length === b.length && a.every((name) => b.includes(name));
|
|
28
|
+
/**
|
|
29
|
+
* The Restrict editor's draft (spec §17.6: a multi-select of the columns to
|
|
30
|
+
* keep). It keeps the picked columns in the input's order, as the node's
|
|
31
|
+
* output has them.
|
|
32
|
+
*/
|
|
33
|
+
export class CubeRestrictDraft extends CubeNodeDraft {
|
|
34
|
+
columns;
|
|
35
|
+
/** Anything was changed; until then, `build()` gives the original back */
|
|
36
|
+
touched = false;
|
|
37
|
+
constructor(original) {
|
|
38
|
+
super(original);
|
|
39
|
+
makeObservable(this, {
|
|
40
|
+
columns: observable.ref,
|
|
41
|
+
touched: observable,
|
|
42
|
+
toggleColumn: action,
|
|
43
|
+
selectAll: action,
|
|
44
|
+
clear: action,
|
|
45
|
+
});
|
|
46
|
+
this.columns = original.columns;
|
|
47
|
+
}
|
|
48
|
+
/** Ticks or unticks the column */
|
|
49
|
+
toggleColumn(name, schema) {
|
|
50
|
+
this.columns = this.columns.includes(name)
|
|
51
|
+
? this.columns.filter((picked) => picked !== name)
|
|
52
|
+
: inInputOrder([...this.columns, name], schema);
|
|
53
|
+
this.touched = true;
|
|
54
|
+
}
|
|
55
|
+
/** Ticks every column of the input */
|
|
56
|
+
selectAll(schema) {
|
|
57
|
+
this.columns = inInputOrder([...schema.names(), ...this.columns], schema);
|
|
58
|
+
this.touched = true;
|
|
59
|
+
}
|
|
60
|
+
/** Unticks every column */
|
|
61
|
+
clear() {
|
|
62
|
+
this.columns = [];
|
|
63
|
+
this.touched = true;
|
|
64
|
+
}
|
|
65
|
+
/** The original while the same columns are picked, whatever their order */
|
|
66
|
+
build() {
|
|
67
|
+
const { original, columns } = this;
|
|
68
|
+
return !this.touched || isSameSet(columns, original.columns)
|
|
69
|
+
? original
|
|
70
|
+
: original.withColumns(columns);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=CubeRestrictDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeRestrictDraft.js","sourceRoot":"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EAAE,MAAc;QACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YACxC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC;YAClD,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,sCAAsC;IACtC,SAAS,CAAC,MAAc;QACtB,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,2BAA2B;IAC3B,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,2EAA2E;IAC3E,KAAK;QACH,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;YAC1D,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { QueryNode } from '@finos/legend-cube';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
/** A node whose one setting is a number of rows: a Limit or a Drop */
|
|
19
|
+
export interface CubeRowCountNode<N extends QueryNode> extends QueryNode {
|
|
20
|
+
readonly size: number | undefined;
|
|
21
|
+
withSize(size: number | undefined): N;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The draft of a node whose one setting is a number of rows (spec §17.6: "one
|
|
25
|
+
* integer field"). It keeps the text as typed. Text that isn't a whole
|
|
26
|
+
* number, empty text included, builds a cleared size, which the node reports:
|
|
27
|
+
* never the default (spec §7.7). The text it opened with gives the original
|
|
28
|
+
* back, so a saved size the field can't read (`1.5` from an imported spec) is
|
|
29
|
+
* kept unless the user types something else.
|
|
30
|
+
*/
|
|
31
|
+
export declare class CubeRowCountDraft<N extends CubeRowCountNode<N>> extends CubeNodeDraft<N> {
|
|
32
|
+
sizeText: string;
|
|
33
|
+
/** The text the field opened with, which builds the original */
|
|
34
|
+
private readonly initialText;
|
|
35
|
+
constructor(original: N);
|
|
36
|
+
/** The size the text gives: `undefined` unless it is a whole number */
|
|
37
|
+
get size(): number | undefined;
|
|
38
|
+
setSizeText(text: string): void;
|
|
39
|
+
/** The original while the field holds its opening text or the same size */
|
|
40
|
+
build(): N;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=CubeRowCountDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeRowCountDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeRowCountDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,sEAAsE;AACtE,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,SAAS;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,qBAAa,iBAAiB,CAC5B,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,CAC7B,SAAQ,aAAa,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,QAAQ,EAAE,CAAC;IAUvB,uEAAuE;IACvE,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI/B,2EAA2E;IAC3E,KAAK,IAAI,CAAC;CAMX"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { action, makeObservable, observable } from 'mobx';
|
|
17
|
+
import { parseWholeNumberText } from './CubeIntegerText.js';
|
|
18
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
19
|
+
/**
|
|
20
|
+
* The draft of a node whose one setting is a number of rows (spec §17.6: "one
|
|
21
|
+
* integer field"). It keeps the text as typed. Text that isn't a whole
|
|
22
|
+
* number, empty text included, builds a cleared size, which the node reports:
|
|
23
|
+
* never the default (spec §7.7). The text it opened with gives the original
|
|
24
|
+
* back, so a saved size the field can't read (`1.5` from an imported spec) is
|
|
25
|
+
* kept unless the user types something else.
|
|
26
|
+
*/
|
|
27
|
+
export class CubeRowCountDraft extends CubeNodeDraft {
|
|
28
|
+
sizeText;
|
|
29
|
+
/** The text the field opened with, which builds the original */
|
|
30
|
+
initialText;
|
|
31
|
+
constructor(original) {
|
|
32
|
+
super(original);
|
|
33
|
+
makeObservable(this, {
|
|
34
|
+
sizeText: observable,
|
|
35
|
+
setSizeText: action,
|
|
36
|
+
});
|
|
37
|
+
this.initialText = original.size === undefined ? '' : String(original.size);
|
|
38
|
+
this.sizeText = this.initialText;
|
|
39
|
+
}
|
|
40
|
+
/** The size the text gives: `undefined` unless it is a whole number */
|
|
41
|
+
get size() {
|
|
42
|
+
return parseWholeNumberText(this.sizeText);
|
|
43
|
+
}
|
|
44
|
+
setSizeText(text) {
|
|
45
|
+
this.sizeText = text;
|
|
46
|
+
}
|
|
47
|
+
/** The original while the field holds its opening text or the same size */
|
|
48
|
+
build() {
|
|
49
|
+
const { original, size } = this;
|
|
50
|
+
return this.sizeText.trim() === this.initialText || size === original.size
|
|
51
|
+
? original
|
|
52
|
+
: original.withSize(size);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=CubeRowCountDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeRowCountDraft.js","sourceRoot":"","sources":["../../../src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|
|
|
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 { Slice } from '@finos/legend-cube';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
/**
|
|
19
|
+
* The Slice editor's draft (spec §17.6: start and stop integer fields). It
|
|
20
|
+
* keeps the texts as typed; a text that isn't a whole number builds a
|
|
21
|
+
* cleared bound, which the node reports, never the default (spec §7.9). A
|
|
22
|
+
* field that holds the text it opened with keeps its saved bound, so a bound
|
|
23
|
+
* the field can't read (`1.5` from an imported spec) is kept unless the user
|
|
24
|
+
* types something else in that field.
|
|
25
|
+
*/
|
|
26
|
+
export declare class CubeSliceDraft extends CubeNodeDraft<Slice> {
|
|
27
|
+
startText: string;
|
|
28
|
+
stopText: string;
|
|
29
|
+
/** The texts the fields opened with, which keep the saved bounds */
|
|
30
|
+
private readonly initialStartText;
|
|
31
|
+
private readonly initialStopText;
|
|
32
|
+
constructor(original: Slice);
|
|
33
|
+
/** The start the text gives: `undefined` unless it is a whole number */
|
|
34
|
+
get start(): number | undefined;
|
|
35
|
+
/** The stop the text gives: `undefined` unless it is a whole number */
|
|
36
|
+
get stop(): number | undefined;
|
|
37
|
+
setStartText(text: string): void;
|
|
38
|
+
setStopText(text: string): void;
|
|
39
|
+
/** The original while each field holds its opening text or the same bound */
|
|
40
|
+
build(): Slice;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=CubeSliceDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSliceDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeSliceDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,aAAa,CAAC,KAAK,CAAC;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,QAAQ,EAAE,KAAK;IAc3B,wEAAwE;IACxE,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED,uEAAuE;IACvE,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIhC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI/B,6EAA6E;IAC7E,KAAK,IAAI,KAAK;CAcf"}
|