@adaptabletools/adaptable-cjs 20.1.5 → 20.1.6
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/base.css +1 -0
- package/base.css.map +1 -1
- package/index.css +1 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -1
- package/src/Api/GridApi.d.ts +3 -3
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/Api/Implementation/LayoutHelpers.d.ts +3 -3
- package/src/Api/Implementation/LayoutHelpers.js +126 -79
- package/src/Api/Internal/EventInternalApi.d.ts +1 -1
- package/src/Api/Internal/EventInternalApi.js +3 -3
- package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
- package/src/Redux/Store/AdaptableStore.js +7 -4
- package/src/agGrid/AdaptableAgGrid.d.ts +7 -10
- package/src/agGrid/AdaptableAgGrid.js +79 -107
- package/src/components/ExpressionEditor/BaseEditorInput.js +2 -0
- package/src/components/Select/Select.js +10 -3
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +29 -2
- package/src/layout-manager/src/index.d.ts +3 -0
- package/src/layout-manager/src/index.js +101 -30
- package/src/layout-manager/src/isLayoutEqual.js +11 -2
- package/src/layout-manager/src/normalizeLayoutModel.js +6 -0
- package/src/layout-manager/src/simplifyLayoutModel.js +3 -3
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -147,7 +147,6 @@ const adaptableInstances = {};
|
|
|
147
147
|
const publishTimestamp = Number(EnvVars_1.ADAPTABLE_PUBLISH_TIMESTAMP);
|
|
148
148
|
class AdaptableAgGrid {
|
|
149
149
|
constructor(config) {
|
|
150
|
-
this.filteredOutPrimaryKeys = new Set();
|
|
151
150
|
this.columnMinMaxValuesCache = {};
|
|
152
151
|
this.renderReactRoot = (node, container) => (0, renderReactRoot_1.renderReactRoot)(node, container);
|
|
153
152
|
/**
|
|
@@ -384,9 +383,7 @@ class AdaptableAgGrid {
|
|
|
384
383
|
gridApi: agGridApi,
|
|
385
384
|
debugId: this.adaptableOptions.adaptableId,
|
|
386
385
|
});
|
|
387
|
-
this.
|
|
388
|
-
normalize: true,
|
|
389
|
-
});
|
|
386
|
+
this.silentUpdateCurrentLayoutModel(layoutModel);
|
|
390
387
|
// this shouldn't be needed
|
|
391
388
|
// but AG Grid has a bug, and in pivot layout,
|
|
392
389
|
// even if we provide an initial AG Grid state with
|
|
@@ -399,8 +396,7 @@ class AdaptableAgGrid {
|
|
|
399
396
|
});
|
|
400
397
|
}
|
|
401
398
|
this.layoutManager.onChange((layoutModel) => {
|
|
402
|
-
const
|
|
403
|
-
const newLayoutObject = (0, LayoutHelpers_1.layoutModelToLayoutState)(layoutModel, currentLayout);
|
|
399
|
+
const newLayoutObject = (0, LayoutHelpers_1.layoutModelToLayoutState)(layoutModel);
|
|
404
400
|
this.onLayoutChange(newLayoutObject);
|
|
405
401
|
});
|
|
406
402
|
this.layoutManager.onColumnDefsChanged(() => {
|
|
@@ -409,7 +405,7 @@ class AdaptableAgGrid {
|
|
|
409
405
|
this.logger.info(`Hide Loading Screen`);
|
|
410
406
|
this.unmountLoadingScreen?.();
|
|
411
407
|
perfInitAgGrid.end();
|
|
412
|
-
// we need to intercept several AG Grid Api methods and trigger
|
|
408
|
+
// we need to intercept several AG Grid Api methods and trigger Adaptable state changes
|
|
413
409
|
this.agGridAdapter.setAgGridApi(agGridApi);
|
|
414
410
|
this.agGridAdapter.monkeyPatchingGridOptionsUpdates(agGridApi);
|
|
415
411
|
this.lifecycleState = 'agGridReady';
|
|
@@ -432,7 +428,6 @@ class AdaptableAgGrid {
|
|
|
432
428
|
this.refreshHeader();
|
|
433
429
|
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
434
430
|
(0, LayoutHelpers_1.checkForDuplicateColumns)(currentLayout);
|
|
435
|
-
this.layoutManager.silentSetCurrentLayout((0, LayoutHelpers_1.layoutStateToLayoutModel)(currentLayout));
|
|
436
431
|
if ((0, LayoutHelpers_1.isPivotLayout)(currentLayout)) {
|
|
437
432
|
// this is very very strange!
|
|
438
433
|
// for some projects, if the initial layout is pivot, the columnDefs of the pivot resutl columns are NOT derived correctly from the main colDefs
|
|
@@ -552,6 +547,21 @@ You need to define at least one Layout!`);
|
|
|
552
547
|
state.ToolPanel = toolPanelState;
|
|
553
548
|
return state;
|
|
554
549
|
}
|
|
550
|
+
getCurrentLayoutModel() {
|
|
551
|
+
const currentLayout = this.api.layoutApi.getCurrentLayout();
|
|
552
|
+
if (!currentLayout) {
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
555
|
+
return (0, LayoutHelpers_1.layoutStateToLayoutModel)(currentLayout);
|
|
556
|
+
}
|
|
557
|
+
silentUpdateCurrentLayoutModel(layoutModel = this.getCurrentLayoutModel()) {
|
|
558
|
+
if (!layoutModel) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
this.layoutManager.silentSetCurrentLayout(layoutModel, {
|
|
562
|
+
normalize: true,
|
|
563
|
+
});
|
|
564
|
+
}
|
|
555
565
|
applyFiltering() {
|
|
556
566
|
const agGridApi = this.agGridAdapter.getAgGridApi();
|
|
557
567
|
this._emit('AdapTableFiltersApplied');
|
|
@@ -767,12 +777,7 @@ You need to define at least one Layout!`);
|
|
|
767
777
|
* `doesExternalFilterPass`
|
|
768
778
|
*/
|
|
769
779
|
this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'doesExternalFilterPass', (original_doesExternalFilterPass) => {
|
|
770
|
-
const { filteredOutPrimaryKeys } = this;
|
|
771
|
-
filteredOutPrimaryKeys.clear();
|
|
772
780
|
return (node) => {
|
|
773
|
-
if (node.rowIndex === 0) {
|
|
774
|
-
filteredOutPrimaryKeys.clear();
|
|
775
|
-
}
|
|
776
781
|
if (!this.isAvailable) {
|
|
777
782
|
return true;
|
|
778
783
|
}
|
|
@@ -804,14 +809,12 @@ You need to define at least one Layout!`);
|
|
|
804
809
|
// Not sure about this - what should we do with an invalid Grid Filter?
|
|
805
810
|
// Here we essentially clear the Grid for invalid Grid Filter by returning false for each row
|
|
806
811
|
if (!isCurrentGridFilterValid) {
|
|
807
|
-
filteredOutPrimaryKeys.add(primaryKey);
|
|
808
812
|
return false;
|
|
809
813
|
}
|
|
810
814
|
const gridFilterEvaluationResult = this.api.internalApi
|
|
811
815
|
.getQueryLanguageService()
|
|
812
816
|
.evaluateBooleanExpression(currentGridFilterExpression, ModuleConstants_1.GridFilterModuleId, node);
|
|
813
817
|
if (!gridFilterEvaluationResult) {
|
|
814
|
-
filteredOutPrimaryKeys.add(primaryKey);
|
|
815
818
|
return false;
|
|
816
819
|
}
|
|
817
820
|
}
|
|
@@ -825,7 +828,6 @@ You need to define at least one Layout!`);
|
|
|
825
828
|
if (evaluateColumnFilterOnClient) {
|
|
826
829
|
const columnFilterEvaluationResult = this.api.filterApi.columnFilterApi.internalApi.evaluateColumnFilter(columnFilter, node);
|
|
827
830
|
if (!columnFilterEvaluationResult) {
|
|
828
|
-
filteredOutPrimaryKeys.add(primaryKey);
|
|
829
831
|
return false;
|
|
830
832
|
}
|
|
831
833
|
}
|
|
@@ -834,15 +836,11 @@ You need to define at least one Layout!`);
|
|
|
834
836
|
}
|
|
835
837
|
catch (ex) {
|
|
836
838
|
this.logger.error(ex);
|
|
837
|
-
filteredOutPrimaryKeys.add(primaryKey);
|
|
838
839
|
return false;
|
|
839
840
|
}
|
|
840
841
|
const result = original_doesExternalFilterPass
|
|
841
842
|
? original_doesExternalFilterPass(node)
|
|
842
843
|
: true;
|
|
843
|
-
if (!result) {
|
|
844
|
-
filteredOutPrimaryKeys.add(primaryKey);
|
|
845
|
-
}
|
|
846
844
|
return result;
|
|
847
845
|
};
|
|
848
846
|
});
|
|
@@ -1621,6 +1619,17 @@ You need to define at least one Layout!`);
|
|
|
1621
1619
|
}
|
|
1622
1620
|
return this.createGridCell(rowNode, columnId);
|
|
1623
1621
|
}
|
|
1622
|
+
isRowNodeAvailableAfterFiltering(rowNode) {
|
|
1623
|
+
if (rowNode.displayed) {
|
|
1624
|
+
return true;
|
|
1625
|
+
}
|
|
1626
|
+
const parentRowNode = rowNode.parent;
|
|
1627
|
+
if (parentRowNode == null || parentRowNode.id == 'ROOT_NODE_ID') {
|
|
1628
|
+
return false;
|
|
1629
|
+
}
|
|
1630
|
+
const foundNode = parentRowNode.childrenAfterFilter?.find((c) => c.id == rowNode.id);
|
|
1631
|
+
return foundNode != null;
|
|
1632
|
+
}
|
|
1624
1633
|
/**
|
|
1625
1634
|
* Use (lazy evaluated) getters to avoid unnecessary calculations and memoization to avoid recalculating the same values
|
|
1626
1635
|
*/
|
|
@@ -1651,7 +1660,7 @@ You need to define at least one Layout!`);
|
|
|
1651
1660
|
return getRawValue();
|
|
1652
1661
|
},
|
|
1653
1662
|
get visible() {
|
|
1654
|
-
return self.
|
|
1663
|
+
return self.isRowNodeAvailableAfterFiltering(rowNode);
|
|
1655
1664
|
},
|
|
1656
1665
|
get displayValue() {
|
|
1657
1666
|
if (_displayValue === undefined) {
|
|
@@ -2293,9 +2302,6 @@ You need to define at least one Layout!`);
|
|
|
2293
2302
|
return gridCells;
|
|
2294
2303
|
}
|
|
2295
2304
|
}
|
|
2296
|
-
isPrimaryKeyVisible(primaryKey) {
|
|
2297
|
-
return !this.filteredOutPrimaryKeys.has(primaryKey);
|
|
2298
|
-
}
|
|
2299
2305
|
addDistinctColumnValue(rowNode, columnId) {
|
|
2300
2306
|
// we do not return the values of the aggregates when in grouping mode
|
|
2301
2307
|
// otherwise they would appear in the filter dropdown etc....
|
|
@@ -2322,29 +2328,39 @@ You need to define at least one Layout!`);
|
|
|
2322
2328
|
}
|
|
2323
2329
|
return value;
|
|
2324
2330
|
};
|
|
2331
|
+
const self = this;
|
|
2332
|
+
// those are grid cells unique per primary key - so cells corresponding to this column
|
|
2333
|
+
// by for every row in the grid
|
|
2334
|
+
// but here we want to collapse them down to values/cells unique by the
|
|
2335
|
+
// value of this column: eg - if this is country column and we have multiple rownodes
|
|
2336
|
+
// in the grid with country: UK, and multiple with country: France, then the end result
|
|
2337
|
+
// of the current function should be 2 cells: one for UK and one for France
|
|
2325
2338
|
gridCells.forEach((dataItem) => {
|
|
2326
2339
|
const value = getter(dataItem);
|
|
2327
|
-
const primaryKey = dataItem.primaryKeyValue;
|
|
2328
2340
|
if (!cache.has(value)) {
|
|
2329
2341
|
cache.set(value, {
|
|
2330
2342
|
count: 1,
|
|
2331
2343
|
cell: dataItem,
|
|
2332
|
-
|
|
2344
|
+
rowNodesWithSameCellValue: [dataItem.rowNode],
|
|
2333
2345
|
});
|
|
2334
2346
|
}
|
|
2335
2347
|
else {
|
|
2336
2348
|
const data = cache.get(value);
|
|
2337
2349
|
data.count++;
|
|
2338
|
-
data.
|
|
2350
|
+
data.rowNodesWithSameCellValue.push(dataItem.rowNode);
|
|
2339
2351
|
}
|
|
2340
2352
|
});
|
|
2341
2353
|
const result = [];
|
|
2342
|
-
cache.forEach(({ count, cell,
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2354
|
+
cache.forEach(({ count, cell, rowNodesWithSameCellValue }) => {
|
|
2355
|
+
const cellWithCount = cell;
|
|
2356
|
+
cellWithCount.count = count;
|
|
2357
|
+
// the visibility of this cell is true if any of the row nodes with this value is visible
|
|
2358
|
+
Object.defineProperty(cellWithCount, 'visible', {
|
|
2359
|
+
get: () => {
|
|
2360
|
+
return (rowNodesWithSameCellValue.findIndex((pk) => self.isRowNodeAvailableAfterFiltering(pk) === true) !== -1);
|
|
2361
|
+
},
|
|
2347
2362
|
});
|
|
2363
|
+
result.push(cellWithCount);
|
|
2348
2364
|
});
|
|
2349
2365
|
return result;
|
|
2350
2366
|
}
|
|
@@ -2818,57 +2834,23 @@ You need to define at least one Layout!`);
|
|
|
2818
2834
|
config.destroyAgGrid = true;
|
|
2819
2835
|
}
|
|
2820
2836
|
}
|
|
2821
|
-
this.
|
|
2837
|
+
this.__prevLayoutForRefresh = undefined;
|
|
2822
2838
|
this.layoutManager?.destroy();
|
|
2823
2839
|
this.layoutManager = null;
|
|
2824
|
-
this.
|
|
2825
|
-
if (
|
|
2826
|
-
this.
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
this.
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
this.agGridAdapter
|
|
2833
|
-
.getAgGridApi()
|
|
2834
|
-
.removeEventListener('cellEditingStarted', this.listenerCellEditingStarted);
|
|
2835
|
-
this.agGridAdapter
|
|
2836
|
-
.getAgGridApi()
|
|
2837
|
-
.removeEventListener('columnRowGroupChanged', this.listenerColumnRowGroupChanged);
|
|
2838
|
-
this.agGridAdapter
|
|
2839
|
-
.getAgGridApi()
|
|
2840
|
-
.removeEventListener('cellSelectionChanged', this.listenerCellSelectionChanged);
|
|
2841
|
-
this.agGridAdapter
|
|
2842
|
-
.getAgGridApi()
|
|
2843
|
-
.removeEventListener('columnResized', this.listenerColumnResized);
|
|
2844
|
-
this.agGridAdapter
|
|
2845
|
-
.getAgGridApi()
|
|
2846
|
-
.removeEventListener('sortChanged', this.listenerSortChanged);
|
|
2847
|
-
this.agGridAdapter
|
|
2848
|
-
.getAgGridApi()
|
|
2849
|
-
.removeEventListener('modelUpdated', this.listenerModelUpdated);
|
|
2850
|
-
this.agGridAdapter.getAgGridApi().removeGlobalListener(this.listenerGlobalSetRowSelection);
|
|
2851
|
-
this.agGridAdapter
|
|
2852
|
-
.getAgGridApi()
|
|
2853
|
-
.removeGlobalListener(this.listenerGlobalColumnEventsThatTriggerStateChange);
|
|
2854
|
-
this.agGridAdapter
|
|
2855
|
-
.getAgGridApi()
|
|
2856
|
-
.removeGlobalListener(this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave);
|
|
2857
|
-
this.agGridAdapter
|
|
2858
|
-
.getAgGridApi()
|
|
2859
|
-
.removeGlobalListener(this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave);
|
|
2840
|
+
const agGridApi = this.agGridAdapter?.getAgGridApi();
|
|
2841
|
+
if (agGridApi && !agGridApi.isDestroyed()) {
|
|
2842
|
+
agGridApi.removeEventListener('firstDataRendered', this.listenerFirstDataRendered);
|
|
2843
|
+
agGridApi.removeEventListener('columnPivotChanged', this.listenerPivotChanged);
|
|
2844
|
+
agGridApi.removeEventListener('cellEditingStarted', this.listenerCellEditingStarted);
|
|
2845
|
+
agGridApi.removeEventListener('cellSelectionChanged', this.listenerCellSelectionChanged);
|
|
2846
|
+
agGridApi.removeEventListener('sortChanged', this.listenerSortChanged);
|
|
2847
|
+
agGridApi.removeGlobalListener(this.listenerGlobalSetRowSelection);
|
|
2860
2848
|
this.listenerFirstDataRendered = null;
|
|
2861
2849
|
this.listenerPivotChanged = null;
|
|
2862
2850
|
this.listenerCellEditingStarted = null;
|
|
2863
|
-
this.listenerColumnRowGroupChanged = null;
|
|
2864
2851
|
this.listenerCellSelectionChanged = null;
|
|
2865
|
-
this.listenerColumnResized = null;
|
|
2866
2852
|
this.listenerGlobalSetRowSelection = null;
|
|
2867
2853
|
this.listenerSortChanged = null;
|
|
2868
|
-
this.listenerModelUpdated = null;
|
|
2869
|
-
this.listenerGlobalColumnEventsThatTriggerStateChange = null;
|
|
2870
|
-
this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = null;
|
|
2871
|
-
this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = null;
|
|
2872
2854
|
this.throttleFilterOnDataChange = null;
|
|
2873
2855
|
const liveGridOptions = this.agGridAdapter.DANGER_getLiveGridOptions();
|
|
2874
2856
|
if (liveGridOptions) {
|
|
@@ -3011,10 +2993,7 @@ You need to define at least one Layout!`);
|
|
|
3011
2993
|
getChartRef(chartId) {
|
|
3012
2994
|
return this.agGridAdapter.getAgGridApi().getChartRef(chartId);
|
|
3013
2995
|
}
|
|
3014
|
-
|
|
3015
|
-
if (!layout) {
|
|
3016
|
-
layout = this.api.layoutApi.getCurrentLayout();
|
|
3017
|
-
}
|
|
2996
|
+
updateLayoutInManagerAfterStoreHasChanged(layout = this.api.layoutApi.getCurrentLayout()) {
|
|
3018
2997
|
(0, LayoutHelpers_1.checkForDuplicateColumns)(layout);
|
|
3019
2998
|
const isLayoutSwitch = this._prevLayout && layout.Name != this._prevLayout.Name;
|
|
3020
2999
|
let shouldUpdateExpandState = isLayoutSwitch;
|
|
@@ -3049,9 +3028,11 @@ You need to define at least one Layout!`);
|
|
|
3049
3028
|
// and is specific to Adaptable, therefore we need to refresh it manually
|
|
3050
3029
|
this.refreshHeader();
|
|
3051
3030
|
const layoutModel = (0, LayoutHelpers_1.layoutStateToLayoutModel)(layout);
|
|
3052
|
-
|
|
3031
|
+
this.layoutManager?.setLayout(layoutModel, {
|
|
3053
3032
|
skipApplyRowGroupsExpandedState: !shouldUpdateExpandState,
|
|
3033
|
+
skipTriggerChange: true,
|
|
3054
3034
|
});
|
|
3035
|
+
this.refreshAdaptableAfterLayoutChange(layout);
|
|
3055
3036
|
if (layout.AutoSizeColumns) {
|
|
3056
3037
|
if (isPivot) {
|
|
3057
3038
|
requestAnimationFrame(() => {
|
|
@@ -3072,15 +3053,6 @@ You need to define at least one Layout!`);
|
|
|
3072
3053
|
plugin.afterSetLayout(this, layout);
|
|
3073
3054
|
}
|
|
3074
3055
|
});
|
|
3075
|
-
if (!layoutChanged) {
|
|
3076
|
-
// we won't get an onLayoutChange event
|
|
3077
|
-
// most likely only filters have changed (column or grid filters)
|
|
3078
|
-
// and because filters are not part of the layout manager
|
|
3079
|
-
// there will be no change to the layout
|
|
3080
|
-
// so we need to manually trigger the onLayoutChange event
|
|
3081
|
-
// for other layout-related updates
|
|
3082
|
-
this.onLayoutChange(layout, { skipRefresh: true });
|
|
3083
|
-
}
|
|
3084
3056
|
perfSetLayout.end();
|
|
3085
3057
|
}
|
|
3086
3058
|
getActiveAdaptableAggFuncForCol(columnId) {
|
|
@@ -3359,7 +3331,7 @@ You need to define at least one Layout!`);
|
|
|
3359
3331
|
this.agGridAdapter.setGridOption('columnDefs', columnDefs);
|
|
3360
3332
|
// this is needed here for when we call setAdaptableStateKey
|
|
3361
3333
|
// and pass a new config
|
|
3362
|
-
this.
|
|
3334
|
+
this.updateLayoutInManagerAfterStoreHasChanged();
|
|
3363
3335
|
this.applyFiltering();
|
|
3364
3336
|
}
|
|
3365
3337
|
isRowGroupDifferentInLayout(one, other) {
|
|
@@ -3389,25 +3361,25 @@ You need to define at least one Layout!`);
|
|
|
3389
3361
|
};
|
|
3390
3362
|
return hasPivotTotals(one) || hasPivotTotals(other);
|
|
3391
3363
|
}
|
|
3392
|
-
onLayoutChange(layout
|
|
3393
|
-
this.
|
|
3394
|
-
const skipRefresh = options?.skipRefresh;
|
|
3395
|
-
if (!skipRefresh) {
|
|
3396
|
-
const prevOnChangeLayout = this.__prevLayoutForOnChange || this.api.layoutApi.getCurrentLayout();
|
|
3397
|
-
// see #on-regroup-expect-group-column-to-be-recomputed-and-setup-properly
|
|
3398
|
-
const rowGroupsChanged = this.isRowGroupDifferentInLayout(prevOnChangeLayout, layout);
|
|
3399
|
-
const hasPivotTotalsInLayout = this.hasPivotTotalsInLayout(prevOnChangeLayout, layout);
|
|
3400
|
-
const pivotColsChanged = JSON.stringify(layout.PivotColumns) !== JSON.stringify(prevOnChangeLayout.PivotColumns);
|
|
3401
|
-
if (rowGroupsChanged || pivotColsChanged || hasPivotTotalsInLayout) {
|
|
3402
|
-
this.updateColumnModelAndRefreshGrid();
|
|
3403
|
-
}
|
|
3404
|
-
else {
|
|
3405
|
-
this.deriveAdaptableColumnStateFromAgGrid();
|
|
3406
|
-
}
|
|
3407
|
-
}
|
|
3408
|
-
this.__prevLayoutForOnChange = layout;
|
|
3364
|
+
onLayoutChange(layout) {
|
|
3365
|
+
this.refreshAdaptableAfterLayoutChange(layout);
|
|
3409
3366
|
this.api.layoutApi.createOrUpdateLayout(layout);
|
|
3410
3367
|
}
|
|
3368
|
+
refreshAdaptableAfterLayoutChange(layout) {
|
|
3369
|
+
this.logger.info('refreshAdaptableAfterLayoutChange()');
|
|
3370
|
+
const prevLayoutForRefresh = this.__prevLayoutForRefresh || this.api.layoutApi.getCurrentLayout();
|
|
3371
|
+
// see #on-regroup-expect-group-column-to-be-recomputed-and-setup-properly
|
|
3372
|
+
const rowGroupsChanged = this.isRowGroupDifferentInLayout(prevLayoutForRefresh, layout);
|
|
3373
|
+
const hasPivotTotalsInLayout = this.hasPivotTotalsInLayout(prevLayoutForRefresh, layout);
|
|
3374
|
+
const pivotColsChanged = JSON.stringify(layout.PivotColumns) !== JSON.stringify(prevLayoutForRefresh.PivotColumns);
|
|
3375
|
+
if (rowGroupsChanged || pivotColsChanged || hasPivotTotalsInLayout) {
|
|
3376
|
+
this.updateColumnModelAndRefreshGrid();
|
|
3377
|
+
}
|
|
3378
|
+
else {
|
|
3379
|
+
this.deriveAdaptableColumnStateFromAgGrid();
|
|
3380
|
+
}
|
|
3381
|
+
this.__prevLayoutForRefresh = layout;
|
|
3382
|
+
}
|
|
3411
3383
|
validateColumnDefTypes(columnDefs) {
|
|
3412
3384
|
// in Adaptable version 20 we switched from colDef.type to colDef.cellDataType
|
|
3413
3385
|
// although we documented this change and try to infer the correct cellDataTypes, it's best to also check if the client dev forgot to adjust his colDefs
|
|
@@ -28,6 +28,7 @@ const filterableCategories = [
|
|
|
28
28
|
'logical',
|
|
29
29
|
'maths',
|
|
30
30
|
'strings',
|
|
31
|
+
'changes',
|
|
31
32
|
'comparison',
|
|
32
33
|
'observable',
|
|
33
34
|
'aggregation',
|
|
@@ -42,6 +43,7 @@ const getCategoryOrder = (category) => {
|
|
|
42
43
|
strings: 5,
|
|
43
44
|
maths: 6,
|
|
44
45
|
dates: 7,
|
|
46
|
+
changes: 8,
|
|
45
47
|
};
|
|
46
48
|
return predefinedOrder[category] || 0;
|
|
47
49
|
};
|
|
@@ -41,7 +41,12 @@ const INFINITE_COLUMNS_WITH_CHECKBOX = {
|
|
|
41
41
|
},
|
|
42
42
|
resizable: false,
|
|
43
43
|
defaultSortable: false,
|
|
44
|
-
renderSelectionCheckBox:
|
|
44
|
+
renderSelectionCheckBox: (params) => {
|
|
45
|
+
// disable reacting to onChange
|
|
46
|
+
// as we handle selection change in the onCellClick
|
|
47
|
+
return React.createElement(infinite_react_1.components.CheckBox, { checked: params.rowInfo?.rowSelected ?? false });
|
|
48
|
+
},
|
|
49
|
+
renderHeaderSelectionCheckBox: true,
|
|
45
50
|
className: 'ab-Select-CheckboxColumn',
|
|
46
51
|
renderValue: ({ renderBag }) => {
|
|
47
52
|
return React.createElement("div", { className: "InfiniteCell_content_value" }, renderBag.value);
|
|
@@ -347,8 +352,10 @@ const Select = function (props) {
|
|
|
347
352
|
setValue({ value }, 'select-option');
|
|
348
353
|
}, [setValue]);
|
|
349
354
|
const onCellClick = React.useCallback(({ rowIndex, api, dataSourceApi }) => {
|
|
350
|
-
|
|
351
|
-
|
|
355
|
+
if (isMulti) {
|
|
356
|
+
const pk = dataSourceApi.getPrimaryKeyByIndex(rowIndex);
|
|
357
|
+
api.rowSelectionApi.toggleRowSelection(pk);
|
|
358
|
+
}
|
|
352
359
|
// see #ensure-select-closes-after-clicking-outside
|
|
353
360
|
requestAnimationFrame(() => {
|
|
354
361
|
ref.current?.focus();
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "20.1.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1748524800262 || Date.now(),
|
|
6
|
+
VERSION: "20.1.6" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -18,11 +18,38 @@ export interface BaseLayoutModel {
|
|
|
18
18
|
* fully specified back to Adaptable, with this prop
|
|
19
19
|
* set as it was when we received it from Adaptable
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
Ignore_ColumnFilters?: any[];
|
|
22
22
|
/**
|
|
23
23
|
* Same as ColumnFilters, but for Grid Filter
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
Ignore_GridFilter?: any;
|
|
26
|
+
/**
|
|
27
|
+
* Same as AutoSizeColumns, but for Pivot Layout
|
|
28
|
+
*/
|
|
29
|
+
Ignore_AutoSizeColumns?: any;
|
|
30
|
+
/**
|
|
31
|
+
* Same as above, but for IsReadOnly
|
|
32
|
+
*/
|
|
33
|
+
Ignore_IsReadOnly?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Same as above, but for Tags
|
|
36
|
+
*/
|
|
37
|
+
Ignore_Tags?: any[];
|
|
38
|
+
/**
|
|
39
|
+
* Same as RowSummaries, but for Pivot Layout
|
|
40
|
+
*/
|
|
41
|
+
Ignore_RowSummaries?: any;
|
|
42
|
+
/**
|
|
43
|
+
* Same as above, but
|
|
44
|
+
*/
|
|
45
|
+
Ignore_Name?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Same as above, but for Column Headers
|
|
48
|
+
*/
|
|
49
|
+
Ignore_ColumnHeaders?: any;
|
|
50
|
+
Ignore_Source?: string;
|
|
51
|
+
Ignore_AdaptableVersion?: string;
|
|
52
|
+
Ignore_Uuid?: string;
|
|
26
53
|
ColumnVisibility?: {
|
|
27
54
|
[columnId: string]: false;
|
|
28
55
|
};
|
|
@@ -54,8 +54,11 @@ export declare class LayoutManager<DATA_TYPE = any> extends LMEmitter {
|
|
|
54
54
|
}): void;
|
|
55
55
|
setLayout(layout: TableLayoutModel | PivotLayoutModel, options?: ApplyLayoutOptions & {
|
|
56
56
|
force?: boolean;
|
|
57
|
+
skipTriggerChange?: boolean;
|
|
57
58
|
}): boolean;
|
|
58
59
|
isCurrentLayoutPivot(): boolean;
|
|
60
|
+
private suspendAgGridListener;
|
|
61
|
+
private resumeAgGridListener;
|
|
59
62
|
private applyLayout;
|
|
60
63
|
private applyTableLayout;
|
|
61
64
|
private getRowGroupNodePathsAs;
|