@finos/legend-cube-builder 0.0.0-stage → 0.0.2
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 +5 -2
- 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 +27 -0
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
- package/lib/__lib__/LegendCubeLabels.d.ts +68 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeLabels.js +109 -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 +41 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js +76 -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__/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 +85 -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 +32 -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 +135 -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 +64 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.js +96 -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 +72 -0
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
- package/lib/components/editors/CubeColumnPicker.d.ts +40 -0
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
- package/lib/components/editors/CubeColumnPicker.js +51 -0
- package/lib/components/editors/CubeColumnPicker.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/CubeJoinEditor.d.ts +26 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeJoinEditor.js +76 -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 +71 -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 +30 -0
- package/lib/components/editors/CubeNodeEditorRegistry.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 +42 -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 +177 -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 +26 -0
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeResultGrid.js +50 -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 +115 -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 +25 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js +24 -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 +121 -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 +206 -0
- package/lib/stores/CubeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeEditorState.js +551 -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 +196 -0
- package/lib/stores/CubeExecutionState.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 +85 -0
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeNodeEditorState.js +207 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +38 -0
- package/lib/stores/CubeShowPureState.d.ts.map +1 -0
- package/lib/stores/CubeShowPureState.js +83 -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/CubeJoinDraft.d.ts +63 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.js +136 -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 +29 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js +33 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.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 +38 -0
- package/src/__lib__/LegendCubeLabels.ts +141 -0
- package/src/__lib__/LegendCubeTesting.ts +33 -0
- package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +137 -0
- package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
- package/src/__test-utils__/CubeTestApplication.ts +82 -0
- package/src/__test-utils__/FakeCubeEngine.ts +139 -0
- package/src/components/CubeButton.tsx +35 -0
- package/src/components/CubeEditor.tsx +239 -0
- package/src/components/CubeNodeIcon.tsx +47 -0
- package/src/components/canvas/CubeCanvas.tsx +260 -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 +150 -0
- package/src/components/canvas/CubeCanvasLayout.ts +88 -0
- package/src/components/canvas/CubeCanvasNode.tsx +141 -0
- package/src/components/editors/CubeColumnPicker.tsx +114 -0
- package/src/components/editors/CubeFilterEditor.tsx +309 -0
- package/src/components/editors/CubeJoinEditor.tsx +224 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +204 -0
- package/src/components/editors/CubeNodeEditorRegistry.ts +61 -0
- package/src/components/editors/CubeSourceEditor.tsx +116 -0
- package/src/components/editors/CubeValueEditor.tsx +332 -0
- package/src/components/grid/CubeGridRegion.tsx +274 -0
- package/src/components/grid/CubeGridValues.ts +125 -0
- package/src/components/grid/CubeResultGrid.tsx +84 -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 +155 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +32 -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 +157 -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 +124 -0
- package/src/index.ts +41 -0
- package/src/stores/CubeEditorState.ts +702 -0
- package/src/stores/CubeExecutionState.ts +255 -0
- package/src/stores/CubeHost.ts +32 -0
- package/src/stores/CubeNodeEditorState.ts +255 -0
- package/src/stores/CubeShowPureState.ts +96 -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/CubeJoinDraft.ts +197 -0
- package/src/stores/editors/CubeNodeDraft.ts +46 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +49 -0
- package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
- package/tsconfig.json +118 -0
|
@@ -0,0 +1,40 @@
|
|
|
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 CubeType, type Schema } from '@finos/legend-cube';
|
|
17
|
+
/** The icon of a column type's family: text, number, date, ...; a question mark for the rest */
|
|
18
|
+
export declare const CubeColumnTypeIcon: React.FC<{
|
|
19
|
+
type: CubeType;
|
|
20
|
+
className?: string;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Picks a column of an input schema, in schema order (spec §17.5: only the
|
|
24
|
+
* columns of the actual input). Each option names its type, e.g.
|
|
25
|
+
* `CUSTOMER_ID: Varchar(5)?`; the picked column's type shows beside, with
|
|
26
|
+
* its family's icon and its full type in the tooltip. A column the input
|
|
27
|
+
* doesn't have stays shown, so the problem can be seen and fixed.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CubeColumnPicker: React.FC<{
|
|
30
|
+
/** What the column is for, e.g. `Left join column 1`: the picker's accessible name */
|
|
31
|
+
label: string;
|
|
32
|
+
schema: Schema;
|
|
33
|
+
/** The picked column's name, `''` or `undefined` for none */
|
|
34
|
+
value: string | undefined;
|
|
35
|
+
onChange: (columnName: string) => void;
|
|
36
|
+
disabled?: boolean | undefined;
|
|
37
|
+
/** Marks the pick as wrong, e.g. a type that doesn't match */
|
|
38
|
+
invalid?: boolean | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
//# sourceMappingURL=CubeColumnPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeColumnPicker.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeColumnPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAc,MAAM,oBAAoB,CAAC;AAkB5E,gGAAgG;AAChG,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAGA,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IACtC,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC/B,CA4CA,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { CalendarIcon, clsx, HashtagIcon, ListIcon, QuestionIcon, StringTypeIcon, ToggleIcon, } from '@finos/legend-art';
|
|
18
|
+
import { TypeFamily } from '@finos/legend-cube';
|
|
19
|
+
import { getColumnTypeLabel } from '../../__lib__/LegendCubeLabels.js';
|
|
20
|
+
const FAMILY_ICONS = {
|
|
21
|
+
[TypeFamily.STRING]: StringTypeIcon,
|
|
22
|
+
[TypeFamily.BOOLEAN]: ToggleIcon,
|
|
23
|
+
[TypeFamily.INTEGER]: HashtagIcon,
|
|
24
|
+
[TypeFamily.FLOAT]: HashtagIcon,
|
|
25
|
+
[TypeFamily.DECIMAL]: HashtagIcon,
|
|
26
|
+
[TypeFamily.NUMBER]: HashtagIcon,
|
|
27
|
+
[TypeFamily.STRICT_DATE]: CalendarIcon,
|
|
28
|
+
[TypeFamily.DATETIME]: CalendarIcon,
|
|
29
|
+
[TypeFamily.DATE]: CalendarIcon,
|
|
30
|
+
[TypeFamily.ENUM]: ListIcon,
|
|
31
|
+
};
|
|
32
|
+
/** The icon of a column type's family: text, number, date, ...; a question mark for the rest */
|
|
33
|
+
export const CubeColumnTypeIcon = (props) => {
|
|
34
|
+
const Icon = FAMILY_ICONS[props.type.family] ?? QuestionIcon;
|
|
35
|
+
return _jsx(Icon, { className: clsx('shrink-0', props.className) });
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Picks a column of an input schema, in schema order (spec §17.5: only the
|
|
39
|
+
* columns of the actual input). Each option names its type, e.g.
|
|
40
|
+
* `CUSTOMER_ID: Varchar(5)?`; the picked column's type shows beside, with
|
|
41
|
+
* its family's icon and its full type in the tooltip. A column the input
|
|
42
|
+
* doesn't have stays shown, so the problem can be seen and fixed.
|
|
43
|
+
*/
|
|
44
|
+
export const CubeColumnPicker = (props) => {
|
|
45
|
+
const { label, schema, value, onChange, disabled, invalid } = props;
|
|
46
|
+
const picked = value ? schema.lookup(value) : undefined;
|
|
47
|
+
return (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsxs("select", { "aria-label": label, "aria-invalid": Boolean(invalid) || (Boolean(value) && !picked), className: clsx('h-6 min-w-0 flex-1 rounded-sm border bg-[var(--color-bg-input)] px-1 text-base', invalid || (value && !picked)
|
|
48
|
+
? 'border-[var(--color-status-error)]'
|
|
49
|
+
: 'border-[var(--color-border-default)]'), value: value ?? '', disabled: disabled, onChange: (event) => onChange(event.target.value), children: [!picked && (_jsx("option", { value: value ?? '', disabled: true, children: value ? `${value} (not in the input)` : 'Pick a column' })), schema.columns.map((column) => (_jsx("option", { value: column.name, title: column.type.fullName, children: `${column.name}: ${getColumnTypeLabel(column)}` }, column.name)))] }), picked && (_jsxs("span", { className: "flex shrink-0 items-center gap-1 text-sm text-[var(--color-text-secondary)]", title: picked.type.fullName, children: [_jsx(CubeColumnTypeIcon, { type: picked.type }), getColumnTypeLabel(picked)] }))] }));
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=CubeColumnPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeColumnPicker.js","sourceRoot":"","sources":["../../../src/components/editors/CubeColumnPicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA8B,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,YAAY,GAEd;IACF,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,cAAc;IACnC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU;IAChC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW;IACjC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,WAAW;IAC/B,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW;IACjC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW;IAChC,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,YAAY;IACtC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,YAAY;IACnC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY;IAC/B,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ;CAC5B,CAAC;AAEF,gGAAgG;AAChG,MAAM,CAAC,MAAM,kBAAkB,GAG1B,CAAC,KAAK,EAAE,EAAE;IACb,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC;IAC7D,OAAO,KA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AAG,MAAM,CAAC,IAAI,KAAK,kBAAkB,CAAC,MAAM,CAAC,EAAE,IAJ3C,MAAM,CAAC,IAAI,CAKT,CACV,CAAC,IACK,EACR,MAAM,IAAI,CACT,gBACE,SAAS,EAAC,6EAA6E,EACvF,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,aAE3B,KAAC,kBAAkB,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI,EACxC,kBAAkB,CAAC,MAAM,CAAC,IACtB,CACR,IACG,CACP,CAAC;AACJ,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 Filter editor (spec §8.5): conditions of a column, an operator and a
|
|
19
|
+
* value, in And/Or groups, each of which can be negated. Operators follow
|
|
20
|
+
* the column's type; values are read as its type, and text that isn't one is
|
|
21
|
+
* kept, marked, to be fixed. Blank conditions are not stored.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CubeFilterEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CubeFilterEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeFilterEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeFilterEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4BH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAmPvE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,WAAoB,mBAAmB;;CAiBlE,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { ColumnComparisonFilter, CompositeFilter, CompositeFilterOperator, FILTER_OPERATOR_DESCRIPTIONS, getAvailableOperators, getFilterValueShape, isExactFloatComparison, isFilterOperator, MESSAGE_FILTER_UNSUPPORTED, NEGATIVE_OPERATORS, NotFilter, } from '@finos/legend-cube';
|
|
19
|
+
import { guaranteeType } from '@finos/legend-shared';
|
|
20
|
+
import { observer } from 'mobx-react-lite';
|
|
21
|
+
import { FILTER_FLOAT_COMPARISON_HINT, FILTER_NULL_NOTE, } from '../../__lib__/LegendCubeLabels.js';
|
|
22
|
+
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
23
|
+
import { CubeFilterDraft } from '../../stores/editors/CubeFilterDraft.js';
|
|
24
|
+
import { CubeButton } from '../CubeButton.js';
|
|
25
|
+
import { CubeColumnPicker } from './CubeColumnPicker.js';
|
|
26
|
+
import { CubeValueEditor } from './CubeValueEditor.js';
|
|
27
|
+
const SMALL_BUTTON = 'flex h-6 shrink-0 items-center justify-center rounded-sm px-1 text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] disabled:text-[var(--color-text-disabled)]';
|
|
28
|
+
const CubeRemoveRuleButton = (props) => (_jsx("button", { className: SMALL_BUTTON, "aria-label": props.label, title: props.label, disabled: props.readOnly, onClick: () => props.draft.removeRule(props.rule.key), children: _jsx(TimesIcon, {}) }));
|
|
29
|
+
/**
|
|
30
|
+
* A condition: column, operator and its negation and removal on one line,
|
|
31
|
+
* the value below, with the whole width of the panel
|
|
32
|
+
*/
|
|
33
|
+
const CubeFilterCondition = observer((props) => {
|
|
34
|
+
const { draft, schema, readOnly, rule, negation } = props;
|
|
35
|
+
const type = schema.type(rule.columnName);
|
|
36
|
+
const operators = type ? getAvailableOperators(type) : [];
|
|
37
|
+
const shape = getFilterValueShape(rule.operator);
|
|
38
|
+
const isNegated = negation !== undefined || NEGATIVE_OPERATORS.includes(rule.operator);
|
|
39
|
+
return (_jsxs("li", { className: "flex flex-col gap-1 py-1", "data-testid": LEGEND_CUBE_TEST_ID.FILTER_CONDITION, children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("div", { className: "min-w-0 flex-1", children: _jsx(CubeColumnPicker, { label: "Filter column", schema: schema, value: rule.columnName, disabled: readOnly, onChange: (name) => draft.setColumn(rule.key, name, schema) }) }), _jsxs("select", { "aria-label": "Filter operator", className: "h-6 min-w-0 max-w-[45%] shrink rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base", value: rule.operator, disabled: readOnly || !type, onChange: (event) => {
|
|
40
|
+
if (isFilterOperator(event.target.value)) {
|
|
41
|
+
draft.setOperator(rule.key, event.target.value);
|
|
42
|
+
}
|
|
43
|
+
}, children: [!operators.includes(rule.operator) && (_jsx("option", { value: rule.operator, disabled: true, children: FILTER_OPERATOR_DESCRIPTIONS[rule.operator] })), operators.map((operator) => (_jsx("option", { value: operator, children: FILTER_OPERATOR_DESCRIPTIONS[operator] }, operator)))] }), _jsx("button", { className: clsx(SMALL_BUTTON, {
|
|
44
|
+
'text-[var(--color-accent)]': isNegated,
|
|
45
|
+
}), "aria-label": "Negate the condition", "aria-pressed": isNegated, title: "Negate the condition, e.g. is and is not", disabled: readOnly || !type,
|
|
46
|
+
// a condition in a Not leaves it; otherwise its operator turns
|
|
47
|
+
onClick: () => draft.toggleNegation(negation?.key ?? rule.key), children: "Not" }), _jsx(CubeRemoveRuleButton, { ...props, label: "Remove the condition" })] }), type && shape !== 'none' && (_jsx("div", { className: "flex min-w-0", children: _jsx(CubeValueEditor, { label: "Filter value", type: type, shape: shape, value: rule.value, disabled: readOnly, onChange: (value) => draft.setValue(rule.key, value) }) })), type && isExactFloatComparison(rule.operator, type) && (_jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: FILTER_FLOAT_COMPARISON_HINT }))] }));
|
|
48
|
+
});
|
|
49
|
+
/** Any rule of the tree, by kind */
|
|
50
|
+
const CubeFilterRuleEditor = observer((props) => {
|
|
51
|
+
const { rule } = props;
|
|
52
|
+
if (rule instanceof ColumnComparisonFilter) {
|
|
53
|
+
return _jsx(CubeFilterCondition, { ...props, rule: rule });
|
|
54
|
+
}
|
|
55
|
+
if (rule instanceof CompositeFilter) {
|
|
56
|
+
return (_jsx("li", { children: _jsx(CubeFilterGroup, { ...props, group: rule, isTop: false }) }));
|
|
57
|
+
}
|
|
58
|
+
if (rule instanceof NotFilter) {
|
|
59
|
+
return (_jsxs("li", { className: "flex items-start gap-1", children: [_jsx("button", { className: clsx(SMALL_BUTTON, 'text-[var(--color-accent)]'), "aria-label": "Remove the negation", "aria-pressed": true, title: "Remove the negation", disabled: props.readOnly, onClick: () => props.draft.toggleNegation(rule.key), children: "Not" }), _jsx("ul", { className: "min-w-0 flex-1", children: _jsx(CubeFilterRuleEditor, { ...props, rule: rule.rule, negation: rule }) })] }));
|
|
60
|
+
}
|
|
61
|
+
// a rule this version can't read stays as it is
|
|
62
|
+
return (_jsxs("li", { className: "flex items-center gap-1 py-1 text-base text-[var(--color-status-warn)]", children: [_jsx("span", { className: "flex-1", children: MESSAGE_FILTER_UNSUPPORTED }), _jsx(CubeRemoveRuleButton, { ...props, label: "Remove the filter" })] }));
|
|
63
|
+
});
|
|
64
|
+
/** An And/Or group: its rules, and buttons to add to it */
|
|
65
|
+
const CubeFilterGroup = observer((props) => {
|
|
66
|
+
const { draft, readOnly, group, isTop, negation } = props;
|
|
67
|
+
return (_jsxs("div", { className: clsx('flex flex-col gap-1', {
|
|
68
|
+
'rounded-sm border border-[var(--color-border-subtle)] p-1': !isTop,
|
|
69
|
+
}), children: [_jsxs("div", { className: "flex items-center gap-1 text-sm", children: [_jsxs("select", { "aria-label": isTop ? 'Combine the conditions with' : 'Combine the group with', className: "h-6 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base", value: group.operator, disabled: readOnly, onChange: (event) => draft.setGroupOperator(group.key, event.target.value === CompositeFilterOperator.OR
|
|
70
|
+
? CompositeFilterOperator.OR
|
|
71
|
+
: CompositeFilterOperator.AND), children: [_jsx("option", { value: CompositeFilterOperator.AND, children: "All of (and)" }), _jsx("option", { value: CompositeFilterOperator.OR, children: "Any of (or)" })] }), _jsx("span", { className: "flex-1" }), !isTop && (_jsxs(_Fragment, { children: [_jsx("button", { className: clsx(SMALL_BUTTON, {
|
|
72
|
+
'text-[var(--color-accent)]': negation !== undefined,
|
|
73
|
+
}), "aria-label": "Negate the group", "aria-pressed": negation !== undefined, title: "Keep the rows the group doesn't match", disabled: readOnly,
|
|
74
|
+
// a group in a Not leaves it
|
|
75
|
+
onClick: () => draft.toggleNegation(negation?.key ?? group.key), children: "Not" }), _jsx(CubeRemoveRuleButton, { ...props, rule: group, label: "Remove the group" })] }))] }), _jsx("ul", { className: "flex flex-col pl-2", children: group.rules.map((rule) => (_jsx(CubeFilterRuleEditor, { ...props, rule: rule,
|
|
76
|
+
// the group's Not is not its rules'
|
|
77
|
+
negation: undefined }, rule.key))) }), _jsxs("div", { className: "flex gap-1", children: [_jsx(CubeButton, { disabled: readOnly, onClick: () => draft.addCondition(group.key), children: isTop ? 'Add condition' : 'Add condition to the group' }), _jsx(CubeButton, { disabled: readOnly, onClick: () => draft.addGroup(group.key), children: isTop ? 'Add group' : 'Add group to the group' })] })] }));
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* The Filter editor (spec §8.5): conditions of a column, an operator and a
|
|
81
|
+
* value, in And/Or groups, each of which can be negated. Operators follow
|
|
82
|
+
* the column's type; values are read as its type, and text that isn't one is
|
|
83
|
+
* kept, marked, to be fixed. Blank conditions are not stored.
|
|
84
|
+
*/
|
|
85
|
+
export const CubeFilterEditor = observer((props) => {
|
|
86
|
+
const draft = guaranteeType(props.draft, CubeFilterDraft);
|
|
87
|
+
const [schema] = props.inputSchemas;
|
|
88
|
+
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
|
+
});
|
|
90
|
+
//# sourceMappingURL=CubeFilterEditor.js.map
|
|
@@ -0,0 +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,sBAA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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 Join editor (spec §17.6): the join type, pairs of key columns, a left
|
|
19
|
+
* one from the Left input and a right one from the Right input, and Swap
|
|
20
|
+
* Inputs. A pair whose types can't be compared is marked; one on a column
|
|
21
|
+
* Cube can't type is warned about, not blocked.
|
|
22
|
+
*/
|
|
23
|
+
export declare const CubeJoinEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CubeJoinEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeJoinEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeJoinEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAgFvE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,WAAoB,mBAAmB;;CAmGhE,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { TimesIcon } from '@finos/legend-art';
|
|
18
|
+
import { areCompatibleTypes, getDuplicateJoinColumns, isJoinType, JOIN_TYPE_LABELS, JOIN_TYPES, } from '@finos/legend-cube';
|
|
19
|
+
import { guaranteeType, noop } from '@finos/legend-shared';
|
|
20
|
+
import { flowResult } from 'mobx';
|
|
21
|
+
import { observer } from 'mobx-react-lite';
|
|
22
|
+
import { useEffect } from 'react';
|
|
23
|
+
import { CUBE_TABLE_FLAG_LABELS } from '../../__lib__/LegendCubeLabels.js';
|
|
24
|
+
import { CubeTableFlag } from '../../graph-manager/CubeEngine.js';
|
|
25
|
+
import { CubeJoinDraft, isUntypedColumn, } from '../../stores/editors/CubeJoinDraft.js';
|
|
26
|
+
import { CubeButton } from '../CubeButton.js';
|
|
27
|
+
import { CubeColumnPicker } from './CubeColumnPicker.js';
|
|
28
|
+
const TYPE_UNKNOWN = CUBE_TABLE_FLAG_LABELS[CubeTableFlag.TYPE_UNKNOWN];
|
|
29
|
+
const CubeJoinKeyRow = observer((props) => {
|
|
30
|
+
const { editorProps, draft, pair, index, leftSchema, rightSchema } = props;
|
|
31
|
+
const { editorState, readOnly } = editorProps;
|
|
32
|
+
const { query } = editorState.document;
|
|
33
|
+
const { analysis, modelOutline } = editorState;
|
|
34
|
+
const [leftId, rightId] = query.getInputIds(draft.original.id);
|
|
35
|
+
const leftType = leftSchema.type(pair.left);
|
|
36
|
+
const rightType = rightSchema.type(pair.right);
|
|
37
|
+
const isIncompatible = leftType !== undefined &&
|
|
38
|
+
rightType !== undefined &&
|
|
39
|
+
!areCompatibleTypes(leftType, rightType);
|
|
40
|
+
const isUntyped = (leftId !== undefined &&
|
|
41
|
+
Boolean(pair.left) &&
|
|
42
|
+
isUntypedColumn(modelOutline, query, analysis, leftId, pair.left)) ||
|
|
43
|
+
(rightId !== undefined &&
|
|
44
|
+
Boolean(pair.right) &&
|
|
45
|
+
isUntypedColumn(modelOutline, query, analysis, rightId, pair.right));
|
|
46
|
+
const position = index + 1;
|
|
47
|
+
return (_jsxs("li", { className: "flex flex-col gap-1 border-b border-[var(--color-border-subtle)] py-1", children: [_jsxs("div", { className: "grid grid-cols-[1fr_auto_1fr_auto] items-center gap-1", children: [_jsx(CubeColumnPicker, { label: `Left join column ${position}`, schema: leftSchema, value: pair.left, invalid: isIncompatible, disabled: readOnly, onChange: (name) => draft.setLeftColumn(pair.key, name) }), _jsx("span", { className: "text-[var(--color-text-secondary)]", children: "=" }), _jsx(CubeColumnPicker, { label: `Right join column ${position}`, schema: rightSchema, value: pair.right, invalid: isIncompatible, disabled: readOnly, onChange: (name) => draft.setRightColumn(pair.key, name) }), _jsx("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 join columns ${position}`, title: "Remove these join columns", disabled: readOnly, onClick: () => draft.removePair(pair.key), children: _jsx(TimesIcon, {}) })] }), isIncompatible && (_jsx("div", { className: "text-sm text-[var(--color-status-error)]", children: `${leftType.displayName} and ${rightType.displayName} can't be compared` })), isUntyped && (_jsx("div", { className: "text-sm text-[var(--color-status-warn)]", title: TYPE_UNKNOWN.description, children: `${TYPE_UNKNOWN.label}: the column's real type is not known to Cube, so the engine may not match its values` }))] }));
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* The Join editor (spec §17.6): the join type, pairs of key columns, a left
|
|
51
|
+
* one from the Left input and a right one from the Right input, and Swap
|
|
52
|
+
* Inputs. A pair whose types can't be compared is marked; one on a column
|
|
53
|
+
* Cube can't type is warned about, not blocked.
|
|
54
|
+
*/
|
|
55
|
+
export const CubeJoinEditor = observer((props) => {
|
|
56
|
+
const { editorState, inputSchemas, readOnly } = props;
|
|
57
|
+
const draft = guaranteeType(props.draft, CubeJoinDraft);
|
|
58
|
+
const [leftSchema, rightSchema] = inputSchemas;
|
|
59
|
+
const model = editorState.document.context?.model;
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
flowResult(editorState.loadModelOutline()).catch(noop());
|
|
62
|
+
}, [editorState, model]);
|
|
63
|
+
const edited = draft.build();
|
|
64
|
+
const duplicates = getDuplicateJoinColumns(leftSchema, rightSchema, edited.leftColumns, edited.rightColumns);
|
|
65
|
+
const canAddPair = !readOnly &&
|
|
66
|
+
draft.pairs.length <
|
|
67
|
+
Math.min(leftSchema.columns.length, rightSchema.columns.length);
|
|
68
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 text-base", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("label", { className: "flex items-center gap-2", children: ["Join type", _jsx("select", { className: "h-6 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base", value: draft.joinType, disabled: readOnly, onChange: (event) => {
|
|
69
|
+
if (isJoinType(event.target.value)) {
|
|
70
|
+
draft.setJoinType(event.target.value);
|
|
71
|
+
}
|
|
72
|
+
}, children: JOIN_TYPES.map((joinType) => (_jsx("option", { value: joinType, children: JOIN_TYPE_LABELS[joinType] }, joinType))) })] }), _jsx("span", { className: "flex-1" }), _jsx(CubeButton, { title: "Swap the Left and Right inputs; the join columns follow them. Applies your changes too.", disabled: !editorState.nodeEditor.canSwapInputs, onClick: () => editorState.nodeEditor.swapInputs(), children: "Swap Inputs" })] }), _jsxs("div", { className: "grid grid-cols-[1fr_auto_1fr_auto] gap-1 text-sm text-[var(--color-text-secondary)]", children: [_jsx("span", { children: "Left" }), _jsx("span", {}), _jsx("span", { children: "Right" }), _jsx("span", {})] }), _jsx("ul", { "aria-label": "Join columns", children: draft.pairs.map((pair, index) => (_jsx(CubeJoinKeyRow, { editorProps: props, draft: draft, pair: pair, index: index, leftSchema: leftSchema, rightSchema: rightSchema }, pair.key))) }), _jsx("div", { children: _jsx(CubeButton, { title: canAddPair
|
|
73
|
+
? 'Add a pair of join columns'
|
|
74
|
+
: 'Every column of an input is already a join column', disabled: !canAddPair, onClick: () => draft.addPair(), children: "Add join columns" }) }), duplicates.length > 0 && (_jsxs("div", { className: "text-sm text-[var(--color-status-warn)]", children: [_jsx("div", { children: "In both inputs and not joined on, so the output can't keep both:" }), _jsx("ul", { "aria-label": "Columns in both inputs", children: duplicates.map((name) => (_jsx("li", { className: "font-mono", children: name }, name))) })] }))] }));
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=CubeJoinEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeJoinEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeJoinEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,gBAAgB,EAChB,UAAU,GAEX,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,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAA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E,CAAC,KAAK,CAAC,OAAO,EAAE,iCAGnB,GACT,EACL,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,eAAK,SAAS,EAAC,yCAAyC,aACtD,6FAGM,EACN,2BAAe,wBAAwB,YACpC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,aAAe,SAAS,EAAC,WAAW,YACjC,IAAI,IADE,IAAI,CAER,CACN,CAAC,GACC,IACD,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/**
|
|
18
|
+
* The node editor, in a side panel (spec §17.5): the node's label and id, its
|
|
19
|
+
* help, Select, and its type's editor. Edits stay in the panel until Apply
|
|
20
|
+
* or closing it; Cancel drops them. While an input is missing or invalid,
|
|
21
|
+
* the panel shows why instead of the editor, since there would be no
|
|
22
|
+
* columns to pick.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CubeNodeEditorPanel: ((props: {
|
|
25
|
+
editorState: CubeEditorState;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element | null) & {
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=CubeNodeEditorPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeEditorPanel.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeNodeEditorPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAgBvE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WACtB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAoJzC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 { QuestionCircleIcon, TimesIcon } from '@finos/legend-art';
|
|
18
|
+
import { isIncompleteError, isSchemasError, UnknownNode, } from '@finos/legend-cube';
|
|
19
|
+
import { observer } from 'mobx-react-lite';
|
|
20
|
+
import { CUBE_NODE_HELP_TEXT, SELECT_NODE_TOOLTIP, } from '../../__lib__/LegendCubeHelpText.js';
|
|
21
|
+
import { READ_ONLY_CUBE_TITLE } from '../../__lib__/LegendCubeLabels.js';
|
|
22
|
+
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
23
|
+
import { CUBE_NODE_DRAFT_FACTORIES } from '../../stores/editors/CubeNodeDraftRegistry.js';
|
|
24
|
+
import { CubeButton } from '../CubeButton.js';
|
|
25
|
+
import { CubeNodeIcon } from '../CubeNodeIcon.js';
|
|
26
|
+
import { CUBE_NODE_EDITORS } from './CubeNodeEditorRegistry.js';
|
|
27
|
+
/** The problems of the edited node against its inputs, as Apply would leave it */
|
|
28
|
+
const validateEdited = (node, inputSchemas) => {
|
|
29
|
+
const errors = [];
|
|
30
|
+
node.validate(inputSchemas, errors);
|
|
31
|
+
return [...new Set(errors)];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The node editor, in a side panel (spec §17.5): the node's label and id, its
|
|
35
|
+
* help, Select, and its type's editor. Edits stay in the panel until Apply
|
|
36
|
+
* or closing it; Cancel drops them. While an input is missing or invalid,
|
|
37
|
+
* the panel shows why instead of the editor, since there would be no
|
|
38
|
+
* columns to pick.
|
|
39
|
+
*/
|
|
40
|
+
export const CubeNodeEditorPanel = observer((props) => {
|
|
41
|
+
const { editorState } = props;
|
|
42
|
+
const { nodeEditor, readOnly } = editorState;
|
|
43
|
+
const { node, draft, edited } = nodeEditor;
|
|
44
|
+
if (!node || !draft || !edited) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const { query } = editorState.document;
|
|
48
|
+
const definition = editorState.registry.get(node.type);
|
|
49
|
+
const isCapture = query.selected === node.id;
|
|
50
|
+
const inputProblems = editorState
|
|
51
|
+
.getNodeErrors(node.id)
|
|
52
|
+
.filter((error) => isSchemasError(error) || isIncompleteError(error));
|
|
53
|
+
const inputSchemas = query
|
|
54
|
+
.getInputIds(node.id)
|
|
55
|
+
.map((inputId) => inputId === undefined
|
|
56
|
+
? undefined
|
|
57
|
+
: editorState.analysis.schemas.get(inputId))
|
|
58
|
+
.filter((schema) => schema !== undefined);
|
|
59
|
+
const Editor = CUBE_NODE_EDITORS.get(node.type);
|
|
60
|
+
const isEditable = CUBE_NODE_DRAFT_FACTORIES.has(node.type);
|
|
61
|
+
const problems = isEditable && !inputProblems.length
|
|
62
|
+
? validateEdited(edited, inputSchemas)
|
|
63
|
+
: [];
|
|
64
|
+
return (_jsxs("div", { className: "flex h-full flex-col border-l border-[var(--color-border-default)] bg-[var(--color-bg-panel)]", "data-testid": LEGEND_CUBE_TEST_ID.NODE_EDITOR, children: [_jsxs("div", { className: "flex h-8 shrink-0 items-center gap-2 border-b border-[var(--color-border-default)] bg-[var(--color-bg-panel-header)] px-2", children: [_jsx(CubeNodeIcon, { icon: definition?.icon, className: "shrink-0 text-[var(--color-text-secondary)]" }), _jsx("span", { className: "min-w-0 truncate text-lg font-medium", children: definition?.label ?? 'Unknown' }), _jsx("span", { className: "shrink-0 text-base text-[var(--color-text-muted)]", children: node.id }), definition?.beta && (_jsx("span", { className: "shrink-0 rounded-sm bg-[var(--color-accent)] px-1 text-xs font-medium text-[var(--color-text-on-accent)]", children: "BETA" })), _jsx("span", { className: "shrink-0 text-[var(--color-text-secondary)]", title: CUBE_NODE_HELP_TEXT[node.type] ??
|
|
65
|
+
CUBE_NODE_HELP_TEXT[UnknownNode.TYPE], role: "img", "aria-label": "Help", children: _jsx(QuestionCircleIcon, {}) }), _jsx("span", { className: "flex-1" }), isCapture ? (_jsx("span", { className: "shrink-0 text-base text-[var(--color-text-secondary)]", title: SELECT_NODE_TOOLTIP, children: "(Selected)" })) : (_jsx("button", { className: "shrink-0 text-base text-[var(--color-accent)] underline", title: SELECT_NODE_TOOLTIP, onClick: () => editorState.select(node.id), children: "Select" })), _jsx("button", { className: "flex h-6 w-6 shrink-0 items-center justify-center text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]", title: nodeEditor.hasChanges && !readOnly
|
|
66
|
+
? 'Close, applying the changes'
|
|
67
|
+
: 'Close', "aria-label": "Close the editor", onClick: () => nodeEditor.close(), children: _jsx(TimesIcon, {}) })] }), _jsxs("div", { className: "min-h-0 flex-1 overflow-auto p-2", children: [inputProblems.length ? (_jsx("div", { className: "text-base text-[var(--color-status-warn)]", role: "alert", children: inputProblems.map((problem) => (_jsx("div", { children: problem }, problem))) })) : Editor ? (_jsx(Editor, { editorState: editorState, draft: draft, inputSchemas: inputSchemas, readOnly: readOnly })) : (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: `${node.describe()}: this node can't be edited.` })), problems.length > 0 && (_jsx("div", { className: "mt-3 border-t border-[var(--color-border-subtle)] pt-2 text-base text-[var(--color-status-error)]", role: "alert", "aria-label": "Problems", children: problems.map((problem) => (_jsx("div", { children: problem }, problem))) }))] }), isEditable && (_jsxs("div", { className: "flex h-10 shrink-0 items-center justify-end gap-2 border-t border-[var(--color-border-default)] px-2", children: [_jsx(CubeButton, { title: "Drop the changes and close", onClick: () => nodeEditor.cancel(), children: "Cancel" }), _jsx(CubeButton, { primary: true, title: readOnly
|
|
68
|
+
? READ_ONLY_CUBE_TITLE
|
|
69
|
+
: 'Store the changes, as one step to undo', disabled: readOnly || !nodeEditor.hasChanges, onClick: () => nodeEditor.apply(), children: "Apply" })] }))] }));
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=CubeNodeEditorPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeEditorPanel.js","sourceRoot":"","sources":["../../../src/components/editors/CubeNodeEditorPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,cAAc,EAGd,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,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E,SAAS,EAAC,mGAAmG,EAC7G,IAAI,EAAC,OAAO,gBACD,UAAU,YAEpB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACzB,wBAAoB,OAAO,IAAjB,OAAO,CAAiB,CACnC,CAAC,GACE,CACP,IACG,EACL,UAAU,IAAI,CACb,eAAK,SAAS,EAAC,sGAAsG,aACnH,KAAC,UAAU,IACT,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,uBAGvB,EACb,KAAC,UAAU,IACT,OAAO,EAAE,IAAI,EACb,KAAK,EACH,QAAQ;4BACN,CAAC,CAAC,oBAAoB;4BACtB,CAAC,CAAC,wCAAwC,EAE9C,QAAQ,EAAE,QAAQ,IAAI,CAAC,UAAU,CAAC,UAAU,EAC5C,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,sBAGtB,IACT,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,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 Schema } from '@finos/legend-cube';
|
|
17
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
18
|
+
import type { CubeNodeDraft } from '../../stores/editors/CubeNodeDraft.js';
|
|
19
|
+
/**
|
|
20
|
+
* What the panel gives a node type's editor (PLAN §7.4). Edits go to the
|
|
21
|
+
* draft, which the panel's Apply stores; an action on the document goes
|
|
22
|
+
* through `editorState.nodeEditor` (e.g. `swapInputs`), which applies the
|
|
23
|
+
* draft first, so the panel never loses its edits under a replaced node.
|
|
24
|
+
*/
|
|
25
|
+
export interface CubeNodeEditorProps {
|
|
26
|
+
readonly editorState: CubeEditorState;
|
|
27
|
+
/** The node's draft, made by its type's factory in `CUBE_NODE_DRAFT_FACTORIES` */
|
|
28
|
+
readonly draft: CubeNodeDraft;
|
|
29
|
+
/**
|
|
30
|
+
* The schemas of the node's inputs, in port order, e.g. a Join's Left then
|
|
31
|
+
* Right. All are there: the panel shows the upstream error instead of the
|
|
32
|
+
* editor while an input is missing or invalid.
|
|
33
|
+
*/
|
|
34
|
+
readonly inputSchemas: readonly Schema[];
|
|
35
|
+
/** The cube was saved by a newer version: show, don't edit */
|
|
36
|
+
readonly readOnly: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The editor of each node type, by type. A type without one shows its
|
|
40
|
+
* description; a type with one either has a draft factory in
|
|
41
|
+
* `CUBE_NODE_DRAFT_FACTORIES` or edits nothing (a source).
|
|
42
|
+
*/
|
|
43
|
+
export declare const CUBE_NODE_EDITORS: ReadonlyMap<string, React.FC<CubeNodeEditorProps>>;
|
|
44
|
+
//# sourceMappingURL=CubeNodeEditorRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeEditorRegistry.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeNodeEditorRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,KAAK,MAAM,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAK3E;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IACtC,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CACzC,MAAM,EACN,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAK7B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { Filter, Join, RelationalTableSource, } from '@finos/legend-cube';
|
|
17
|
+
import { CubeFilterEditor } from './CubeFilterEditor.js';
|
|
18
|
+
import { CubeJoinEditor } from './CubeJoinEditor.js';
|
|
19
|
+
import { CubeSourceEditor } from './CubeSourceEditor.js';
|
|
20
|
+
/**
|
|
21
|
+
* The editor of each node type, by type. A type without one shows its
|
|
22
|
+
* description; a type with one either has a draft factory in
|
|
23
|
+
* `CUBE_NODE_DRAFT_FACTORIES` or edits nothing (a source).
|
|
24
|
+
*/
|
|
25
|
+
export const CUBE_NODE_EDITORS = new Map([
|
|
26
|
+
[RelationalTableSource.TYPE, CubeSourceEditor],
|
|
27
|
+
[Filter.TYPE, CubeFilterEditor],
|
|
28
|
+
[Join.TYPE, CubeJoinEditor],
|
|
29
|
+
]);
|
|
30
|
+
//# sourceMappingURL=CubeNodeEditorRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeNodeEditorRegistry.js","sourceRoot":"","sources":["../../../src/components/editors/CubeNodeEditorRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,MAAM,EACN,IAAI,EACJ,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAsBzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAG1B,IAAI,GAAG,CAAwC;IACjD,CAAC,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAC9C,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAC/B,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;CAC5B,CAAC,CAAC"}
|
|
@@ -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 table source (spec §17.6): where it reads from, its columns as the engine
|
|
19
|
+
* typed them, and Refresh, which types the table again. Nothing here is
|
|
20
|
+
* edited, so a refresh is no undo step.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CubeSourceEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=CubeSourceEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSourceEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeSourceEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WAAoB,mBAAmB;;CA8ElE,CAAC"}
|