@adaptabletools/adaptable-cjs 20.1.6 → 20.1.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-cjs",
3
- "version": "20.1.6",
3
+ "version": "20.1.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",
@@ -17,6 +17,7 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
17
17
  [key: string]: boolean;
18
18
  };
19
19
  getCurrentVisibleColumnIdsForTableLayout(): string[];
20
+ getCurrentVisibleColumnIdsForPivotLayout(): string[];
20
21
  getCurrentRowGroupsColumnIds(): string[];
21
22
  setLayout(layoutName: string): void;
22
23
  getCurrentLayout(): Layout;
@@ -47,6 +47,15 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
47
47
  }
48
48
  return layout.TableColumns.filter((colId) => !layout.ColumnVisibility || layout.ColumnVisibility?.[colId] !== false);
49
49
  }
50
+ getCurrentVisibleColumnIdsForPivotLayout() {
51
+ const layout = this.getCurrentLayout();
52
+ if (!(0, LayoutHelpers_1.isPivotLayout)(layout)) {
53
+ return [];
54
+ }
55
+ return this.getAgGridApi()
56
+ .getAllDisplayedColumns()
57
+ .map((col) => col.getColId());
58
+ }
50
59
  getCurrentRowGroupsColumnIds() {
51
60
  const layout = this.getCurrentLayout();
52
61
  if ((0, LayoutHelpers_1.isPivotLayout)(layout)) {
@@ -29,15 +29,19 @@ export interface LayoutApi {
29
29
  */
30
30
  getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
31
31
  /**
32
- * Retrieves map with visible columns in current Layout
32
+ * Retrieves map with visible columns in current Table Layout
33
33
  */
34
34
  getCurrentVisibleColumnIdsMapForTableLayout(): {
35
35
  [key: string]: boolean;
36
36
  };
37
37
  /**
38
- * Retrieves array of visible ColumnIds in current Layout
38
+ * Retrieves array of visible ColumnIds in current Table Layout
39
39
  */
40
40
  getCurrentVisibleColumnIdsForTableLayout(): string[];
41
+ /**
42
+ * Retrieves array of visible ColumnIds in current Pivot Layout
43
+ */
44
+ getCurrentVisibleColumnIdsForPivotLayout(): string[];
41
45
  /**
42
46
  * Retrieves array of visible ColumnIds in current Layout
43
47
  */
@@ -1562,13 +1562,9 @@ You need to define at least one Layout!`);
1562
1562
  const autoGroupColumns = gridApi
1563
1563
  .getAllGridColumns()
1564
1564
  .filter((column) => this.api.columnApi.isAutoRowGroupColumn(column.getColId()));
1565
- if (pivotResultColumns.length) {
1566
- agGridCols = [...agGridCols, ...pivotResultColumns, ...autoGroupColumns];
1567
- }
1565
+ agGridCols = [...autoGroupColumns, ...agGridCols, ...pivotResultColumns];
1568
1566
  }
1569
- const columnGroupChildren = gridApi
1570
- // TODO AFL MIG: check why this assertion is here
1571
- .getAllDisplayedColumnGroups();
1567
+ const columnGroupChildren = gridApi.getAllDisplayedColumnGroups();
1572
1568
  const groupsCount = {};
1573
1569
  const colsToGroups = (columnGroupChildren ?? []).reduce((acc, columnGroup) => {
1574
1570
  if (!columnGroup.getProvidedColumnGroup?.()?.getColGroupDef()) {
@@ -348,8 +348,8 @@ class AgGridColumnAdapter {
348
348
  return userGetQuickFilterText;
349
349
  }
350
350
  return (params) => {
351
- const visibleCoulmnsMap = this.adaptableApi.layoutApi.getCurrentVisibleColumnIdsMapForTableLayout();
352
- const isVisible = visibleCoulmnsMap[abColumn.columnId];
351
+ const visibleColumnsMap = this.adaptableApi.layoutApi.getCurrentVisibleColumnIdsMapForTableLayout();
352
+ const isVisible = visibleColumnsMap[abColumn.columnId];
353
353
  if (!isVisible) {
354
354
  return '';
355
355
  }
@@ -320,9 +320,13 @@ class AgGridExportAdapter {
320
320
  // we compute the exported column keys early, as we need them for other parts of the export process
321
321
  const onlyExportableColumnIds = (columnId) => exportableColumnIdsSet.has(columnId);
322
322
  const getVisibleColumnIds = () => {
323
- return this.adaptableApi.layoutApi
324
- .getCurrentVisibleColumnIdsForTableLayout()
325
- .filter(onlyExportableColumnIds);
323
+ return this.adaptableApi.layoutApi.isCurrentLayoutPivot()
324
+ ? this.adaptableApi.layoutApi
325
+ .getCurrentVisibleColumnIdsForPivotLayout()
326
+ .filter(onlyExportableColumnIds)
327
+ : this.adaptableApi.layoutApi
328
+ .getCurrentVisibleColumnIdsForTableLayout()
329
+ .filter(onlyExportableColumnIds);
326
330
  };
327
331
  let exportedColumnIds = [];
328
332
  switch (report.ReportColumnScope) {
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: 1748524800262 || Date.now(),
6
- VERSION: "20.1.6" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1748626762263 || Date.now(),
6
+ VERSION: "20.1.8" || '--current-version--',
7
7
  };
@@ -930,14 +930,15 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
930
930
  return columnState;
931
931
  }
932
932
  computePivotAggregations(layout, columnState) {
933
- const pivotAggsToIndexes = layout.PivotAggregationColumns.reduce((acc, { ColumnId }, index) => {
933
+ const PivotAggregationColumns = layout.PivotAggregationColumns || [];
934
+ const pivotAggsToIndexes = PivotAggregationColumns.reduce((acc, { ColumnId }, index) => {
934
935
  acc[ColumnId] = index;
935
936
  return acc;
936
937
  }, {});
937
938
  columnState.state = columnState.state.map((colState) => {
938
939
  const columnId = colState.colId;
939
940
  const aggIndex = pivotAggsToIndexes[columnId];
940
- const aggFunc = aggIndex != null ? layout.PivotAggregationColumns[aggIndex].AggFunc.aggFunc : null;
941
+ const aggFunc = aggIndex != null ? PivotAggregationColumns[aggIndex].AggFunc.aggFunc : null;
941
942
  return {
942
943
  ...colState,
943
944
  aggFunc: aggIndex != null ? (aggFunc === true ? DEFAULT_AGG_FUNC : aggFunc) : null,
@@ -1112,7 +1113,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1112
1113
  // fourth: ...etc
1113
1114
  // so we apply the states for all aggregations except the last one
1114
1115
  //
1115
- const aggregationsMapForOrder = layout.PivotAggregationColumns.map((_, index) => layout.PivotAggregationColumns.slice(0, index));
1116
+ const aggregationsMapForOrder = (layout.PivotAggregationColumns || []).map((_, index) => layout.PivotAggregationColumns.slice(0, index));
1116
1117
  aggregationsMapForOrder.forEach((agg) => {
1117
1118
  // we're mutating the columnState here
1118
1119
  this.computePivotAggregations({ ...layout, PivotAggregationColumns: agg }, columnState);
@@ -1307,7 +1308,7 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
1307
1308
  };
1308
1309
  const colIdInfo = (0, destructurePivotColumnId_1.destructurePivotColumnId)(colDef, {
1309
1310
  pivotColIds: this.currentLayout.PivotColumns,
1310
- aggColIds: this.currentLayout.PivotAggregationColumns.map((col) => col.ColumnId),
1311
+ aggColIds: (this.currentLayout.PivotAggregationColumns || []).map((col) => col.ColumnId),
1311
1312
  }, (message) => this.warn(message));
1312
1313
  if (colIdInfo === '!unknown!') {
1313
1314
  return defaultHiddenConfig;