@adaptabletools/adaptable-cjs 21.0.7 → 21.0.8
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/package.json +2 -1
- package/src/Redux/Store/AdaptableStore.d.ts +0 -2
- package/src/Redux/Store/AdaptableStore.js +10 -10
- package/src/agGrid/AdaptableAgGrid.js +5 -1
- package/src/agGrid/AgGridExportAdapter.js +5 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +16 -1
- package/src/layout-manager/src/normalizeLayoutModel.js +8 -3
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.8",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"react-select": "5.10.1",
|
|
55
55
|
"react-toastify": "9.1.3",
|
|
56
56
|
"rebass": "^3.2.2",
|
|
57
|
+
"@types/rebass": "^4.0.10",
|
|
57
58
|
"redux": "^5.0.1",
|
|
58
59
|
"rxjs": "^7.4.0",
|
|
59
60
|
"sentence-case": "^3.0.4",
|
|
@@ -5,8 +5,6 @@ import { BaseState } from '../../AdaptableState/BaseState';
|
|
|
5
5
|
import { IAdaptableStore, LoadStoreConfig } from './Interface/IAdaptableStore';
|
|
6
6
|
type EmitterCallback = (data?: any) => any;
|
|
7
7
|
type EmitterAnyCallback = (eventName: string, data?: any) => any;
|
|
8
|
-
export declare const INIT_STATE = "INIT_STATE";
|
|
9
|
-
export declare const LOAD_STATE = "LOAD_STATE";
|
|
10
8
|
export interface ResetUserDataAction extends Redux.Action {
|
|
11
9
|
}
|
|
12
10
|
export interface InitStateAction extends Redux.Action {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptableStore = exports.LoadState = exports.InitState =
|
|
3
|
+
exports.AdaptableStore = exports.LoadState = exports.InitState = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Redux = tslib_1.__importStar(require("redux"));
|
|
6
6
|
const PluginsRedux = tslib_1.__importStar(require("../ActionsReducers/PluginsRedux"));
|
|
@@ -44,13 +44,13 @@ const ThemeRedux = tslib_1.__importStar(require("../ActionsReducers/ThemeRedux")
|
|
|
44
44
|
const ToolPanelRedux = tslib_1.__importStar(require("../ActionsReducers/ToolPanelRedux"));
|
|
45
45
|
const TeamSharingState_1 = require("../../AdaptableState/TeamSharingState");
|
|
46
46
|
const buildAdaptableStateFunctionConfig_1 = require("./buildAdaptableStateFunctionConfig");
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const INIT_STATE = 'INIT_STATE';
|
|
48
|
+
const LOAD_STATE = 'LOAD_STATE';
|
|
49
49
|
const NON_PERSIST_ACTIONS = {
|
|
50
50
|
'@@INIT': true,
|
|
51
51
|
'@@redux/init': true,
|
|
52
|
-
[
|
|
53
|
-
[
|
|
52
|
+
[LOAD_STATE]: true,
|
|
53
|
+
[INIT_STATE]: true,
|
|
54
54
|
// progress indicators should NOT interfere with state management as it may lead to race conditions due to load/persist state being async
|
|
55
55
|
[PopupRedux_1.PROGRESS_INDICATOR_SHOW]: true,
|
|
56
56
|
[PopupRedux_1.PROGRESS_INDICATOR_HIDE]: true,
|
|
@@ -62,11 +62,11 @@ const NON_PERSISTENT_STORE_KEYS = [
|
|
|
62
62
|
'Plugins',
|
|
63
63
|
];
|
|
64
64
|
const InitState = () => ({
|
|
65
|
-
type:
|
|
65
|
+
type: INIT_STATE,
|
|
66
66
|
});
|
|
67
67
|
exports.InitState = InitState;
|
|
68
68
|
const LoadState = (State) => ({
|
|
69
|
-
type:
|
|
69
|
+
type: LOAD_STATE,
|
|
70
70
|
State,
|
|
71
71
|
});
|
|
72
72
|
exports.LoadState = LoadState;
|
|
@@ -167,7 +167,7 @@ class AdaptableStore {
|
|
|
167
167
|
Redux.combineReducers(rootReducerObject);
|
|
168
168
|
const rootReducerWithResetManagement = (state, action) => {
|
|
169
169
|
switch (action.type) {
|
|
170
|
-
case
|
|
170
|
+
case LOAD_STATE:
|
|
171
171
|
const { State } = action;
|
|
172
172
|
Object.keys(State).forEach((key) => {
|
|
173
173
|
state[key] = State[key];
|
|
@@ -199,7 +199,7 @@ class AdaptableStore {
|
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
201
|
// this is now VERY BADLY NAMED!
|
|
202
|
-
let rootReducer = (0, AdaptableReduxMerger_1.mergeReducer)(rootReducerWithResetManagement,
|
|
202
|
+
let rootReducer = (0, AdaptableReduxMerger_1.mergeReducer)(rootReducerWithResetManagement, LOAD_STATE);
|
|
203
203
|
const composeEnhancers = (x) => x;
|
|
204
204
|
const persistedReducer = (state, action) => {
|
|
205
205
|
if (adaptable.isDestroyed) {
|
|
@@ -1507,7 +1507,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1507
1507
|
/*******************
|
|
1508
1508
|
* MANAGING STATE ACTIONS
|
|
1509
1509
|
*******************/
|
|
1510
|
-
case
|
|
1510
|
+
case INIT_STATE: {
|
|
1511
1511
|
let returnAction = next(action);
|
|
1512
1512
|
if (adaptable.isReady) {
|
|
1513
1513
|
// we need this here for when the state key is changed
|
|
@@ -1102,7 +1102,11 @@ You need to define at least one Layout!`);
|
|
|
1102
1102
|
dataType: 'DateTime',
|
|
1103
1103
|
}, {
|
|
1104
1104
|
id: 'numberExcelType',
|
|
1105
|
-
dataType: 'Number',
|
|
1105
|
+
// dataType: 'Number',
|
|
1106
|
+
// AG Grid requires either dataType or numberFormat to be set for Numbers
|
|
1107
|
+
numberFormat: {
|
|
1108
|
+
format: '0.###############',
|
|
1109
|
+
},
|
|
1106
1110
|
});
|
|
1107
1111
|
this.agGridExportAdapter.originalExcelStyles = excelStyles;
|
|
1108
1112
|
this.agGridExportAdapter.DANGER_excelStyles = this.agGridExportAdapter.originalExcelStyles;
|
|
@@ -621,7 +621,11 @@ class AgGridExportAdapter {
|
|
|
621
621
|
};
|
|
622
622
|
this.excelStylesCache['numberExcelType'] = {
|
|
623
623
|
id: 'numberExcelType',
|
|
624
|
-
dataType: 'Number',
|
|
624
|
+
// dataType: 'Number',
|
|
625
|
+
// AG Grid requires either dataType or numberFormat to be set for Numbers
|
|
626
|
+
numberFormat: {
|
|
627
|
+
format: '0.###############',
|
|
628
|
+
},
|
|
625
629
|
};
|
|
626
630
|
return Object.values(this.excelStylesCache);
|
|
627
631
|
}
|
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: "21.0.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1761108119347 || Date.now(),
|
|
6
|
+
VERSION: "21.0.8" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -336,6 +336,8 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
336
336
|
getPivotLayoutModelFromGrid() {
|
|
337
337
|
const pivotResultColumns = this.gridApi.getPivotResultColumns() || [];
|
|
338
338
|
const pivotResultColumnsSet = new Set(pivotResultColumns.map((col) => col.getColId()));
|
|
339
|
+
const rowGroupColumns = this.gridApi.getRowGroupColumns() || [];
|
|
340
|
+
const rowGroupColumnsSet = new Set(rowGroupColumns.map((col) => col.getColId()));
|
|
339
341
|
const prevLayout = this.currentLayout;
|
|
340
342
|
const columnState = this.gridApi
|
|
341
343
|
.getColumnState()
|
|
@@ -343,6 +345,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
343
345
|
let PivotColumns = this.gridApi.getPivotColumns().map((col) => col.getColId());
|
|
344
346
|
const layout = this.getUndecidedLayoutModelFromGrid(columnState);
|
|
345
347
|
let ColumnSizing = layout.ColumnSizing || {};
|
|
348
|
+
let ColumnVisibility = { ...layout.ColumnVisibility };
|
|
346
349
|
//let's also include the column widths of the pivotResult columns
|
|
347
350
|
pivotResultColumns.forEach((col) => {
|
|
348
351
|
const colId = col.getColId();
|
|
@@ -358,6 +361,18 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
358
361
|
if (!Object.keys(ColumnSizing).length) {
|
|
359
362
|
ColumnSizing = undefined;
|
|
360
363
|
}
|
|
364
|
+
// from column visibility, let's remove all columns that are not actually in the pivot layout
|
|
365
|
+
// since having normal table columns here will break the equality check
|
|
366
|
+
// so we only want to keep the group columns and the pivot result columns
|
|
367
|
+
Object.keys(ColumnVisibility).forEach((colId) => {
|
|
368
|
+
const isInLayout = pivotResultColumnsSet.has(colId) || rowGroupColumnsSet.has(colId);
|
|
369
|
+
if (!isInLayout) {
|
|
370
|
+
delete ColumnVisibility[colId];
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
if (!Object.keys(ColumnVisibility).length) {
|
|
374
|
+
ColumnVisibility = undefined;
|
|
375
|
+
}
|
|
361
376
|
delete layout.TableColumns;
|
|
362
377
|
const pivotLayout = {
|
|
363
378
|
Name: layout.Name,
|
|
@@ -375,7 +390,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
375
390
|
ColumnPinning: layout.ColumnPinning,
|
|
376
391
|
ColumnSorts: layout.ColumnSorts,
|
|
377
392
|
ColumnSizing,
|
|
378
|
-
ColumnVisibility
|
|
393
|
+
ColumnVisibility,
|
|
379
394
|
RowGroupValues: layout.RowGroupValues,
|
|
380
395
|
ColumnGroupValues: layout.ColumnGroupValues,
|
|
381
396
|
PivotGroupedColumns: layout.RowGroupedColumns,
|
|
@@ -105,6 +105,11 @@ function normalizeTableLayoutModel(layout, options) {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
+
// there might be a case where there are we have an RowGroupedColumns array, but it's empty (or it's inexistent altogether)
|
|
109
|
+
// and there is no display type specified - so default it to single
|
|
110
|
+
if (!layout.RowGroupDisplayType && layout.TableColumns) {
|
|
111
|
+
layout.RowGroupDisplayType = 'single';
|
|
112
|
+
}
|
|
108
113
|
if (options?.isTree && !layout.TableColumns.includes(exports.AUTO_GROUP_COLUMN_ID__SINGLE)) {
|
|
109
114
|
layout.TableColumns.unshift(exports.AUTO_GROUP_COLUMN_ID__SINGLE);
|
|
110
115
|
}
|
|
@@ -161,9 +166,9 @@ function normalizePivotLayoutModel(layout) {
|
|
|
161
166
|
// make it an own property
|
|
162
167
|
layout.PivotColumnTotal = undefined;
|
|
163
168
|
}
|
|
164
|
-
if (layout.PivotGroupedColumns && layout.PivotGroupedColumns.length) {
|
|
165
|
-
|
|
166
|
-
}
|
|
169
|
+
// if (layout.PivotGroupedColumns && layout.PivotGroupedColumns.length) {
|
|
170
|
+
layout.RowGroupDisplayType = layout.RowGroupDisplayType || 'single';
|
|
171
|
+
// }
|
|
167
172
|
return layout;
|
|
168
173
|
}
|
|
169
174
|
exports.normalizePivotLayoutModel = normalizePivotLayoutModel;
|