@finos/legend-data-cube 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/DataCubePlaceholder.d.ts.map +1 -1
- package/lib/components/DataCubePlaceholder.js +2 -1
- package/lib/components/DataCubePlaceholder.js.map +1 -1
- package/lib/components/core/DataCubePureCodeEditorUtils.d.ts +2 -1
- package/lib/components/core/DataCubePureCodeEditorUtils.d.ts.map +1 -1
- package/lib/components/core/DataCubePureCodeEditorUtils.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditor.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditor.js +4 -2
- package/lib/components/view/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnsPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnsPanel.js +3 -3
- package/lib/components/view/editor/DataCubeEditorColumnsPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnsSelector.d.ts +47 -0
- package/lib/components/view/editor/DataCubeEditorColumnsSelector.d.ts.map +1 -0
- package/lib/components/view/editor/{DataCubeEditorColumnSelector.js → DataCubeEditorColumnsSelector.js} +70 -55
- package/lib/components/view/editor/DataCubeEditorColumnsSelector.js.map +1 -0
- package/lib/components/view/editor/DataCubeEditorDimensionsPanel.d.ts +3 -13
- package/lib/components/view/editor/DataCubeEditorDimensionsPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorDimensionsPanel.js +707 -264
- package/lib/components/view/editor/DataCubeEditorDimensionsPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorHorizontalPivotsPanel.js +2 -2
- package/lib/components/view/editor/DataCubeEditorHorizontalPivotsPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorSortsPanel.js +2 -2
- package/lib/components/view/editor/DataCubeEditorSortsPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorVerticalPivotsPanel.js +2 -2
- package/lib/components/view/editor/DataCubeEditorVerticalPivotsPanel.js.map +1 -1
- package/lib/components/view/{grid/DataCubeGridShared.d.ts → extend/DataCubeCodeEditor.d.ts} +7 -3
- package/lib/components/view/extend/DataCubeCodeEditor.d.ts.map +1 -0
- package/lib/components/view/extend/DataCubeCodeEditor.js +114 -0
- package/lib/components/view/extend/DataCubeCodeEditor.js.map +1 -0
- package/lib/components/view/extend/DataCubeCodeEditorState.d.ts +43 -0
- package/lib/components/view/extend/DataCubeCodeEditorState.d.ts.map +1 -0
- package/lib/components/view/extend/DataCubeCodeEditorState.js +37 -0
- package/lib/components/view/extend/DataCubeCodeEditorState.js.map +1 -0
- package/lib/components/view/extend/DataCubeColumnEditor.d.ts.map +1 -1
- package/lib/components/view/extend/DataCubeColumnEditor.js +5 -84
- package/lib/components/view/extend/DataCubeColumnEditor.js.map +1 -1
- package/lib/components/view/grid/DataCubeGrid.d.ts +2 -1
- package/lib/components/view/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/view/grid/DataCubeGrid.js +29 -19
- package/lib/components/view/grid/DataCubeGrid.js.map +1 -1
- package/lib/components/view/grid/DataCubeMultidimensionalGrid.d.ts +1 -1
- package/lib/components/view/grid/DataCubeMultidimensionalGrid.d.ts.map +1 -1
- package/lib/components/view/grid/DataCubeMultidimensionalGrid.js +2 -1
- package/lib/components/view/grid/DataCubeMultidimensionalGrid.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/DataCubeAPI.d.ts.map +1 -1
- package/lib/stores/DataCubeAPI.js +3 -1
- package/lib/stores/DataCubeAPI.js.map +1 -1
- package/lib/stores/core/DataCubeEngine.d.ts +1 -1
- package/lib/stores/core/DataCubeEngine.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQueryEngine.d.ts +5 -0
- package/lib/stores/core/DataCubeQueryEngine.d.ts.map +1 -1
- package/lib/stores/core/DataCubeQueryEngine.js +6 -0
- package/lib/stores/core/DataCubeQueryEngine.js.map +1 -1
- package/lib/stores/core/DataCubeSnapshot.d.ts +1 -1
- package/lib/stores/core/DataCubeSnapshot.d.ts.map +1 -1
- package/lib/stores/core/model/AdhocQueryDataCubeSource.d.ts +2 -0
- package/lib/stores/core/model/AdhocQueryDataCubeSource.d.ts.map +1 -1
- package/lib/stores/core/model/AdhocQueryDataCubeSource.js +3 -0
- package/lib/stores/core/model/AdhocQueryDataCubeSource.js.map +1 -1
- package/lib/stores/core/model/DataCubeConfiguration.d.ts +11 -0
- package/lib/stores/core/model/DataCubeConfiguration.d.ts.map +1 -1
- package/lib/stores/core/model/DataCubeConfiguration.js +19 -1
- package/lib/stores/core/model/DataCubeConfiguration.js.map +1 -1
- package/lib/stores/services/DataCubeSettingService.d.ts.map +1 -1
- package/lib/stores/services/DataCubeSettingService.js +10 -6
- package/lib/stores/services/DataCubeSettingService.js.map +1 -1
- package/lib/stores/view/DataCubeInfoState.d.ts +2 -0
- package/lib/stores/view/DataCubeInfoState.d.ts.map +1 -1
- package/lib/stores/view/DataCubeInfoState.js +3 -0
- package/lib/stores/view/DataCubeInfoState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.d.ts +8 -8
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.js +6 -6
- package/lib/stores/view/editor/DataCubeEditorColumnsPanelState.js.map +1 -1
- package/lib/stores/view/editor/{DataCubeEditorColumnSelectorState.d.ts → DataCubeEditorColumnsSelectorState.d.ts} +6 -6
- package/lib/stores/view/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -0
- package/lib/stores/view/editor/{DataCubeEditorColumnSelectorState.js → DataCubeEditorColumnsSelectorState.js} +4 -4
- package/lib/stores/view/editor/DataCubeEditorColumnsSelectorState.js.map +1 -0
- package/lib/stores/view/editor/DataCubeEditorDimensionsPanelState.d.ts +29 -6
- package/lib/stores/view/editor/DataCubeEditorDimensionsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorDimensionsPanelState.js +102 -39
- package/lib/stores/view/editor/DataCubeEditorDimensionsPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts +5 -5
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.js +7 -6
- package/lib/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.d.ts +2 -1
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.js +5 -0
- package/lib/stores/view/editor/DataCubeEditorMutableConfiguration.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.d.ts +5 -5
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.js +6 -6
- package/lib/stores/view/editor/DataCubeEditorSortsPanelState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorState.d.ts +3 -0
- package/lib/stores/view/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorState.js +6 -0
- package/lib/stores/view/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.d.ts +5 -5
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.d.ts.map +1 -1
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.js +6 -6
- package/lib/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.js.map +1 -1
- package/lib/stores/view/extend/DataCubeColumnEditorState.d.ts +7 -14
- package/lib/stores/view/extend/DataCubeColumnEditorState.d.ts.map +1 -1
- package/lib/stores/view/extend/DataCubeColumnEditorState.js +14 -22
- package/lib/stores/view/extend/DataCubeColumnEditorState.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.d.ts +2 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.js +7 -0
- package/lib/stores/view/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientExportEngine.js +1 -1
- package/lib/stores/view/grid/DataCubeGridClientExportEngine.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.d.ts +2 -0
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.js +9 -16
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridState.d.ts +2 -2
- package/lib/stores/view/grid/DataCubeGridState.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridState.js +19 -6
- package/lib/stores/view/grid/DataCubeGridState.js.map +1 -1
- package/package.json +5 -5
- package/src/components/DataCubePlaceholder.tsx +2 -0
- package/src/components/core/DataCubePureCodeEditorUtils.tsx +2 -1
- package/src/components/view/editor/DataCubeEditor.tsx +8 -3
- package/src/components/view/editor/DataCubeEditorColumnsPanel.tsx +6 -8
- package/src/components/view/editor/{DataCubeEditorColumnSelector.tsx → DataCubeEditorColumnsSelector.tsx} +108 -83
- package/src/components/view/editor/DataCubeEditorDimensionsPanel.tsx +1259 -503
- package/src/components/view/editor/DataCubeEditorHorizontalPivotsPanel.tsx +5 -5
- package/src/components/view/editor/DataCubeEditorSortsPanel.tsx +10 -10
- package/src/components/view/editor/DataCubeEditorVerticalPivotsPanel.tsx +2 -2
- package/src/components/view/extend/DataCubeCodeEditor.tsx +175 -0
- package/src/components/view/extend/DataCubeCodeEditorState.tsx +72 -0
- package/src/components/view/extend/DataCubeColumnEditor.tsx +5 -133
- package/src/components/view/grid/DataCubeGrid.tsx +70 -53
- package/src/components/view/grid/DataCubeMultidimensionalGrid.tsx +3 -1
- package/src/index.tsx +3 -0
- package/src/stores/DataCubeAPI.ts +3 -1
- package/src/stores/core/DataCubeEngine.tsx +1 -1
- package/src/stores/core/DataCubeQueryEngine.ts +6 -0
- package/src/stores/core/DataCubeSnapshot.ts +1 -1
- package/src/stores/core/model/AdhocQueryDataCubeSource.ts +3 -0
- package/src/stores/core/model/DataCubeConfiguration.ts +31 -0
- package/src/stores/services/DataCubeSettingService.tsx +10 -6
- package/src/stores/view/DataCubeInfoState.ts +4 -0
- package/src/stores/view/editor/DataCubeEditorColumnsPanelState.ts +13 -13
- package/src/stores/view/editor/{DataCubeEditorColumnSelectorState.ts → DataCubeEditorColumnsSelectorState.ts} +6 -6
- package/src/stores/view/editor/DataCubeEditorDimensionsPanelState.ts +162 -58
- package/src/stores/view/editor/DataCubeEditorHorizontalPivotsPanelState.ts +12 -11
- package/src/stores/view/editor/DataCubeEditorMutableConfiguration.ts +8 -0
- package/src/stores/view/editor/DataCubeEditorSortsPanelState.ts +10 -10
- package/src/stores/view/editor/DataCubeEditorState.tsx +6 -0
- package/src/stores/view/editor/DataCubeEditorVerticalPivotsPanelState.ts +11 -11
- package/src/stores/view/extend/DataCubeColumnEditorState.tsx +16 -26
- package/src/stores/view/grid/DataCubeGridClientEngine.ts +8 -0
- package/src/stores/view/grid/DataCubeGridClientExportEngine.ts +1 -1
- package/src/stores/view/grid/DataCubeGridMenuBuilder.tsx +26 -1
- package/src/stores/view/grid/DataCubeGridState.ts +23 -6
- package/tsconfig.json +4 -3
- package/lib/components/view/editor/DataCubeEditorColumnSelector.d.ts +0 -38
- package/lib/components/view/editor/DataCubeEditorColumnSelector.d.ts.map +0 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.js.map +0 -1
- package/lib/components/view/grid/DataCubeGridShared.d.ts.map +0 -1
- package/lib/components/view/grid/DataCubeGridShared.js +0 -25
- package/lib/components/view/grid/DataCubeGridShared.js.map +0 -1
- package/lib/stores/view/editor/DataCubeEditorColumnSelectorState.d.ts.map +0 -1
- package/lib/stores/view/editor/DataCubeEditorColumnSelectorState.js.map +0 -1
- package/src/components/view/grid/DataCubeGridShared.tsx +0 -42
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
DataCubeFontCase,
|
|
35
35
|
DataCubeFontFormatUnderlineVariant,
|
|
36
36
|
DataCubeFontTextAlignment,
|
|
37
|
+
DataCubeGridMode,
|
|
37
38
|
DEFAULT_ROW_BACKGROUND_COLOR,
|
|
38
39
|
DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR,
|
|
39
40
|
} from '../../../stores/core/DataCubeQueryEngine.js';
|
|
@@ -46,6 +47,7 @@ import { generateBaseGridOptions } from '../../../stores/view/grid/DataCubeGridC
|
|
|
46
47
|
import type { DataCubeViewState } from '../../../stores/view/DataCubeViewState.js';
|
|
47
48
|
import { FormBadge_WIP } from '../../core/DataCubeFormUtils.js';
|
|
48
49
|
import { useDataCube } from '../../DataCubeProvider.js';
|
|
50
|
+
import { DataCubeMultidimensionalGrid } from './DataCubeMultidimensionalGrid.js';
|
|
49
51
|
|
|
50
52
|
// NOTE: This is a workaround to prevent ag-grid license key check from flooding the console screen
|
|
51
53
|
// with its stack trace in Chrome.
|
|
@@ -92,34 +94,29 @@ function backgroundColorStyle(
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
export const DataCubeGridStyleController = observer(
|
|
95
|
-
(props: {
|
|
96
|
-
const {
|
|
97
|
-
const grid = view.grid;
|
|
98
|
-
const configuration = grid.queryConfiguration;
|
|
97
|
+
(props: { configuration: DataCubeConfiguration }) => {
|
|
98
|
+
const { configuration } = props;
|
|
99
99
|
|
|
100
100
|
return (
|
|
101
101
|
<Global
|
|
102
102
|
styles={css`
|
|
103
103
|
.${INTERNAL__GridClientUtilityCssClassName.ROOT} {
|
|
104
|
-
--ag-odd-row-background-color: ${
|
|
105
|
-
|
|
106
|
-
!grid.queryConfiguration.alternateRows
|
|
104
|
+
--ag-odd-row-background-color: ${configuration.alternateRowsStandardMode &&
|
|
105
|
+
!configuration.alternateRows
|
|
107
106
|
? DEFAULT_ROW_HIGHLIGHT_BACKGROUND_COLOR
|
|
108
107
|
: DEFAULT_ROW_BACKGROUND_COLOR};
|
|
109
|
-
--ag-cell-horizontal-border: ${
|
|
110
|
-
.showVerticalGridLines
|
|
108
|
+
--ag-cell-horizontal-border: ${configuration.showVerticalGridLines
|
|
111
109
|
? `1px solid
|
|
112
|
-
${
|
|
110
|
+
${configuration.gridLineColor}`
|
|
113
111
|
: 'none'};
|
|
114
|
-
--ag-row-border-color: ${
|
|
115
|
-
.
|
|
116
|
-
? grid.queryConfiguration.gridLineColor
|
|
112
|
+
--ag-row-border-color: ${configuration.showHorizontalGridLines
|
|
113
|
+
? configuration.gridLineColor
|
|
117
114
|
: 'transparent'};
|
|
118
115
|
}
|
|
119
116
|
.${INTERNAL__GridClientUtilityCssClassName.ROOT}
|
|
120
117
|
.${INTERNAL__GridClientUtilityCssClassName.HIGHLIGHT_ROW} {
|
|
121
|
-
background-color: ${
|
|
122
|
-
?
|
|
118
|
+
background-color: ${configuration.alternateRows
|
|
119
|
+
? configuration.alternateRowsColor
|
|
123
120
|
: DEFAULT_ROW_BACKGROUND_COLOR};
|
|
124
121
|
}
|
|
125
122
|
${[
|
|
@@ -271,7 +268,7 @@ const DataCubeGridStatusBar = observer((props: { view: DataCubeViewState }) => {
|
|
|
271
268
|
: ''}
|
|
272
269
|
</div>
|
|
273
270
|
{grid.rowLimit !== undefined &&
|
|
274
|
-
grid.
|
|
271
|
+
grid.configuration.showWarningForTruncatedResult && (
|
|
275
272
|
// TODO: if we want to properly warn if the data has been truncated due to row limit,
|
|
276
273
|
// this would require us to fetch n+1 rows when limit=n
|
|
277
274
|
// This is feature is not difficult to implement, but it would be implemented most cleanly
|
|
@@ -377,51 +374,71 @@ const DataCubeGridStatusBar = observer((props: { view: DataCubeViewState }) => {
|
|
|
377
374
|
);
|
|
378
375
|
});
|
|
379
376
|
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
377
|
+
const DataCubeStandardGridClient = observer(
|
|
378
|
+
(props: { view: DataCubeViewState }) => {
|
|
379
|
+
const { view } = props;
|
|
380
|
+
const grid = view.grid;
|
|
383
381
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
382
|
+
// eslint-disable-next-line no-process-env
|
|
383
|
+
if (process.env.NODE_ENV !== 'production' && !grid.isClientConfigured) {
|
|
384
|
+
// eslint-disable-next-line no-console
|
|
385
|
+
console.error = (message?: unknown, ...agrs: unknown[]) => {
|
|
386
|
+
console.debug(`%c ${message}`, 'color: silver'); // eslint-disable-line no-console
|
|
387
|
+
};
|
|
388
|
+
}
|
|
391
389
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
//
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
390
|
+
return (
|
|
391
|
+
<div className="relative h-[calc(100%_-_20px)] w-full">
|
|
392
|
+
<AgGridReact
|
|
393
|
+
theme="legacy"
|
|
394
|
+
className="data-cube-grid ag-theme-quartz"
|
|
395
|
+
rowModelType="serverSide"
|
|
396
|
+
serverSideDatasource={grid.clientDataSource}
|
|
397
|
+
context={{
|
|
398
|
+
view,
|
|
399
|
+
}}
|
|
400
|
+
onGridReady={(params) => {
|
|
401
|
+
grid
|
|
402
|
+
.configureClient(params.api)
|
|
403
|
+
.catch((error) => view.alertService.alertUnhandledError(error));
|
|
404
|
+
// eslint-disable-next-line no-process-env
|
|
405
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
406
|
+
// restore original error logging
|
|
407
|
+
console.error = __INTERNAL__original_console_error; // eslint-disable-line no-console
|
|
408
|
+
}
|
|
409
|
+
}}
|
|
410
|
+
modules={[AllCommunityModule, AllEnterpriseModule]}
|
|
411
|
+
{...generateBaseGridOptions(view)}
|
|
412
|
+
/>
|
|
413
|
+
</div>
|
|
414
|
+
);
|
|
415
|
+
},
|
|
416
|
+
);
|
|
416
417
|
|
|
417
|
-
|
|
418
|
+
const DataCubeStandardGrid = observer((props: { view: DataCubeViewState }) => {
|
|
418
419
|
const { view } = props;
|
|
420
|
+
const configuration = view.grid.configuration;
|
|
419
421
|
|
|
420
422
|
return (
|
|
421
423
|
<div className="h-[calc(100%_-_48px)] w-full">
|
|
422
|
-
<DataCubeGridStyleController
|
|
423
|
-
<
|
|
424
|
+
<DataCubeGridStyleController configuration={configuration} />
|
|
425
|
+
<DataCubeStandardGridClient view={view} />
|
|
424
426
|
<DataCubeGridStatusBar view={view} />
|
|
425
427
|
</div>
|
|
426
428
|
);
|
|
427
429
|
});
|
|
430
|
+
|
|
431
|
+
export const DataCubeGrid = observer((props: { view: DataCubeViewState }) => {
|
|
432
|
+
const { view } = props;
|
|
433
|
+
|
|
434
|
+
switch (view.info.configuration.gridMode) {
|
|
435
|
+
case DataCubeGridMode.MULTIDIMENSIONAL:
|
|
436
|
+
return <DataCubeMultidimensionalGrid view={view} />;
|
|
437
|
+
case DataCubeGridMode.STANDARD:
|
|
438
|
+
return <DataCubeStandardGrid view={view} />;
|
|
439
|
+
default:
|
|
440
|
+
return (
|
|
441
|
+
<div className="border-t-1 border-b-1 h-[calc(100%_-_48px)] w-full border border-neutral-200 bg-neutral-50" />
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
});
|
|
@@ -19,6 +19,8 @@ import type { DataCubeViewState } from '../../../stores/view/DataCubeViewState.j
|
|
|
19
19
|
|
|
20
20
|
export const DataCubeMultidimensionalGrid = observer(
|
|
21
21
|
(props: { view: DataCubeViewState }) => {
|
|
22
|
-
return
|
|
22
|
+
return (
|
|
23
|
+
<div className="border-t-1 border-b-1 h-[calc(100%_-_48px)] w-full border border-neutral-200 bg-neutral-50" />
|
|
24
|
+
);
|
|
23
25
|
},
|
|
24
26
|
);
|
package/src/index.tsx
CHANGED
|
@@ -45,8 +45,11 @@ export {
|
|
|
45
45
|
export * from './stores/services/DataCubeTaskService.js';
|
|
46
46
|
export * from './stores/services/DataCubeLogService.js';
|
|
47
47
|
export * from './stores/services/DataCubeAlertService.js';
|
|
48
|
+
export * from './components/view/extend/DataCubeCodeEditor.js';
|
|
49
|
+
export * from './components/view/extend/DataCubeCodeEditorState.js';
|
|
48
50
|
export * from './components/core/DataCubeAlert.js';
|
|
49
51
|
export * from './components/core/DataCubeLayout.js';
|
|
52
|
+
export { INTERNAL__MonacoEditorWidgetsRoot } from './components/core/DataCubePureCodeEditorUtils.js';
|
|
50
53
|
|
|
51
54
|
export { useDataCube } from './components/DataCubeProvider.js';
|
|
52
55
|
export { type DataCubeAPI } from './stores/DataCubeAPI.js';
|
|
@@ -95,7 +95,9 @@ export class INTERNAL__DataCubeAPI implements DataCubeAPI {
|
|
|
95
95
|
|
|
96
96
|
retryFailedDataFetches() {
|
|
97
97
|
this._runTaskForEachView((view) => {
|
|
98
|
-
view.grid.
|
|
98
|
+
if (view.grid.isClientConfigured) {
|
|
99
|
+
view.grid.client.retryServerSideLoads();
|
|
100
|
+
}
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
|
|
@@ -253,7 +253,7 @@ export abstract class DataCubeEngine {
|
|
|
253
253
|
abstract getQueryTypeahead(
|
|
254
254
|
code: string,
|
|
255
255
|
baseQuery: V1_Lambda,
|
|
256
|
-
|
|
256
|
+
context: DataCubeSource | PlainObject,
|
|
257
257
|
): Promise<CompletionItem[]>;
|
|
258
258
|
|
|
259
259
|
abstract getQueryRelationReturnType(
|
|
@@ -268,6 +268,11 @@ export enum DataCubeColumnDataType {
|
|
|
268
268
|
TIME = 'Time',
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
export enum DataCubeGridMode {
|
|
272
|
+
STANDARD = 'Standard',
|
|
273
|
+
MULTIDIMENSIONAL = 'Multidimensional',
|
|
274
|
+
}
|
|
275
|
+
|
|
271
276
|
export const PIVOT_COLUMN_NAME_VALUE_SEPARATOR = '__|__';
|
|
272
277
|
|
|
273
278
|
export const TREE_COLUMN_VALUE_SEPARATOR = '__/__';
|
|
@@ -291,6 +296,7 @@ export const DEFAULT_COLUMN_WIDTH = 300;
|
|
|
291
296
|
export const DEFAULT_COLUMN_MIN_WIDTH = 50;
|
|
292
297
|
export const DEFAULT_COLUMN_MAX_WIDTH = undefined;
|
|
293
298
|
|
|
299
|
+
export const DEFAULT_GRID_MODE = DataCubeGridMode.STANDARD;
|
|
294
300
|
export const DEFAULT_FONT_FAMILY = DataCubeFont.ROBOTO;
|
|
295
301
|
export const DEFAULT_FONT_SIZE = 11;
|
|
296
302
|
export const DEFAULT_FONT_BOLD = false;
|
|
@@ -80,8 +80,8 @@ export type DataCubeSnapshotData = {
|
|
|
80
80
|
leafExtendedColumns: DataCubeSnapshotExtendedColumn[];
|
|
81
81
|
filter?: DataCubeSnapshotFilter | undefined;
|
|
82
82
|
selectColumns: DataCubeColumn[];
|
|
83
|
-
groupBy?: DataCubeSnapshotGroupBy | undefined;
|
|
84
83
|
pivot?: DataCubeSnapshotPivot | undefined;
|
|
84
|
+
groupBy?: DataCubeSnapshotGroupBy | undefined;
|
|
85
85
|
groupExtendedColumns: DataCubeSnapshotExtendedColumn[];
|
|
86
86
|
sortColumns: DataCubeSnapshotSortColumn[];
|
|
87
87
|
limit: number | undefined;
|
|
@@ -25,6 +25,7 @@ import type { V1_PureModelContext } from '@finos/legend-graph';
|
|
|
25
25
|
|
|
26
26
|
export class AdhocQueryDataCubeSource extends DataCubeSource {
|
|
27
27
|
runtime!: string;
|
|
28
|
+
mapping?: string;
|
|
28
29
|
model!: PlainObject<V1_PureModelContext>;
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -40,6 +41,7 @@ export const ADHOC_FUNCTION_DATA_CUBE_SOURCE_TYPE = 'userDefinedFunction';
|
|
|
40
41
|
export class RawAdhocQueryDataCubeSource {
|
|
41
42
|
query!: string;
|
|
42
43
|
runtime!: string;
|
|
44
|
+
mapping?: string;
|
|
43
45
|
model!: PlainObject<V1_PureModelContext>;
|
|
44
46
|
|
|
45
47
|
static readonly serialization = new SerializationFactory(
|
|
@@ -48,6 +50,7 @@ export class RawAdhocQueryDataCubeSource {
|
|
|
48
50
|
model: raw(),
|
|
49
51
|
query: primitive(),
|
|
50
52
|
runtime: primitive(),
|
|
53
|
+
mapping: optional(primitive()),
|
|
51
54
|
}),
|
|
52
55
|
);
|
|
53
56
|
}
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
DEFAULT_TREE_COLUMN_SORT_DIRECTION,
|
|
43
43
|
DEFAULT_REPORT_NAME,
|
|
44
44
|
type DataCubeQuerySortDirection,
|
|
45
|
+
DEFAULT_GRID_MODE,
|
|
45
46
|
} from '../DataCubeQueryEngine.js';
|
|
46
47
|
import {
|
|
47
48
|
SerializationFactory,
|
|
@@ -188,6 +189,30 @@ export class DataCubePivotLayoutConfiguration {
|
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
|
|
192
|
+
export class DataCubeDimensionConfiguration {
|
|
193
|
+
name!: string;
|
|
194
|
+
columns: string[] = [];
|
|
195
|
+
|
|
196
|
+
static readonly serialization = new SerializationFactory(
|
|
197
|
+
createModelSchema(DataCubeDimensionConfiguration, {
|
|
198
|
+
columns: list(primitive()),
|
|
199
|
+
name: primitive(),
|
|
200
|
+
}),
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export class DataCubeDimensionsConfiguration {
|
|
205
|
+
dimensions: DataCubeDimensionConfiguration[] = [];
|
|
206
|
+
|
|
207
|
+
static readonly serialization = new SerializationFactory(
|
|
208
|
+
createModelSchema(DataCubeDimensionsConfiguration, {
|
|
209
|
+
dimensions: list(
|
|
210
|
+
usingModelSchema(DataCubeDimensionConfiguration.serialization.schema),
|
|
211
|
+
),
|
|
212
|
+
}),
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
191
216
|
export class DataCubeConfiguration {
|
|
192
217
|
readonly uuid = uuid();
|
|
193
218
|
|
|
@@ -198,6 +223,7 @@ export class DataCubeConfiguration {
|
|
|
198
223
|
showHorizontalGridLines = false;
|
|
199
224
|
showVerticalGridLines = true;
|
|
200
225
|
gridLineColor = DEFAULT_GRID_LINE_COLOR;
|
|
226
|
+
gridMode = DEFAULT_GRID_MODE;
|
|
201
227
|
|
|
202
228
|
fontFamily = DEFAULT_FONT_FAMILY;
|
|
203
229
|
fontSize = DEFAULT_FONT_SIZE;
|
|
@@ -234,6 +260,7 @@ export class DataCubeConfiguration {
|
|
|
234
260
|
pivotStatisticColumnPlacement?: DataCubeColumnPinPlacement | undefined; // unspecified -> hide the column
|
|
235
261
|
|
|
236
262
|
pivotLayout = new DataCubePivotLayoutConfiguration();
|
|
263
|
+
dimensions = new DataCubeDimensionsConfiguration();
|
|
237
264
|
|
|
238
265
|
static readonly serialization = new SerializationFactory(
|
|
239
266
|
createModelSchema(DataCubeConfiguration, {
|
|
@@ -247,6 +274,9 @@ export class DataCubeConfiguration {
|
|
|
247
274
|
errorBackgroundColor: primitive(),
|
|
248
275
|
errorForegroundColor: primitive(),
|
|
249
276
|
description: optional(primitive()),
|
|
277
|
+
dimensions: usingModelSchema(
|
|
278
|
+
DataCubeDimensionsConfiguration.serialization.schema,
|
|
279
|
+
),
|
|
250
280
|
fontBold: primitive(),
|
|
251
281
|
fontCase: optional(primitive()),
|
|
252
282
|
fontFamily: primitive(),
|
|
@@ -255,6 +285,7 @@ export class DataCubeConfiguration {
|
|
|
255
285
|
fontStrikethrough: primitive(),
|
|
256
286
|
fontUnderline: optional(primitive()),
|
|
257
287
|
gridLineColor: primitive(),
|
|
288
|
+
gridMode: primitive(),
|
|
258
289
|
initialExpandLevel: optional(primitive()),
|
|
259
290
|
name: primitive(),
|
|
260
291
|
negativeBackgroundColor: primitive(),
|
|
@@ -211,9 +211,11 @@ export class DataCubeSettingService {
|
|
|
211
211
|
numericValueStep: 10,
|
|
212
212
|
action: (api, newValue) =>
|
|
213
213
|
(api as INTERNAL__DataCubeAPI)._runTaskForEachView((view) => {
|
|
214
|
-
view.grid.
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
if (view.grid.isClientConfigured) {
|
|
215
|
+
view.grid.client.updateGridOptions({
|
|
216
|
+
rowBuffer: newValue,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
217
219
|
}),
|
|
218
220
|
} satisfies DataCubeSetting<number>,
|
|
219
221
|
{
|
|
@@ -225,9 +227,11 @@ export class DataCubeSettingService {
|
|
|
225
227
|
defaultValue: false,
|
|
226
228
|
action: (api, newValue) =>
|
|
227
229
|
(api as INTERNAL__DataCubeAPI)._runTaskForEachView((view) => {
|
|
228
|
-
view.grid.
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
if (view.grid.isClientConfigured) {
|
|
231
|
+
view.grid.client.updateGridOptions({
|
|
232
|
+
purgeClosedRowNodes: newValue,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
231
235
|
}),
|
|
232
236
|
} satisfies DataCubeSetting<boolean>,
|
|
233
237
|
{
|
|
@@ -28,6 +28,7 @@ import { DataCubeConfiguration } from '../core/model/DataCubeConfiguration.js';
|
|
|
28
28
|
export class DataCubeInfoState extends DataCubeSnapshotController {
|
|
29
29
|
private readonly _view: DataCubeViewState;
|
|
30
30
|
|
|
31
|
+
configuration = new DataCubeConfiguration();
|
|
31
32
|
name = '';
|
|
32
33
|
// TODO: filter preview text
|
|
33
34
|
|
|
@@ -35,6 +36,8 @@ export class DataCubeInfoState extends DataCubeSnapshotController {
|
|
|
35
36
|
super(view.engine, view.settingService, view.snapshotService);
|
|
36
37
|
|
|
37
38
|
makeObservable(this, {
|
|
39
|
+
configuration: observable,
|
|
40
|
+
|
|
38
41
|
name: observable,
|
|
39
42
|
|
|
40
43
|
applySnapshot: action,
|
|
@@ -55,6 +58,7 @@ export class DataCubeInfoState extends DataCubeSnapshotController {
|
|
|
55
58
|
const configuration = DataCubeConfiguration.serialization.fromJson(
|
|
56
59
|
data.configuration,
|
|
57
60
|
);
|
|
61
|
+
this.configuration = configuration;
|
|
58
62
|
|
|
59
63
|
if (configuration.name !== this.name) {
|
|
60
64
|
this.name = configuration.name;
|
|
@@ -19,13 +19,13 @@ import { type DataCubeSnapshot } from '../../core/DataCubeSnapshot.js';
|
|
|
19
19
|
import { _findCol, _toCol } from '../../core/model/DataCubeColumn.js';
|
|
20
20
|
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from './
|
|
22
|
+
DataCubeEditorColumnsSelectorColumnState,
|
|
23
|
+
DataCubeEditorColumnsSelectorState,
|
|
24
|
+
} from './DataCubeEditorColumnsSelectorState.js';
|
|
25
25
|
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
26
26
|
import { type DataCubeConfiguration } from '../../core/model/DataCubeConfiguration.js';
|
|
27
27
|
|
|
28
|
-
export class
|
|
28
|
+
export class DataCubeEditorBasicColumnsSelectorState extends DataCubeEditorColumnsSelectorState<DataCubeEditorColumnsSelectorColumnState> {
|
|
29
29
|
showHiddenColumns = false;
|
|
30
30
|
|
|
31
31
|
constructor(
|
|
@@ -33,7 +33,7 @@ export class DataCubeEditorBasicColumnSelectorState extends DataCubeEditorColumn
|
|
|
33
33
|
options?: {
|
|
34
34
|
onChange?:
|
|
35
35
|
| ((
|
|
36
|
-
select:
|
|
36
|
+
select: DataCubeEditorColumnsSelectorState<DataCubeEditorColumnsSelectorColumnState>,
|
|
37
37
|
) => void)
|
|
38
38
|
| undefined;
|
|
39
39
|
},
|
|
@@ -49,8 +49,8 @@ export class DataCubeEditorBasicColumnSelectorState extends DataCubeEditorColumn
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
override cloneColumn(column:
|
|
53
|
-
return new
|
|
52
|
+
override cloneColumn(column: DataCubeEditorColumnsSelectorColumnState) {
|
|
53
|
+
return new DataCubeEditorColumnsSelectorColumnState(
|
|
54
54
|
column.name,
|
|
55
55
|
column.type,
|
|
56
56
|
);
|
|
@@ -62,11 +62,11 @@ export class DataCubeEditorBasicColumnSelectorState extends DataCubeEditorColumn
|
|
|
62
62
|
...this._editor.leafExtendColumns,
|
|
63
63
|
...this._editor.groupExtendColumns,
|
|
64
64
|
].map(
|
|
65
|
-
(col) => new
|
|
65
|
+
(col) => new DataCubeEditorColumnsSelectorColumnState(col.name, col.type),
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
override get availableColumnsForDisplay():
|
|
69
|
+
override get availableColumnsForDisplay(): DataCubeEditorColumnsSelectorColumnState[] {
|
|
70
70
|
return super.availableColumnsForDisplay.filter(
|
|
71
71
|
(column) =>
|
|
72
72
|
this.showHiddenColumns ||
|
|
@@ -75,7 +75,7 @@ export class DataCubeEditorBasicColumnSelectorState extends DataCubeEditorColumn
|
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
override get selectedColumnsForDisplay():
|
|
78
|
+
override get selectedColumnsForDisplay(): DataCubeEditorColumnsSelectorColumnState[] {
|
|
79
79
|
return super.selectedColumnsForDisplay.filter(
|
|
80
80
|
(column) =>
|
|
81
81
|
this.showHiddenColumns ||
|
|
@@ -104,7 +104,7 @@ export class DataCubeEditorColumnsPanelState
|
|
|
104
104
|
{
|
|
105
105
|
private readonly _editor!: DataCubeEditorState;
|
|
106
106
|
|
|
107
|
-
readonly selector!:
|
|
107
|
+
readonly selector!: DataCubeEditorBasicColumnsSelectorState;
|
|
108
108
|
|
|
109
109
|
constructor(editor: DataCubeEditorState) {
|
|
110
110
|
makeObservable(this, {
|
|
@@ -112,7 +112,7 @@ export class DataCubeEditorColumnsPanelState
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
this._editor = editor;
|
|
115
|
-
this.selector = new
|
|
115
|
+
this.selector = new DataCubeEditorBasicColumnsSelectorState(editor, {
|
|
116
116
|
onChange: (selector) => {
|
|
117
117
|
const selectedColumnConfigurations = selector.selectedColumns.map(
|
|
118
118
|
(col) =>
|
|
@@ -159,7 +159,7 @@ export class DataCubeEditorColumnsPanelState
|
|
|
159
159
|
.filter((col) => col.isSelected)
|
|
160
160
|
.map((col) => {
|
|
161
161
|
const column = this.selector.getColumn(col.name);
|
|
162
|
-
return new
|
|
162
|
+
return new DataCubeEditorColumnsSelectorColumnState(
|
|
163
163
|
column.name,
|
|
164
164
|
column.type,
|
|
165
165
|
);
|
|
@@ -20,7 +20,7 @@ import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
|
20
20
|
import { _findCol, _sortByColName } from '../../core/model/DataCubeColumn.js';
|
|
21
21
|
import type { DataCubeQuerySortDirection } from '../../core/DataCubeQueryEngine.js';
|
|
22
22
|
|
|
23
|
-
export class
|
|
23
|
+
export class DataCubeEditorColumnsSelectorColumnState {
|
|
24
24
|
readonly name: string;
|
|
25
25
|
readonly type: string;
|
|
26
26
|
|
|
@@ -30,8 +30,8 @@ export class DataCubeEditorColumnSelectorColumnState {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export abstract class
|
|
34
|
-
T extends
|
|
33
|
+
export abstract class DataCubeEditorColumnsSelectorState<
|
|
34
|
+
T extends DataCubeEditorColumnsSelectorColumnState,
|
|
35
35
|
> {
|
|
36
36
|
protected readonly _editor!: DataCubeEditorState;
|
|
37
37
|
|
|
@@ -41,14 +41,14 @@ export abstract class DataCubeEditorColumnSelectorState<
|
|
|
41
41
|
selectedColumnsSearchText = '';
|
|
42
42
|
|
|
43
43
|
readonly onChange?:
|
|
44
|
-
| ((selector:
|
|
44
|
+
| ((selector: DataCubeEditorColumnsSelectorState<T>) => void)
|
|
45
45
|
| undefined;
|
|
46
46
|
|
|
47
47
|
constructor(
|
|
48
48
|
editor: DataCubeEditorState,
|
|
49
49
|
options?: {
|
|
50
50
|
onChange?:
|
|
51
|
-
| ((select:
|
|
51
|
+
| ((select: DataCubeEditorColumnsSelectorState<T>) => void)
|
|
52
52
|
| undefined;
|
|
53
53
|
},
|
|
54
54
|
) {
|
|
@@ -109,7 +109,7 @@ export abstract class DataCubeEditorColumnSelectorState<
|
|
|
109
109
|
protected abstract cloneColumn(column: T): T;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export class
|
|
112
|
+
export class DataCubeEditorColumnsSelectorSortColumnState extends DataCubeEditorColumnsSelectorColumnState {
|
|
113
113
|
readonly onChange?: (() => void) | undefined;
|
|
114
114
|
direction: DataCubeQuerySortDirection;
|
|
115
115
|
|