@adaptabletools/adaptable 21.0.7 → 21.0.9-canary.0

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.9-canary.0",
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: 1761289684570 || Date.now(),
4
+ VERSION: "21.0.9-canary.0" || '--current-version--',
5
5
  };
@@ -94,7 +94,7 @@ function isGridLayoutSame(options) {
94
94
  if (!!gridLayout != !!layout) {
95
95
  return false;
96
96
  }
97
- return isLayoutEqual(gridLayout, layout);
97
+ return isLayoutEqual(normalizeLayoutModel(gridLayout), normalizeLayoutModel(layout));
98
98
  }
99
99
  function getDefaultColumnSizeStateForColDef(colId, colDef, options) {
100
100
  if (!colDef) {
@@ -340,6 +340,7 @@ export class LayoutManager extends LMEmitter {
340
340
  let PivotColumns = this.gridApi.getPivotColumns().map((col) => col.getColId());
341
341
  const layout = this.getUndecidedLayoutModelFromGrid(columnState);
342
342
  let ColumnSizing = layout.ColumnSizing || {};
343
+ let ColumnVisibility = { ...layout.ColumnVisibility };
343
344
  //let's also include the column widths of the pivotResult columns
344
345
  pivotResultColumns.forEach((col) => {
345
346
  const colId = col.getColId();
@@ -355,6 +356,18 @@ export class LayoutManager extends LMEmitter {
355
356
  if (!Object.keys(ColumnSizing).length) {
356
357
  ColumnSizing = undefined;
357
358
  }
359
+ // from column visibility, let's remove all columns that are not actually in the pivot layout
360
+ // since having normal table columns here will break the equality check
361
+ // so we only want to keep the group columns and the pivot result columns
362
+ Object.keys(ColumnVisibility).forEach((colId) => {
363
+ const isInLayout = pivotResultColumnsSet.has(colId) || colId.startsWith(AUTO_GROUP_COLUMN_ID__SINGLE);
364
+ if (!isInLayout) {
365
+ delete ColumnVisibility[colId];
366
+ }
367
+ });
368
+ if (!Object.keys(ColumnVisibility).length) {
369
+ ColumnVisibility = undefined;
370
+ }
358
371
  delete layout.TableColumns;
359
372
  const pivotLayout = {
360
373
  Name: layout.Name,
@@ -372,7 +385,7 @@ export class LayoutManager extends LMEmitter {
372
385
  ColumnPinning: layout.ColumnPinning,
373
386
  ColumnSorts: layout.ColumnSorts,
374
387
  ColumnSizing,
375
- ColumnVisibility: layout.ColumnVisibility,
388
+ ColumnVisibility,
376
389
  RowGroupValues: layout.RowGroupValues,
377
390
  ColumnGroupValues: layout.ColumnGroupValues,
378
391
  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) {