@finos/legend-cube-builder 0.0.2 → 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/README.md +60 -1
- package/docs/adding-an-operation.md +92 -0
- package/docs/hosting.md +79 -0
- package/docs/testing.md +83 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -1
- package/lib/__lib__/LegendCubeHelpText.js +11 -3
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -1
- package/lib/__lib__/LegendCubeLabels.d.ts +19 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -1
- package/lib/__lib__/LegendCubeLabels.js +19 -0
- package/lib/__lib__/LegendCubeLabels.js.map +1 -1
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts +6 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -1
- package/lib/__test-utils__/CubeEngineTestSupport.js +30 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -1
- 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__/FakeCubeEngine.d.ts.map +1 -1
- package/lib/__test-utils__/FakeCubeEngine.js +7 -1
- package/lib/__test-utils__/FakeCubeEngine.js.map +1 -1
- package/lib/components/CubeNodeIcon.d.ts.map +1 -1
- package/lib/components/CubeNodeIcon.js +12 -2
- package/lib/components/CubeNodeIcon.js.map +1 -1
- package/lib/components/canvas/CubeCanvas.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvas.js +5 -3
- package/lib/components/canvas/CubeCanvas.js.map +1 -1
- package/lib/components/canvas/CubeCanvasElements.d.ts +2 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvasElements.js +2 -1
- package/lib/components/canvas/CubeCanvasElements.js.map +1 -1
- package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -1
- package/lib/components/canvas/CubeCanvasNode.js +5 -2
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -1
- package/lib/components/editors/CubeColumnPicker.d.ts +9 -2
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -1
- package/lib/components/editors/CubeColumnPicker.js +9 -4
- package/lib/components/editors/CubeColumnPicker.js.map +1 -1
- 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/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.map +1 -1
- package/lib/components/editors/CubeJoinEditor.js +11 -3
- package/lib/components/editors/CubeJoinEditor.js.map +1 -1
- package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -1
- package/lib/components/editors/CubeNodeEditorPanel.js +3 -2
- package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -1
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -1
- package/lib/components/editors/CubeNodeEditorRegistry.js +14 -1
- package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -1
- 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.map +1 -1
- package/lib/components/editors/CubeSourceEditor.js +1 -2
- package/lib/components/editors/CubeSourceEditor.js.map +1 -1
- package/lib/components/editors/CubeValueEditor.d.ts.map +1 -1
- package/lib/components/editors/CubeValueEditor.js +2 -1
- package/lib/components/editors/CubeValueEditor.js.map +1 -1
- package/lib/components/grid/CubeGridRegion.d.ts.map +1 -1
- package/lib/components/grid/CubeGridRegion.js +1 -1
- package/lib/components/grid/CubeGridRegion.js.map +1 -1
- package/lib/components/grid/CubeResultGrid.d.ts +14 -1
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -1
- package/lib/components/grid/CubeResultGrid.js +41 -5
- package/lib/components/grid/CubeResultGrid.js.map +1 -1
- package/lib/graph-manager/CubeEngine.d.ts +13 -0
- package/lib/graph-manager/CubeEngine.d.ts.map +1 -1
- package/lib/graph-manager/CubeEngine.js.map +1 -1
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts +8 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -1
- package/lib/graph-manager/CubeModelOutlineHelper.js +21 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +56 -3
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -1
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +3 -3
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/stores/CubeEditorState.d.ts +34 -4
- package/lib/stores/CubeEditorState.d.ts.map +1 -1
- package/lib/stores/CubeEditorState.js +87 -6
- package/lib/stores/CubeEditorState.js.map +1 -1
- package/lib/stores/CubeExecutionState.d.ts.map +1 -1
- package/lib/stores/CubeExecutionState.js +19 -3
- package/lib/stores/CubeExecutionState.js.map +1 -1
- 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/CubeNodeEditorState.d.ts +19 -1
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -1
- package/lib/stores/CubeNodeEditorState.js +55 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -1
- package/lib/stores/CubeShowPureState.d.ts +4 -1
- package/lib/stores/CubeShowPureState.d.ts.map +1 -1
- package/lib/stores/CubeShowPureState.js +22 -5
- package/lib/stores/CubeShowPureState.js.map +1 -1
- 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 +13 -5
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -1
- package/lib/stores/editors/CubeJoinDraft.js +21 -12
- package/lib/stores/editors/CubeJoinDraft.js.map +1 -1
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +6 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -1
- package/lib/stores/editors/CubeNodeDraftRegistry.js +23 -1
- package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -1
- 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/package.json +8 -8
- package/src/__lib__/LegendCubeHelpText.ts +22 -2
- package/src/__lib__/LegendCubeLabels.ts +30 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +35 -0
- package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
- package/src/__test-utils__/FakeCubeEngine.ts +7 -1
- package/src/components/CubeNodeIcon.tsx +18 -1
- package/src/components/canvas/CubeCanvas.tsx +5 -3
- package/src/components/canvas/CubeCanvasElements.ts +4 -1
- package/src/components/canvas/CubeCanvasNode.tsx +9 -1
- package/src/components/editors/CubeColumnPicker.tsx +36 -12
- package/src/components/editors/CubeDistinctEditor.tsx +28 -0
- package/src/components/editors/CubeIntegerField.tsx +51 -0
- package/src/components/editors/CubeJoinEditor.tsx +26 -3
- package/src/components/editors/CubeNodeEditorPanel.tsx +12 -1
- package/src/components/editors/CubeNodeEditorRegistry.ts +20 -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 +0 -10
- package/src/components/editors/CubeValueEditor.tsx +2 -1
- package/src/components/grid/CubeGridRegion.tsx +1 -0
- package/src/components/grid/CubeResultGrid.tsx +59 -5
- package/src/graph-manager/CubeEngine.ts +14 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +26 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +89 -3
- package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +6 -3
- package/src/stores/CubeEditorState.ts +110 -5
- package/src/stores/CubeExecutionState.ts +36 -3
- package/src/stores/CubeGridQuickActions.ts +129 -0
- package/src/stores/CubeNodeEditorState.ts +70 -1
- package/src/stores/CubeShowPureState.ts +27 -5
- package/src/stores/editors/CubeIntegerText.ts +34 -0
- package/src/stores/editors/CubeJoinDraft.ts +43 -16
- package/src/stores/editors/CubeNodeDraftRegistry.ts +35 -1
- 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/tsconfig.json +15 -0
|
@@ -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":"","sources":["../../../src/stores/editors/CubeRestrictDraft.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;AAEnD;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,MAAc,EAAY,EAAE,CAAC;IAC3E,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACxD,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC;CAC7D,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,CAAoB,EAAE,CAAoB,EAAW,EAAE,CACxE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAuB;IAC5D,OAAO,CAAoB;IAC3B,0EAA0E;IAClE,OAAO,GAAG,KAAK,CAAC;IAExB,YAAY,QAAkB;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,cAAc,C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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/stores/editors/CubeRowCountDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQnD;;;;;;;GAOG;AACH,MAAM,OAAO,iBAEX,SAAQ,aAAgB;IACxB,QAAQ,CAAS;IACjB,gEAAgE;IAC/C,WAAW,CAAS;IAErC,YAAY,QAAW;QACrB,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,cAAc,CAAC,IAAI,EAAE;YACnB,QAAQ,EAAE,UAAU;YACpB,WAAW,EAAE,MAAM;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5E,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;IACnC,CAAC;IAED,uEAAuE;IACvE,IAAI,IAAI;QACN,OAAO,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,2EAA2E;IAC3E,KAAK;QACH,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,WAAW,IAAI,IAAI,KAAK,QAAQ,CAAC,IAAI;YACxE,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,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 { 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"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
const textOf = (value) => value === undefined ? '' : String(value);
|
|
20
|
+
/**
|
|
21
|
+
* The Slice editor's draft (spec §17.6: start and stop integer fields). It
|
|
22
|
+
* keeps the texts as typed; a text that isn't a whole number builds a
|
|
23
|
+
* cleared bound, which the node reports, never the default (spec §7.9). A
|
|
24
|
+
* field that holds the text it opened with keeps its saved bound, so a bound
|
|
25
|
+
* the field can't read (`1.5` from an imported spec) is kept unless the user
|
|
26
|
+
* types something else in that field.
|
|
27
|
+
*/
|
|
28
|
+
export class CubeSliceDraft extends CubeNodeDraft {
|
|
29
|
+
startText;
|
|
30
|
+
stopText;
|
|
31
|
+
/** The texts the fields opened with, which keep the saved bounds */
|
|
32
|
+
initialStartText;
|
|
33
|
+
initialStopText;
|
|
34
|
+
constructor(original) {
|
|
35
|
+
super(original);
|
|
36
|
+
makeObservable(this, {
|
|
37
|
+
startText: observable,
|
|
38
|
+
stopText: observable,
|
|
39
|
+
setStartText: action,
|
|
40
|
+
setStopText: action,
|
|
41
|
+
});
|
|
42
|
+
this.initialStartText = textOf(original.start);
|
|
43
|
+
this.initialStopText = textOf(original.stop);
|
|
44
|
+
this.startText = this.initialStartText;
|
|
45
|
+
this.stopText = this.initialStopText;
|
|
46
|
+
}
|
|
47
|
+
/** The start the text gives: `undefined` unless it is a whole number */
|
|
48
|
+
get start() {
|
|
49
|
+
return parseWholeNumberText(this.startText);
|
|
50
|
+
}
|
|
51
|
+
/** The stop the text gives: `undefined` unless it is a whole number */
|
|
52
|
+
get stop() {
|
|
53
|
+
return parseWholeNumberText(this.stopText);
|
|
54
|
+
}
|
|
55
|
+
setStartText(text) {
|
|
56
|
+
this.startText = text;
|
|
57
|
+
}
|
|
58
|
+
setStopText(text) {
|
|
59
|
+
this.stopText = text;
|
|
60
|
+
}
|
|
61
|
+
/** The original while each field holds its opening text or the same bound */
|
|
62
|
+
build() {
|
|
63
|
+
const { original, start, stop } = this;
|
|
64
|
+
const keepStart = this.startText.trim() === this.initialStartText ||
|
|
65
|
+
start === original.start;
|
|
66
|
+
const keepStop = this.stopText.trim() === this.initialStopText || stop === original.stop;
|
|
67
|
+
return keepStart && keepStop
|
|
68
|
+
? original
|
|
69
|
+
: original.withRange(keepStart ? original.start : start, keepStop ? original.stop : stop);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=CubeSliceDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSliceDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeSliceDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,GAAG,CAAC,KAAyB,EAAU,EAAE,CACnD,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAA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GACZ,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,eAAe,IAAI,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC;QAC1E,OAAO,SAAS,IAAI,QAAQ;YAC1B,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,QAAQ,CAAC,SAAS,CAChB,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAClC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAChC,CAAC;IACR,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 ColumnDirection, type Sort, SortDirection } from '@finos/legend-cube';
|
|
17
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
18
|
+
/** One row of the Sort editor: a column, `''` until picked, and its direction */
|
|
19
|
+
export interface CubeSortRow {
|
|
20
|
+
/** Identifies the row in the editor */
|
|
21
|
+
readonly key: number;
|
|
22
|
+
readonly column: string;
|
|
23
|
+
readonly direction: SortDirection;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The Sort editor's draft (spec §17.6: a list of column and direction rows,
|
|
27
|
+
* most significant first). A row without a column is left out when built, as
|
|
28
|
+
* a Rename's blank rows are. While the rows are the ones it opened with, the
|
|
29
|
+
* original is given back, so a saved key without a column (from an imported
|
|
30
|
+
* spec) is kept until the rows change; removing its row removes it.
|
|
31
|
+
*/
|
|
32
|
+
export declare class CubeSortDraft extends CubeNodeDraft<Sort> {
|
|
33
|
+
rows: readonly CubeSortRow[];
|
|
34
|
+
/** The rows' keys when the editor opened, blank ones included */
|
|
35
|
+
private readonly initialKeys;
|
|
36
|
+
constructor(original: Sort);
|
|
37
|
+
/** Every row's key, a blank one included */
|
|
38
|
+
private get keys();
|
|
39
|
+
/** The keys the rows build, in order: a row without a column is left out */
|
|
40
|
+
get sorts(): ColumnDirection[];
|
|
41
|
+
addRow(): void;
|
|
42
|
+
removeRow(key: number): void;
|
|
43
|
+
/** Moves a row one place up (`-1`) or down (`1`), if it can go there */
|
|
44
|
+
moveRow(key: number, offset: -1 | 1): void;
|
|
45
|
+
setColumn(key: number, column: string): void;
|
|
46
|
+
setDirection(key: number, direction: SortDirection): void;
|
|
47
|
+
build(): Sort;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=CubeSortDraft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSortDraft.d.ts","sourceRoot":"","sources":["../../../src/stores/editors/CubeSortDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,aAAa,EACd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CACnC;AAqBD;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,aAAa,CAAC,IAAI,CAAC;IACpD,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IAC7B,iEAAiE;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;gBAE7C,QAAQ,EAAE,IAAI;IAoB1B,4CAA4C;IAC5C,OAAO,KAAK,IAAI,GAEf;IAED,4EAA4E;IAC5E,IAAI,KAAK,IAAI,eAAe,EAAE,CAE7B;IAED,MAAM,IAAI,IAAI;IAId,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B,wEAAwE;IACxE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI;IAc1C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAM5C,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,IAAI;IAMzD,KAAK,IAAI,IAAI;CAMd"}
|
|
@@ -0,0 +1,99 @@
|
|
|
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 { SortDirection, } from '@finos/legend-cube';
|
|
17
|
+
import { action, makeObservable, observable } from 'mobx';
|
|
18
|
+
import { CubeNodeDraft } from './CubeNodeDraft.js';
|
|
19
|
+
let nextRowKey = 1;
|
|
20
|
+
const blankRow = () => ({
|
|
21
|
+
key: nextRowKey++,
|
|
22
|
+
column: '',
|
|
23
|
+
direction: SortDirection.ASC,
|
|
24
|
+
});
|
|
25
|
+
const isSameSorts = (a, b) => a.length === b.length &&
|
|
26
|
+
a.every((sort, index) => sort.column === b[index]?.column &&
|
|
27
|
+
sort.direction === b[index]?.direction);
|
|
28
|
+
/**
|
|
29
|
+
* The Sort editor's draft (spec §17.6: a list of column and direction rows,
|
|
30
|
+
* most significant first). A row without a column is left out when built, as
|
|
31
|
+
* a Rename's blank rows are. While the rows are the ones it opened with, the
|
|
32
|
+
* original is given back, so a saved key without a column (from an imported
|
|
33
|
+
* spec) is kept until the rows change; removing its row removes it.
|
|
34
|
+
*/
|
|
35
|
+
export class CubeSortDraft extends CubeNodeDraft {
|
|
36
|
+
rows;
|
|
37
|
+
/** The rows' keys when the editor opened, blank ones included */
|
|
38
|
+
initialKeys;
|
|
39
|
+
constructor(original) {
|
|
40
|
+
super(original);
|
|
41
|
+
makeObservable(this, {
|
|
42
|
+
rows: observable.ref,
|
|
43
|
+
addRow: action,
|
|
44
|
+
removeRow: action,
|
|
45
|
+
moveRow: action,
|
|
46
|
+
setColumn: action,
|
|
47
|
+
setDirection: action,
|
|
48
|
+
});
|
|
49
|
+
this.rows = original.sorts.length
|
|
50
|
+
? original.sorts.map(({ column, direction }) => ({
|
|
51
|
+
key: nextRowKey++,
|
|
52
|
+
column,
|
|
53
|
+
direction,
|
|
54
|
+
}))
|
|
55
|
+
: [blankRow()];
|
|
56
|
+
this.initialKeys = this.keys;
|
|
57
|
+
}
|
|
58
|
+
/** Every row's key, a blank one included */
|
|
59
|
+
get keys() {
|
|
60
|
+
return this.rows.map(({ column, direction }) => ({ column, direction }));
|
|
61
|
+
}
|
|
62
|
+
/** The keys the rows build, in order: a row without a column is left out */
|
|
63
|
+
get sorts() {
|
|
64
|
+
return this.keys.filter(({ column }) => column);
|
|
65
|
+
}
|
|
66
|
+
addRow() {
|
|
67
|
+
this.rows = [...this.rows, blankRow()];
|
|
68
|
+
}
|
|
69
|
+
removeRow(key) {
|
|
70
|
+
this.rows = this.rows.filter((row) => row.key !== key);
|
|
71
|
+
}
|
|
72
|
+
/** Moves a row one place up (`-1`) or down (`1`), if it can go there */
|
|
73
|
+
moveRow(key, offset) {
|
|
74
|
+
const from = this.rows.findIndex((row) => row.key === key);
|
|
75
|
+
const to = from + offset;
|
|
76
|
+
if (from < 0 || to < 0 || to >= this.rows.length) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const rows = [...this.rows];
|
|
80
|
+
[rows[from], rows[to]] = [
|
|
81
|
+
rows[to],
|
|
82
|
+
rows[from],
|
|
83
|
+
];
|
|
84
|
+
this.rows = rows;
|
|
85
|
+
}
|
|
86
|
+
setColumn(key, column) {
|
|
87
|
+
this.rows = this.rows.map((row) => row.key === key ? { ...row, column } : row);
|
|
88
|
+
}
|
|
89
|
+
setDirection(key, direction) {
|
|
90
|
+
this.rows = this.rows.map((row) => row.key === key ? { ...row, direction } : row);
|
|
91
|
+
}
|
|
92
|
+
build() {
|
|
93
|
+
const { original } = this;
|
|
94
|
+
return isSameSorts(this.keys, this.initialKeys)
|
|
95
|
+
? original
|
|
96
|
+
: original.withSorts(this.sorts);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=CubeSortDraft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSortDraft.js","sourceRoot":"","sources":["../../../src/stores/editors/CubeSortDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,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;AA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GAAG,IAAI,CAAC;IACnB,CAAC;IAED,SAAS,CAAC,GAAW,EAAE,MAAc;QACnC,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,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAC3C,CAAC;IACJ,CAAC;IAED,YAAY,CAAC,GAAW,EAAE,SAAwB;QAChD,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,SAAS,EAAE,CAAC,CAAC,CAAC,GAAG,CAC9C,CAAC;IACJ,CAAC;IAED,KAAK;QACH,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC1B,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC;YAC7C,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos/legend-cube-builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Legend Cube builder: the canvas UI and the Legend engine adapter of the Legend Cube query builder",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"legend",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@dagrejs/dagre": "1.1.4",
|
|
48
|
-
"@finos/legend-application": "16.0.
|
|
49
|
-
"@finos/legend-art": "7.1.
|
|
50
|
-
"@finos/legend-cube": "0.0.
|
|
51
|
-
"@finos/legend-graph": "32.7.
|
|
52
|
-
"@finos/legend-lego": "2.0.
|
|
53
|
-
"@finos/legend-shared": "11.0.
|
|
48
|
+
"@finos/legend-application": "16.0.127",
|
|
49
|
+
"@finos/legend-art": "7.1.167",
|
|
50
|
+
"@finos/legend-cube": "0.0.3",
|
|
51
|
+
"@finos/legend-graph": "32.7.5",
|
|
52
|
+
"@finos/legend-lego": "2.0.229",
|
|
53
|
+
"@finos/legend-shared": "11.0.32",
|
|
54
54
|
"@types/react": "19.0.10",
|
|
55
55
|
"@types/react-dom": "19.0.4",
|
|
56
56
|
"@xyflow/react": "12.4.4",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"serializr": "3.0.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@finos/legend-dev-utils": "2.2.
|
|
65
|
+
"@finos/legend-dev-utils": "2.2.9",
|
|
66
66
|
"@jest/globals": "29.7.0",
|
|
67
67
|
"@testing-library/dom": "10.4.0",
|
|
68
68
|
"@testing-library/react": "16.2.0",
|
|
@@ -15,21 +15,41 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
+
Distinct,
|
|
19
|
+
Drop,
|
|
18
20
|
Filter,
|
|
19
21
|
Join,
|
|
22
|
+
Limit,
|
|
20
23
|
RelationalTableSource,
|
|
24
|
+
Rename,
|
|
25
|
+
Restrict,
|
|
26
|
+
Slice,
|
|
27
|
+
Sort,
|
|
21
28
|
UnknownNode,
|
|
22
29
|
} from '@finos/legend-cube';
|
|
23
30
|
|
|
24
|
-
// The node editor's help text, verbatim from the original (spec §17.9)
|
|
25
|
-
//
|
|
31
|
+
// The node editor's help text, verbatim from the original (spec §17.9), but
|
|
32
|
+
// Slice's, which counts rows from 0 and leaves the stop row out (D5, PLAN
|
|
33
|
+
// §11.4). A new node type adds its entry here.
|
|
26
34
|
|
|
27
35
|
export const CUBE_NODE_HELP_TEXT: Readonly<Record<string, string>> = {
|
|
28
36
|
[RelationalTableSource.TYPE]: 'Sources data from relational database table.',
|
|
37
|
+
[Distinct.TYPE]: 'Removes duplicate rows from the previous data set.',
|
|
38
|
+
[Drop.TYPE]:
|
|
39
|
+
'Reduces the number of rows in the previous data set, removing the specified number of rows from the beginning of the data set.',
|
|
29
40
|
[Filter.TYPE]:
|
|
30
41
|
'Reduces the number of rows in the previous data set, keeping only rows matching the specified criteria.',
|
|
31
42
|
[Join.TYPE]:
|
|
32
43
|
'Joins two previous data sets using specified columns as join keys.',
|
|
44
|
+
[Limit.TYPE]:
|
|
45
|
+
'Reduces the number of rows in the previous data set, keeping the specified number of rows from the beginning of the data set.',
|
|
46
|
+
[Rename.TYPE]:
|
|
47
|
+
'Renames specified columns in the previous data set to new names.',
|
|
48
|
+
[Restrict.TYPE]: 'Restricts outgoing data set to the specified columns only.',
|
|
49
|
+
[Slice.TYPE]:
|
|
50
|
+
'Reduces the number of rows in the previous data set, keeping only the rows from position "start" up to, but not including, position "stop", counting from 0.',
|
|
51
|
+
[Sort.TYPE]:
|
|
52
|
+
'Reorders rows of the previous data set by one or more columns, either in ascending or descending order per column.',
|
|
33
53
|
[UnknownNode.TYPE]: 'Source or transformation unknown to the application.',
|
|
34
54
|
};
|
|
35
55
|
|
|
@@ -107,6 +107,24 @@ export const getSchemaDriftWarning = (diff: SchemaDiff): string => {
|
|
|
107
107
|
return `This table changed since the cube was saved: ${changes.join('; ')}`;
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
+
/** Why the Sort editor's picker doesn't offer a column, after its type */
|
|
111
|
+
export const CUBE_SORT_COLUMN_DISABLED_REASON = {
|
|
112
|
+
NOT_SORTABLE: "can't be sorted",
|
|
113
|
+
TAKEN: 'already sorted on',
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** Why the grid's quick actions (spec §12.4) can't be used */
|
|
117
|
+
export const CUBE_QUICK_ACTION_DISABLED_REASON = {
|
|
118
|
+
STALE_ROWS:
|
|
119
|
+
'Execute again: these rows are from an earlier version of the query.',
|
|
120
|
+
RUNNING: 'Wait for the run to finish.',
|
|
121
|
+
UNREADABLE_VALUE: "This value can't be used in a filter.",
|
|
122
|
+
notSortable: (typeName: string): string =>
|
|
123
|
+
`Values of type ${typeName} can't be sorted.`,
|
|
124
|
+
notComparable: (typeName: string): string =>
|
|
125
|
+
`Values of type ${typeName} can't be compared.`,
|
|
126
|
+
};
|
|
127
|
+
|
|
110
128
|
/** Beside a condition comparing a floating-point column for equality (R133) */
|
|
111
129
|
export const FILTER_FLOAT_COMPARISON_HINT =
|
|
112
130
|
'exact comparison on floating-point columns may not match';
|
|
@@ -139,3 +157,15 @@ export const getEditorClosedNotice = (
|
|
|
139
157
|
/** The warning on a source with saved columns that the engine couldn't type again */
|
|
140
158
|
export const getSourceRecheckWarning = (firstLine: string): string =>
|
|
141
159
|
`Could not re-check this table, so it keeps its saved columns: ${firstLine}`;
|
|
160
|
+
|
|
161
|
+
/** Under the Slice editor's fields: the range counts from 0, and leaves out its stop row (D5) */
|
|
162
|
+
export const SLICE_RANGE_HINT =
|
|
163
|
+
'Rows count from 0: the start row is kept, the stop row is not.';
|
|
164
|
+
|
|
165
|
+
/** The Distinct editor's text: it has nothing to set (spec §17.6) */
|
|
166
|
+
export const DISTINCT_EDITOR_TEXT =
|
|
167
|
+
'Keeps one row of each set of identical rows. There is nothing to set.';
|
|
168
|
+
|
|
169
|
+
/** Under the Rename editor's rows: the rule for new column names (PLAN §11.4) */
|
|
170
|
+
export const COLUMN_NAME_RULES_HINT =
|
|
171
|
+
'Names can\'t start or end with a space, or contain " or \\ or control characters, and have at most 128 characters.';
|