@finos/legend-data-cube 0.0.30 → 0.0.32
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/view/editor/DataCubeEditorColumnPropertiesPanel.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnPropertiesPanel.js +1 -4
- package/lib/components/view/editor/DataCubeEditorColumnPropertiesPanel.js.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.d.ts.map +1 -1
- package/lib/components/view/editor/DataCubeEditorColumnSelector.js +13 -9
- package/lib/components/view/editor/DataCubeEditorColumnSelector.js.map +1 -1
- package/lib/components/view/filter/DataCubeFilterEditor.js.map +1 -1
- package/lib/components/view/grid/DataCubeGrid.d.ts.map +1 -1
- package/lib/components/view/grid/DataCubeGrid.js +5 -26
- package/lib/components/view/grid/DataCubeGrid.js.map +1 -1
- package/lib/components/view/grid/DataCubeGridShared.d.ts +1 -1
- package/lib/components/view/grid/DataCubeGridShared.d.ts.map +1 -1
- package/lib/components/view/grid/DataCubeGridShared.js +1 -1
- package/lib/components/view/grid/DataCubeGridShared.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +13 -24
- package/lib/stores/core/DataCubeEngine.js +1 -1
- package/lib/stores/core/DataCubeEngine.js.map +1 -1
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.js +1 -1
- package/lib/stores/core/DataCubeQuerySnapshotBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.d.ts +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.js +1 -1
- package/lib/stores/view/grid/DataCubeGridClientEngine.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.d.ts +45 -48
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.js +1 -1
- package/lib/stores/view/grid/DataCubeGridConfigurationBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridControllerState.d.ts +2 -2
- package/lib/stores/view/grid/DataCubeGridControllerState.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridControllerState.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.d.ts +2 -2
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.d.ts.map +1 -1
- package/lib/stores/view/grid/DataCubeGridMenuBuilder.js.map +1 -1
- package/lib/stores/view/grid/DataCubeGridState.d.ts +1 -1
- package/lib/stores/view/grid/DataCubeGridState.d.ts.map +1 -1
- package/package.json +18 -29
- package/src/components/view/editor/DataCubeEditorColumnPropertiesPanel.tsx +33 -36
- package/src/components/view/editor/DataCubeEditorColumnSelector.tsx +25 -15
- package/src/components/view/filter/DataCubeFilterEditor.tsx +4 -4
- package/src/components/view/grid/DataCubeGrid.tsx +5 -25
- package/src/components/view/grid/DataCubeGridShared.tsx +1 -4
- package/src/stores/core/DataCubeEngine.tsx +1 -1
- package/src/stores/core/DataCubeQuerySnapshotBuilder.ts +1 -1
- package/src/stores/view/grid/DataCubeGridClientEngine.ts +2 -2
- package/src/stores/view/grid/DataCubeGridConfigurationBuilder.tsx +3 -3
- package/src/stores/view/grid/DataCubeGridControllerState.ts +3 -2
- package/src/stores/view/grid/DataCubeGridMenuBuilder.tsx +7 -6
- package/src/stores/view/grid/DataCubeGridState.ts +1 -1
|
@@ -349,7 +349,7 @@ const DataCubeEditorFilterConditionNodeValueEditor = observer(
|
|
|
349
349
|
case PRIMITIVE_TYPE.STRING:
|
|
350
350
|
return (
|
|
351
351
|
<DataCubeEditorFilterConditionNodeTextValueEditor
|
|
352
|
-
ref={ref as React.
|
|
352
|
+
ref={ref as React.RefObject<HTMLInputElement>}
|
|
353
353
|
value={value.value as string}
|
|
354
354
|
updateValue={(val) => updateValue(val)}
|
|
355
355
|
/>
|
|
@@ -360,7 +360,7 @@ const DataCubeEditorFilterConditionNodeValueEditor = observer(
|
|
|
360
360
|
case PRIMITIVE_TYPE.INTEGER:
|
|
361
361
|
return (
|
|
362
362
|
<DataCubeEditorFilterConditionNodeNumberValueEditor
|
|
363
|
-
ref={ref as React.
|
|
363
|
+
ref={ref as React.RefObject<HTMLInputElement>}
|
|
364
364
|
value={value.value as number}
|
|
365
365
|
updateValue={(val) => updateValue(val)}
|
|
366
366
|
/>
|
|
@@ -370,7 +370,7 @@ const DataCubeEditorFilterConditionNodeValueEditor = observer(
|
|
|
370
370
|
case PRIMITIVE_TYPE.DATETIME:
|
|
371
371
|
return (
|
|
372
372
|
<DataCubeEditorFilterConditionNodeDateValueEditor
|
|
373
|
-
ref={ref as React.
|
|
373
|
+
ref={ref as React.RefObject<HTMLInputElement>}
|
|
374
374
|
value={value.value as string}
|
|
375
375
|
updateValue={(val) => updateValue(val)}
|
|
376
376
|
/>
|
|
@@ -378,7 +378,7 @@ const DataCubeEditorFilterConditionNodeValueEditor = observer(
|
|
|
378
378
|
case DataCubeOperationAdvancedValueType.COLUMN:
|
|
379
379
|
return (
|
|
380
380
|
<DataCubeEditorFilterConditionNodeColumnSelector
|
|
381
|
-
ref={ref as React.
|
|
381
|
+
ref={ref as React.RefObject<HTMLButtonElement>}
|
|
382
382
|
value={value.value as string}
|
|
383
383
|
updateValue={(val) => updateValue(val)}
|
|
384
384
|
view={view}
|
|
@@ -15,16 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { ClipboardModule } from '@ag-grid-enterprise/clipboard';
|
|
22
|
-
import { MenuModule } from '@ag-grid-enterprise/menu';
|
|
23
|
-
import { SideBarModule } from '@ag-grid-enterprise/side-bar';
|
|
24
|
-
import { ColumnsToolPanelModule } from '@ag-grid-enterprise/column-tool-panel';
|
|
25
|
-
import { AgGridReact } from '@ag-grid-community/react';
|
|
26
|
-
import { CsvExportModule } from '@ag-grid-community/csv-export';
|
|
27
|
-
import { ExcelExportModule } from '@ag-grid-enterprise/excel-export';
|
|
18
|
+
import { AllCommunityModule } from 'ag-grid-community';
|
|
19
|
+
import { AllEnterpriseModule } from 'ag-grid-enterprise';
|
|
20
|
+
import { AgGridReact } from 'ag-grid-react';
|
|
28
21
|
import { DataCubeIcon, Switch, cn, Global, css } from '@finos/legend-art';
|
|
29
22
|
import {
|
|
30
23
|
generateBackgroundColorUtilityClassName,
|
|
@@ -36,7 +29,6 @@ import {
|
|
|
36
29
|
generateTextColorUtilityClassName,
|
|
37
30
|
INTERNAL__GridClientUtilityCssClassName,
|
|
38
31
|
} from '../../../stores/view/grid/DataCubeGridClientEngine.js';
|
|
39
|
-
import { RangeSelectionModule } from '@ag-grid-enterprise/range-selection';
|
|
40
32
|
import {
|
|
41
33
|
DataCubeFont,
|
|
42
34
|
DataCubeFontCase,
|
|
@@ -343,6 +335,7 @@ const DataCubeGridClient = observer((props: { view: DataCubeViewState }) => {
|
|
|
343
335
|
return (
|
|
344
336
|
<div className="relative h-[calc(100%_-_20px)] w-full">
|
|
345
337
|
<AgGridReact
|
|
338
|
+
theme="legacy"
|
|
346
339
|
className="data-cube-grid ag-theme-quartz"
|
|
347
340
|
rowModelType="serverSide"
|
|
348
341
|
serverSideDatasource={grid.clientDataSource}
|
|
@@ -357,20 +350,7 @@ const DataCubeGridClient = observer((props: { view: DataCubeViewState }) => {
|
|
|
357
350
|
console.error = __INTERNAL__original_console_error; // eslint-disable-line no-console
|
|
358
351
|
}
|
|
359
352
|
}}
|
|
360
|
-
modules={[
|
|
361
|
-
// community
|
|
362
|
-
ClientSideRowModelModule,
|
|
363
|
-
CsvExportModule,
|
|
364
|
-
// enterprise
|
|
365
|
-
ServerSideRowModelModule,
|
|
366
|
-
RowGroupingModule,
|
|
367
|
-
MenuModule,
|
|
368
|
-
ClipboardModule,
|
|
369
|
-
RangeSelectionModule,
|
|
370
|
-
SideBarModule,
|
|
371
|
-
ColumnsToolPanelModule,
|
|
372
|
-
ExcelExportModule,
|
|
373
|
-
]}
|
|
353
|
+
modules={[AllCommunityModule, AllEnterpriseModule]}
|
|
374
354
|
{...generateBaseGridOptions(view)}
|
|
375
355
|
/>
|
|
376
356
|
</div>
|
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
useGridMenuItem,
|
|
19
|
-
type CustomMenuItemProps,
|
|
20
|
-
} from '@ag-grid-community/react';
|
|
17
|
+
import { useGridMenuItem, type CustomMenuItemProps } from 'ag-grid-react';
|
|
21
18
|
import { FormBadge_WIP } from '../../core/DataCubeFormUtils.js';
|
|
22
19
|
|
|
23
20
|
export function WIP_GridMenuItem({
|
|
@@ -73,7 +73,7 @@ import { DataCubeFont } from './DataCubeQueryEngine.js';
|
|
|
73
73
|
import type { DataCubeQuerySnapshot } from './DataCubeQuerySnapshot.js';
|
|
74
74
|
import { buildExecutableQuery } from './DataCubeQueryBuilder.js';
|
|
75
75
|
import type { DataCubeColumn } from './models/DataCubeColumn.js';
|
|
76
|
-
import { LicenseManager } from '
|
|
76
|
+
import { LicenseManager } from 'ag-grid-enterprise';
|
|
77
77
|
import type { DataCubeQuery } from './models/DataCubeQuery.js';
|
|
78
78
|
import {
|
|
79
79
|
type DataCubeSource,
|
|
@@ -305,7 +305,7 @@ export function validateAndBuildQuerySnapshot(
|
|
|
305
305
|
// --------------------------------- SOURCE ---------------------------------
|
|
306
306
|
|
|
307
307
|
data.sourceColumns = source.sourceColumns;
|
|
308
|
-
data.sourceColumns.
|
|
308
|
+
data.sourceColumns.forEach((col) => colsMap.set(col.name, col));
|
|
309
309
|
|
|
310
310
|
// --------------------------------- LEAF-LEVEL EXTEND ---------------------------------
|
|
311
311
|
/** TODO: @datacube roundtrip */
|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
IRowNode,
|
|
20
20
|
IServerSideDatasource,
|
|
21
21
|
IServerSideGetRowsParams,
|
|
22
|
-
} from '
|
|
22
|
+
} from 'ag-grid-community';
|
|
23
23
|
import type { DataCubeGridState } from './DataCubeGridState.js';
|
|
24
24
|
import {
|
|
25
25
|
IllegalStateError,
|
|
@@ -205,7 +205,7 @@ export function computeHashCodeForDataFetchManualTrigger(
|
|
|
205
205
|
},
|
|
206
206
|
leafExtendedColumns: snapshot.data.leafExtendedColumns,
|
|
207
207
|
filter: snapshot.data.filter,
|
|
208
|
-
selectColumns: snapshot.data.selectColumns.
|
|
208
|
+
selectColumns: snapshot.data.selectColumns.toSorted(_sortByColName), // sort to make sure column reordering does not trigger data fetching
|
|
209
209
|
groupExtendedColumns: snapshot.data.groupExtendedColumns,
|
|
210
210
|
limit: snapshot.data.limit,
|
|
211
211
|
}),
|
|
@@ -31,7 +31,7 @@ import type {
|
|
|
31
31
|
ColGroupDef,
|
|
32
32
|
GridOptions,
|
|
33
33
|
ICellRendererParams,
|
|
34
|
-
} from '
|
|
34
|
+
} from 'ag-grid-community';
|
|
35
35
|
import {
|
|
36
36
|
DataCubeGridClientSortDirection,
|
|
37
37
|
INTERNAL__GRID_CLIENT_COLUMN_MIN_WIDTH,
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
TREE_COLUMN_VALUE_SEPARATOR,
|
|
86
86
|
DEFAULT_ROOT_AGGREGATION_COLUMN_VALUE,
|
|
87
87
|
} from '../../core/DataCubeQueryEngine.js';
|
|
88
|
-
import type { CustomLoadingCellRendererProps } from '
|
|
88
|
+
import type { CustomLoadingCellRendererProps } from 'ag-grid-react';
|
|
89
89
|
import { DataCubeIcon } from '@finos/legend-art';
|
|
90
90
|
import type { DataCubeViewState } from '../DataCubeViewState.js';
|
|
91
91
|
|
|
@@ -498,7 +498,7 @@ export function generateBaseGridOptions(view: DataCubeViewState): GridOptions {
|
|
|
498
498
|
// use the auto-generated group column to make it work with pivot mode
|
|
499
499
|
// See https://github.com/ag-grid/ag-grid/issues/8088
|
|
500
500
|
groupDisplayType: 'singleColumn',
|
|
501
|
-
|
|
501
|
+
suppressGroupChangesColumnVisibility: true, // keeps the column set stable when row grouping is used
|
|
502
502
|
suppressAggFuncInHeader: true, // keeps the columns stable when aggregation is used
|
|
503
503
|
getChildCount: (data) =>
|
|
504
504
|
data[INTERNAL__GRID_CLIENT_ROW_GROUPING_COUNT_AGG_COLUMN_ID],
|
|
@@ -39,10 +39,11 @@ import {
|
|
|
39
39
|
getPivotResultColumnBaseColumnName,
|
|
40
40
|
} from '../../core/DataCubeQueryEngine.js';
|
|
41
41
|
import type {
|
|
42
|
+
DefaultMenuItem,
|
|
42
43
|
GetContextMenuItemsParams,
|
|
43
44
|
GetMainMenuItemsParams,
|
|
44
45
|
MenuItemDef,
|
|
45
|
-
} from '
|
|
46
|
+
} from 'ag-grid-community';
|
|
46
47
|
import type { DataCubeViewState } from '../DataCubeViewState.js';
|
|
47
48
|
import { generateMenuBuilder } from './DataCubeGridMenuBuilder.js';
|
|
48
49
|
import {
|
|
@@ -79,7 +80,7 @@ export class DataCubeGridControllerState extends DataCubeQuerySnapshotController
|
|
|
79
80
|
| GetContextMenuItemsParams<unknown, { view: DataCubeViewState }>
|
|
80
81
|
| GetMainMenuItemsParams<unknown, { view: DataCubeViewState }>,
|
|
81
82
|
fromHeader: boolean,
|
|
82
|
-
) => (
|
|
83
|
+
) => (DefaultMenuItem | MenuItemDef)[])
|
|
83
84
|
| undefined;
|
|
84
85
|
|
|
85
86
|
getColumnConfiguration(colName: string | undefined) {
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import type {
|
|
18
|
+
DefaultMenuItem,
|
|
18
19
|
GetContextMenuItemsParams,
|
|
19
20
|
GetMainMenuItemsParams,
|
|
20
21
|
MenuItemDef,
|
|
21
|
-
} from '
|
|
22
|
+
} from 'ag-grid-community';
|
|
22
23
|
import { WIP_GridMenuItem } from '../../../components/view/grid/DataCubeGridShared.js';
|
|
23
24
|
import {
|
|
24
25
|
DataCubeQuerySortDirection,
|
|
@@ -161,7 +162,7 @@ export function generateMenuBuilder(
|
|
|
161
162
|
): (
|
|
162
163
|
params: GetContextMenuItemsParams | GetMainMenuItemsParams,
|
|
163
164
|
fromHeader: boolean,
|
|
164
|
-
) => (
|
|
165
|
+
) => (DefaultMenuItem | MenuItemDef)[] {
|
|
165
166
|
const view = controller.view;
|
|
166
167
|
const engine = view.engine;
|
|
167
168
|
|
|
@@ -264,7 +265,7 @@ export function generateMenuBuilder(
|
|
|
264
265
|
},
|
|
265
266
|
],
|
|
266
267
|
},
|
|
267
|
-
] satisfies (
|
|
268
|
+
] satisfies (DefaultMenuItem | MenuItemDef)[];
|
|
268
269
|
|
|
269
270
|
let newFilterMenu: MenuItemDef[] = [];
|
|
270
271
|
if (column && value !== undefined) {
|
|
@@ -784,7 +785,7 @@ export function generateMenuBuilder(
|
|
|
784
785
|
disabled: !columnConfiguration,
|
|
785
786
|
action: () => controller.showColumn(columnName, false),
|
|
786
787
|
},
|
|
787
|
-
...(columnName === INTERNAL__GRID_CLIENT_TREE_COLUMN_ID
|
|
788
|
+
...((columnName === INTERNAL__GRID_CLIENT_TREE_COLUMN_ID
|
|
788
789
|
? [
|
|
789
790
|
'separator',
|
|
790
791
|
{
|
|
@@ -794,7 +795,7 @@ export function generateMenuBuilder(
|
|
|
794
795
|
},
|
|
795
796
|
},
|
|
796
797
|
]
|
|
797
|
-
: []),
|
|
798
|
+
: []) as (DefaultMenuItem | MenuItemDef)[]),
|
|
798
799
|
'separator',
|
|
799
800
|
{
|
|
800
801
|
name: 'Heatmap',
|
|
@@ -847,6 +848,6 @@ export function generateMenuBuilder(
|
|
|
847
848
|
editor.display.open();
|
|
848
849
|
},
|
|
849
850
|
},
|
|
850
|
-
] satisfies (
|
|
851
|
+
] satisfies (DefaultMenuItem | MenuItemDef)[];
|
|
851
852
|
};
|
|
852
853
|
}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
type DebouncedFunc,
|
|
21
21
|
} from '@finos/legend-shared';
|
|
22
22
|
import { action, makeObservable, observable } from 'mobx';
|
|
23
|
-
import type { GridApi } from '
|
|
23
|
+
import type { GridApi } from 'ag-grid-community';
|
|
24
24
|
import type { DataCubeViewState } from '../DataCubeViewState.js';
|
|
25
25
|
import {
|
|
26
26
|
DataCubeGridClientServerSideDataSource,
|