@adaptabletools/adaptable 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "21.0.7",
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",
@@ -53,6 +53,7 @@
53
53
  "react-select": "5.10.1",
54
54
  "react-toastify": "9.1.3",
55
55
  "rebass": "^3.2.2",
56
+ "@types/rebass": "^4.0.10",
56
57
  "redux": "^5.0.1",
57
58
  "rxjs": "^7.4.0",
58
59
  "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 {
@@ -40,8 +40,8 @@ import * as ThemeRedux from '../ActionsReducers/ThemeRedux';
40
40
  import * as ToolPanelRedux from '../ActionsReducers/ToolPanelRedux';
41
41
  import { isAdaptableSharedEntity, isCustomSharedEntity, } from '../../AdaptableState/TeamSharingState';
42
42
  import { buildAdaptableStateFunctionConfig } from './buildAdaptableStateFunctionConfig';
43
- export const INIT_STATE = 'INIT_STATE';
44
- export const LOAD_STATE = 'LOAD_STATE';
43
+ const INIT_STATE = 'INIT_STATE';
44
+ const LOAD_STATE = 'LOAD_STATE';
45
45
  const NON_PERSIST_ACTIONS = {
46
46
  '@@INIT': true,
47
47
  '@@redux/init': true,
@@ -1098,7 +1098,11 @@ You need to define at least one Layout!`);
1098
1098
  dataType: 'DateTime',
1099
1099
  }, {
1100
1100
  id: 'numberExcelType',
1101
- dataType: 'Number',
1101
+ // dataType: 'Number',
1102
+ // AG Grid requires either dataType or numberFormat to be set for Numbers
1103
+ numberFormat: {
1104
+ format: '0.###############',
1105
+ },
1102
1106
  });
1103
1107
  this.agGridExportAdapter.originalExcelStyles = excelStyles;
1104
1108
  this.agGridExportAdapter.DANGER_excelStyles = this.agGridExportAdapter.originalExcelStyles;
@@ -617,7 +617,11 @@ export class AgGridExportAdapter {
617
617
  };
618
618
  this.excelStylesCache['numberExcelType'] = {
619
619
  id: 'numberExcelType',
620
- dataType: 'Number',
620
+ // dataType: 'Number',
621
+ // AG Grid requires either dataType or numberFormat to be set for Numbers
622
+ numberFormat: {
623
+ format: '0.###############',
624
+ },
621
625
  };
622
626
  return Object.values(this.excelStylesCache);
623
627
  }
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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" || '',
3
- PUBLISH_TIMESTAMP: 1760446037964 || Date.now(),
4
- VERSION: "21.0.7" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1761108086778 || Date.now(),
4
+ VERSION: "21.0.8" || '--current-version--',
5
5
  };
@@ -333,6 +333,8 @@ export class LayoutManager extends LMEmitter {
333
333
  getPivotLayoutModelFromGrid() {
334
334
  const pivotResultColumns = this.gridApi.getPivotResultColumns() || [];
335
335
  const pivotResultColumnsSet = new Set(pivotResultColumns.map((col) => col.getColId()));
336
+ const rowGroupColumns = this.gridApi.getRowGroupColumns() || [];
337
+ const rowGroupColumnsSet = new Set(rowGroupColumns.map((col) => col.getColId()));
336
338
  const prevLayout = this.currentLayout;
337
339
  const columnState = this.gridApi
338
340
  .getColumnState()
@@ -340,6 +342,7 @@ export class LayoutManager extends LMEmitter {
340
342
  let PivotColumns = this.gridApi.getPivotColumns().map((col) => col.getColId());
341
343
  const layout = this.getUndecidedLayoutModelFromGrid(columnState);
342
344
  let ColumnSizing = layout.ColumnSizing || {};
345
+ let ColumnVisibility = { ...layout.ColumnVisibility };
343
346
  //let's also include the column widths of the pivotResult columns
344
347
  pivotResultColumns.forEach((col) => {
345
348
  const colId = col.getColId();
@@ -355,6 +358,18 @@ export class LayoutManager extends LMEmitter {
355
358
  if (!Object.keys(ColumnSizing).length) {
356
359
  ColumnSizing = undefined;
357
360
  }
361
+ // from column visibility, let's remove all columns that are not actually in the pivot layout
362
+ // since having normal table columns here will break the equality check
363
+ // so we only want to keep the group columns and the pivot result columns
364
+ Object.keys(ColumnVisibility).forEach((colId) => {
365
+ const isInLayout = pivotResultColumnsSet.has(colId) || rowGroupColumnsSet.has(colId);
366
+ if (!isInLayout) {
367
+ delete ColumnVisibility[colId];
368
+ }
369
+ });
370
+ if (!Object.keys(ColumnVisibility).length) {
371
+ ColumnVisibility = undefined;
372
+ }
358
373
  delete layout.TableColumns;
359
374
  const pivotLayout = {
360
375
  Name: layout.Name,
@@ -372,7 +387,7 @@ export class LayoutManager extends LMEmitter {
372
387
  ColumnPinning: layout.ColumnPinning,
373
388
  ColumnSorts: layout.ColumnSorts,
374
389
  ColumnSizing,
375
- ColumnVisibility: layout.ColumnVisibility,
390
+ ColumnVisibility,
376
391
  RowGroupValues: layout.RowGroupValues,
377
392
  ColumnGroupValues: layout.ColumnGroupValues,
378
393
  PivotGroupedColumns: layout.RowGroupedColumns,
@@ -102,6 +102,11 @@ export function normalizeTableLayoutModel(layout, options) {
102
102
  };
103
103
  }
104
104
  }
105
+ // there might be a case where there are we have an RowGroupedColumns array, but it's empty (or it's inexistent altogether)
106
+ // and there is no display type specified - so default it to single
107
+ if (!layout.RowGroupDisplayType && layout.TableColumns) {
108
+ layout.RowGroupDisplayType = 'single';
109
+ }
105
110
  if (options?.isTree && !layout.TableColumns.includes(AUTO_GROUP_COLUMN_ID__SINGLE)) {
106
111
  layout.TableColumns.unshift(AUTO_GROUP_COLUMN_ID__SINGLE);
107
112
  }
@@ -157,9 +162,9 @@ export function normalizePivotLayoutModel(layout) {
157
162
  // make it an own property
158
163
  layout.PivotColumnTotal = undefined;
159
164
  }
160
- if (layout.PivotGroupedColumns && layout.PivotGroupedColumns.length) {
161
- layout.RowGroupDisplayType = layout.RowGroupDisplayType || 'single';
162
- }
165
+ // if (layout.PivotGroupedColumns && layout.PivotGroupedColumns.length) {
166
+ layout.RowGroupDisplayType = layout.RowGroupDisplayType || 'single';
167
+ // }
163
168
  return layout;
164
169
  }
165
170
  export function normalizeLayoutModel(layout, options) {