@adaptabletools/adaptable 19.0.0 → 19.0.2

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.
Files changed (73) hide show
  1. package/README.md +1 -2
  2. package/base.css +1 -1
  3. package/base.css.map +1 -1
  4. package/index.css +1 -1
  5. package/index.css.map +1 -1
  6. package/package.json +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
  8. package/src/AdaptableOptions/ActionRowOptions.d.ts +2 -2
  9. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
  10. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -2
  11. package/src/Api/AlertApi.d.ts +8 -0
  12. package/src/Api/ColumnApi.d.ts +18 -15
  13. package/src/Api/CustomSortApi.d.ts +8 -0
  14. package/src/Api/DataChangeHistoryApi.d.ts +5 -0
  15. package/src/Api/Events/GridSorted.d.ts +3 -3
  16. package/src/Api/Events/LiveDataChanged.d.ts +1 -1
  17. package/src/Api/FlashingCellApi.d.ts +25 -12
  18. package/src/Api/FormatColumnApi.d.ts +8 -0
  19. package/src/Api/GridApi.d.ts +53 -2
  20. package/src/Api/Implementation/AlertApiImpl.d.ts +2 -0
  21. package/src/Api/Implementation/AlertApiImpl.js +6 -0
  22. package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -2
  23. package/src/Api/Implementation/ColumnApiImpl.js +19 -30
  24. package/src/Api/Implementation/CustomSortApiImpl.d.ts +2 -0
  25. package/src/Api/Implementation/CustomSortApiImpl.js +6 -0
  26. package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +2 -0
  27. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +5 -0
  28. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +3 -0
  29. package/src/Api/Implementation/FlashingCellApiImpl.js +9 -0
  30. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +2 -0
  31. package/src/Api/Implementation/FormatColumnApiImpl.js +6 -0
  32. package/src/Api/Implementation/GridApiImpl.d.ts +11 -2
  33. package/src/Api/Implementation/GridApiImpl.js +105 -1
  34. package/src/Api/Implementation/ShortcutApiImpl.d.ts +2 -0
  35. package/src/Api/Implementation/ShortcutApiImpl.js +6 -0
  36. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +2 -0
  37. package/src/Api/Implementation/StyledColumnApiImpl.js +6 -0
  38. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -0
  39. package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -0
  40. package/src/Api/Internal/ActionRowInternalApi.d.ts +1 -1
  41. package/src/Api/Internal/ActionRowInternalApi.js +10 -8
  42. package/src/Api/Internal/ExportInternalApi.d.ts +3 -3
  43. package/src/Api/Internal/ExportInternalApi.js +17 -13
  44. package/src/Api/Internal/GridFilterInternalApi.d.ts +1 -1
  45. package/src/Api/Internal/GridFilterInternalApi.js +5 -2
  46. package/src/Api/ShortcutApi.d.ts +8 -0
  47. package/src/Api/StyledColumnApi.d.ts +8 -0
  48. package/src/Api/UserInterfaceApi.d.ts +6 -2
  49. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +1 -1
  50. package/src/PredefinedConfig/Common/RowScope.d.ts +1 -1
  51. package/src/Redux/ActionsReducers/SystemRedux.js +3 -8
  52. package/src/Utilities/license/hashing.js +1 -1
  53. package/src/View/Dashboard/DashboardPopup.js +4 -3
  54. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -0
  55. package/src/View/Layout/Wizard/getGridFilterPreview.js +1 -1
  56. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  57. package/src/View/Layout/Wizard/sections/GridFilterSection.js +1 -1
  58. package/src/agGrid/ActionColumnRenderer.d.ts +2 -0
  59. package/src/agGrid/ActionColumnRenderer.js +29 -3
  60. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  61. package/src/agGrid/AdaptableAgGrid.js +22 -8
  62. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  63. package/src/agGrid/AgGridAdapter.js +12 -0
  64. package/src/agGrid/AgGridColumnAdapter.d.ts +2 -0
  65. package/src/agGrid/AgGridColumnAdapter.js +26 -13
  66. package/src/agGrid/PercentBarRenderer.js +1 -1
  67. package/src/agGrid/defaultAdaptableOptions.js +1 -0
  68. package/src/env.js +2 -2
  69. package/src/metamodel/adaptable.metamodel.js +1 -1
  70. package/src/types.d.ts +2 -2
  71. package/tsconfig.esm.tsbuildinfo +1 -1
  72. package/src/agGrid/CheckboxRenderer.d.ts +0 -16
  73. package/src/agGrid/CheckboxRenderer.js +0 -89
@@ -969,14 +969,23 @@ export class AdaptableAgGrid {
969
969
  /**
970
970
  * `processPivotResultColDef`
971
971
  */
972
- this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'processPivotResultColDef', () => {
972
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'processPivotResultColDef', (original_processPivotResultColDef) => {
973
973
  return (colDef) => {
974
974
  if (this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
975
975
  colDef.floatingFilter = false;
976
976
  colDef.filter = false;
977
977
  }
978
+ original_processPivotResultColDef === null || original_processPivotResultColDef === void 0 ? void 0 : original_processPivotResultColDef(colDef);
978
979
  };
979
980
  });
981
+ /**
982
+ * `maintainColumnOrder`
983
+ */
984
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'maintainColumnOrder', () => {
985
+ // see https://www.ag-grid.com/javascript-data-grid/column-updating-definitions/#maintain-column-order
986
+ // we want to always maintain the column order (provided by Adaptable Layouts), even when column definitions change
987
+ return true;
988
+ });
980
989
  /**
981
990
  * `columnTypes`
982
991
  */
@@ -1928,6 +1937,7 @@ export class AdaptableAgGrid {
1928
1937
  return rawValue;
1929
1938
  }
1930
1939
  updateColumnModelAndRefreshGrid(config) {
1940
+ this.logger.info(`Updating Column Model and Refreshing Grid ${config ? `with config ${JSON.stringify(config)}` : ''}`);
1931
1941
  if (config === null || config === void 0 ? void 0 : config.preemptiveColumnStateRefresh) {
1932
1942
  this.deriveAdaptableColumnStateFromAgGrid();
1933
1943
  }
@@ -2487,10 +2497,6 @@ export class AdaptableAgGrid {
2487
2497
  }
2488
2498
  }
2489
2499
  }
2490
- isCellEditable(rowNode, column) {
2491
- // it's safe to rely on the AG Grid implementation because we override the colDef.editable property, which is in this case the single source of truth
2492
- return column === null || column === void 0 ? void 0 : column.isCellEditable(rowNode);
2493
- }
2494
2500
  forAllRowNodesDo(func, config) {
2495
2501
  this.agGridAdapter.getAgGridApi().forEachNode((rowNode, rowIndex) => {
2496
2502
  const includeGroupRows = (config === null || config === void 0 ? void 0 : config.includeGroupRows) || !this.isGroupRowNode(rowNode);
@@ -2691,6 +2697,10 @@ export class AdaptableAgGrid {
2691
2697
  return this.agGridAdapter.getAgGridApi().getChartModels();
2692
2698
  }
2693
2699
  getRowCount() {
2700
+ const allNodes = this.getAllRowNodes({ includeGroupRows: false });
2701
+ return allNodes.length;
2702
+ }
2703
+ getVisibleRowCount() {
2694
2704
  return this.agGridAdapter.getAgGridApi().getDisplayedRowCount();
2695
2705
  }
2696
2706
  getColumnCount() {
@@ -3216,7 +3226,7 @@ export class AdaptableAgGrid {
3216
3226
  rawValue = dateRawValue;
3217
3227
  }
3218
3228
  }
3219
- return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
3229
+ return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId, GeneralConstants.VISUAL_DATA_REPORT);
3220
3230
  }
3221
3231
  processCellForExcelExport(rowNode, columnId) {
3222
3232
  if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
@@ -3227,7 +3237,7 @@ export class AdaptableAgGrid {
3227
3237
  return isoFormattedDate;
3228
3238
  }
3229
3239
  }
3230
- return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId);
3240
+ return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId, GeneralConstants.VISUAL_DATA_REPORT);
3231
3241
  }
3232
3242
  isQuickFilterAvailable() {
3233
3243
  if (this.api.layoutApi.isCurrentLayoutPivot() &&
@@ -3433,7 +3443,11 @@ export class AdaptableAgGrid {
3433
3443
  });
3434
3444
  perfApplyColumnState.end();
3435
3445
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
3436
- this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
3446
+ if (shouldUpdatePivoted) {
3447
+ // simply setting PivotColumns fires an AG Grid 'modelChanged' event which cascades to a full row reload in SSRM
3448
+ // this includes the case when we simply set an empty array of pivot columns
3449
+ this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
3450
+ }
3437
3451
  // aggrid 25.1.0 introduced a bug such that a layout that has a grouped column, if the column has enableRowGroup: true but not rowGroup: true
3438
3452
  // the group column is not possitioned correctly at the start of the layout
3439
3453
  // see the test in layout/layout-switch/"should be able to switch from grouped to non-grouped and back"
@@ -60,6 +60,7 @@ export declare class AgGridAdapter {
60
60
  */
61
61
  assignColumnIdsToColDefs(colDefs?: (ColDef | ColGroupDef)[]): void;
62
62
  patchColDefs(colDefs: (ColDef | ColGroupDef)[], patchFn: (colDef: ColDef) => void): void;
63
+ traverseColDefs(colDefs: (ColDef | ColGroupDef)[], modifyFn: (colDef: ColDef) => ColDef | null): (ColDef | ColGroupDef)[];
63
64
  getDefaultColumnDefinition(): GridOptions['defaultColDef'];
64
65
  _agGridApi_getValue(colKey: string | Column, rowNode: IRowNode, gridApi?: GridApi): any;
65
66
  }
@@ -587,6 +587,18 @@ export class AgGridAdapter {
587
587
  };
588
588
  colDefs.forEach((colDef) => applyPatch(colDef));
589
589
  }
590
+ traverseColDefs(colDefs, modifyFn) {
591
+ const applyModification = (colDef) => {
592
+ if ('children' in colDef) {
593
+ const updatedChildren = colDef.children.map(applyModification).filter(Boolean);
594
+ return Object.assign(Object.assign({}, colDef), { children: updatedChildren });
595
+ }
596
+ else {
597
+ return modifyFn(colDef);
598
+ }
599
+ };
600
+ return colDefs.map(applyModification).filter(Boolean);
601
+ }
590
602
  getDefaultColumnDefinition() {
591
603
  var _a, _b;
592
604
  // for early init phase, gridApi might not be ready yet
@@ -36,6 +36,7 @@ export declare class AgGridColumnAdapter {
36
36
  private isQuickSearchActive;
37
37
  private getEditableCellClass;
38
38
  private getReadonlyCellClass;
39
+ private getEditedCellClass;
39
40
  private getAlertCellClass;
40
41
  private getFlashingCellClass;
41
42
  private getNoteCellClassName;
@@ -44,6 +45,7 @@ export declare class AgGridColumnAdapter {
44
45
  private getQuickSearchCellStyle;
45
46
  private getReadOnlyCellStyle;
46
47
  private getEditableCellStyle;
48
+ private getEditedCellStyle;
47
49
  /**
48
50
  * The combination of styled column and format cells
49
51
  * This functiond decides when the two can be merged.
@@ -138,6 +138,7 @@ export class AgGridColumnAdapter {
138
138
  const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(gridCell, params);
139
139
  const editableClassName = this.getEditableCellClass(gridCell, params);
140
140
  const readonlyClassName = this.getReadonlyCellClass(gridCell, params);
141
+ const editedClassName = this.getEditedCellClass(gridCell, params);
141
142
  const highlightAlertClassName = this.getAlertCellClass(gridCell, params);
142
143
  const flashingClassName = this.getFlashingCellClass(gridCell, params);
143
144
  const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
@@ -152,6 +153,7 @@ export class AgGridColumnAdapter {
152
153
  isQuickSearchActive ? quickSearchStyleClassName : null,
153
154
  editableClassName,
154
155
  readonlyClassName,
156
+ editedClassName,
155
157
  highlightAlertClassName,
156
158
  flashingClassName,
157
159
  noteClassName,
@@ -174,7 +176,7 @@ export class AgGridColumnAdapter {
174
176
  const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, abColumn.columnId);
175
177
  const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
176
178
  const userDefined = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
177
- const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, userDefined), this.getReadOnlyCellStyle(gridCell, params)), this.getEditableCellStyle(gridCell, params)), this.getFormatColumnAndStyledColumnCellStyle(gridCell, params)), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(gridCell, params)), this.getFlashingCellStyle(gridCell, params)), this.getCellHighlightStyle(gridCell, params));
179
+ const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, userDefined), this.getReadOnlyCellStyle(gridCell, params)), this.getEditableCellStyle(gridCell, params)), this.getEditedCellStyle(gridCell, params)), this.getFormatColumnAndStyledColumnCellStyle(gridCell, params)), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(gridCell, params)), this.getFlashingCellStyle(gridCell, params)), this.getCellHighlightStyle(gridCell, params));
178
180
  return normalizeStyleForAgGrid(result);
179
181
  };
180
182
  return cellStyle;
@@ -424,19 +426,9 @@ export class AgGridColumnAdapter {
424
426
  if (typeof userValue === 'boolean' && userValue === false) {
425
427
  return userValue;
426
428
  }
427
- const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
428
429
  const editableCallback = (params) => {
429
- // Adaptable Row Summarie rows are not editable
430
- // if (params.node.data[ROW_SUMMARY_ROW_ID]) {
431
- if (this.adaptableApi.gridApi.isSummaryNode(params.node)) {
432
- return false;
433
- }
434
- if (!cellEditableFn) {
435
- return typeof userValue === 'function' ? userValue(params) : userValue;
436
- }
437
430
  const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, params.column.getColId());
438
- const cellEditableContext = Object.assign({ gridCell }, this.adaptableApi.internalApi.buildBaseContext());
439
- return cellEditableFn(cellEditableContext);
431
+ return this.adaptableApi.gridApi.isCellEditable(gridCell);
440
432
  };
441
433
  return editableCallback;
442
434
  });
@@ -586,6 +578,14 @@ export class AgGridColumnAdapter {
586
578
  const isCellReadonly = !this.adaptableApi.gridApi.isCellEditable(gridCell);
587
579
  return isCellReadonly ? readonlyCellStyle.ClassName : null;
588
580
  }
581
+ getEditedCellClass(gridCell, params) {
582
+ const editedCellStyle = this.adaptableApi.userInterfaceApi.getEditedCellStyle();
583
+ if (!(editedCellStyle === null || editedCellStyle === void 0 ? void 0 : editedCellStyle.ClassName)) {
584
+ return null;
585
+ }
586
+ const isCellEdited = this.adaptableApi.gridApi.isCellEdited(gridCell);
587
+ return isCellEdited ? editedCellStyle.ClassName : null;
588
+ }
589
589
  getAlertCellClass(gridCell, params) {
590
590
  var _a, _b;
591
591
  const alert = this.adaptableApi.alertApi.internalApi.getAdaptableAlertWithHighlightCell(gridCell.column.columnId, params.node);
@@ -686,6 +686,18 @@ export class AgGridColumnAdapter {
686
686
  }
687
687
  return undefined;
688
688
  }
689
+ getEditedCellStyle(gridCell, params) {
690
+ const editedCellStyle = this.adaptableApi.userInterfaceApi.getEditedCellStyle();
691
+ if (!editedCellStyle) {
692
+ return undefined;
693
+ }
694
+ if (gridCell) {
695
+ if (this.adaptableApi.gridApi.isCellEdited(gridCell)) {
696
+ return convertAdaptableStyleToCSS(editedCellStyle);
697
+ }
698
+ }
699
+ return undefined;
700
+ }
689
701
  /**
690
702
  * The combination of styled column and format cells
691
703
  * This functiond decides when the two can be merged.
@@ -696,7 +708,7 @@ export class AgGridColumnAdapter {
696
708
  if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended)) {
697
709
  const styledCellStyle = this.getStyledColumnStyle(styledColumn, gridCell.column, params);
698
710
  // for percentbar we want to merge
699
- if (styledColumn.PercentBarStyle || styledColumn.BadgeStyle) {
711
+ if (styledColumn.PercentBarStyle || styledColumn.BadgeStyle || styledColumn.GradientStyle) {
700
712
  styledColumnStyle = styledCellStyle;
701
713
  }
702
714
  else {
@@ -705,6 +717,7 @@ export class AgGridColumnAdapter {
705
717
  }
706
718
  }
707
719
  const activeFormatColumnsWithStyle = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithStyleForColumn(gridCell.column);
720
+ // background color of styledColumn.GradientStyle has precedence and wins over FormatColumn
708
721
  return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
709
722
  }
710
723
  getStyledColumnStyle(styledColumn, abColumn, params) {
@@ -63,7 +63,7 @@ export const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
63
63
  textEl.innerText = (_b = (_a = params.formatValue) === null || _a === void 0 ? void 0 : _a.call(params, params.value)) !== null && _b !== void 0 ? _b : params.value;
64
64
  }
65
65
  if (percentBarStyle.CellText.includes('PercentageValue')) {
66
- textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
66
+ textEl.innerText += ' ' + `${percentageValue.toFixed(0)}%`;
67
67
  }
68
68
  switch (percentBarStyle.CellTextPosition) {
69
69
  case 'Above':
@@ -284,6 +284,7 @@ const DefaultAdaptableOptions = {
284
284
  colorPalette: UIHelper.getDefaultColors(),
285
285
  editableCellStyle: undefined,
286
286
  readOnlyCellStyle: undefined,
287
+ editedCellStyle: undefined,
287
288
  styleClassNames: EMPTY_ARRAY,
288
289
  permittedValues: undefined,
289
290
  editLookUpItems: undefined,
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  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: 1724773387137 || Date.now(),
4
- VERSION: "19.0.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1728328912394 || Date.now(),
4
+ VERSION: "19.0.2" || '--current-version--',
5
5
  };