@adaptabletools/adaptable-cjs 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.cjs.tsbuildinfo +1 -1
  72. package/src/agGrid/CheckboxRenderer.d.ts +0 -16
  73. package/src/agGrid/CheckboxRenderer.js +0 -94
@@ -973,14 +973,23 @@ class AdaptableAgGrid {
973
973
  /**
974
974
  * `processPivotResultColDef`
975
975
  */
976
- this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'processPivotResultColDef', () => {
976
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'processPivotResultColDef', (original_processPivotResultColDef) => {
977
977
  return (colDef) => {
978
978
  if (this.adaptableOptions.columnFilterOptions.useAdaptableColumnFiltering) {
979
979
  colDef.floatingFilter = false;
980
980
  colDef.filter = false;
981
981
  }
982
+ original_processPivotResultColDef === null || original_processPivotResultColDef === void 0 ? void 0 : original_processPivotResultColDef(colDef);
982
983
  };
983
984
  });
985
+ /**
986
+ * `maintainColumnOrder`
987
+ */
988
+ this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'maintainColumnOrder', () => {
989
+ // see https://www.ag-grid.com/javascript-data-grid/column-updating-definitions/#maintain-column-order
990
+ // we want to always maintain the column order (provided by Adaptable Layouts), even when column definitions change
991
+ return true;
992
+ });
984
993
  /**
985
994
  * `columnTypes`
986
995
  */
@@ -1932,6 +1941,7 @@ class AdaptableAgGrid {
1932
1941
  return rawValue;
1933
1942
  }
1934
1943
  updateColumnModelAndRefreshGrid(config) {
1944
+ this.logger.info(`Updating Column Model and Refreshing Grid ${config ? `with config ${JSON.stringify(config)}` : ''}`);
1935
1945
  if (config === null || config === void 0 ? void 0 : config.preemptiveColumnStateRefresh) {
1936
1946
  this.deriveAdaptableColumnStateFromAgGrid();
1937
1947
  }
@@ -2491,10 +2501,6 @@ class AdaptableAgGrid {
2491
2501
  }
2492
2502
  }
2493
2503
  }
2494
- isCellEditable(rowNode, column) {
2495
- // 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
2496
- return column === null || column === void 0 ? void 0 : column.isCellEditable(rowNode);
2497
- }
2498
2504
  forAllRowNodesDo(func, config) {
2499
2505
  this.agGridAdapter.getAgGridApi().forEachNode((rowNode, rowIndex) => {
2500
2506
  const includeGroupRows = (config === null || config === void 0 ? void 0 : config.includeGroupRows) || !this.isGroupRowNode(rowNode);
@@ -2695,6 +2701,10 @@ class AdaptableAgGrid {
2695
2701
  return this.agGridAdapter.getAgGridApi().getChartModels();
2696
2702
  }
2697
2703
  getRowCount() {
2704
+ const allNodes = this.getAllRowNodes({ includeGroupRows: false });
2705
+ return allNodes.length;
2706
+ }
2707
+ getVisibleRowCount() {
2698
2708
  return this.agGridAdapter.getAgGridApi().getDisplayedRowCount();
2699
2709
  }
2700
2710
  getColumnCount() {
@@ -3220,7 +3230,7 @@ class AdaptableAgGrid {
3220
3230
  rawValue = dateRawValue;
3221
3231
  }
3222
3232
  }
3223
- return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
3233
+ return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId, GeneralConstants.VISUAL_DATA_REPORT);
3224
3234
  }
3225
3235
  processCellForExcelExport(rowNode, columnId) {
3226
3236
  if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
@@ -3231,7 +3241,7 @@ class AdaptableAgGrid {
3231
3241
  return isoFormattedDate;
3232
3242
  }
3233
3243
  }
3234
- return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId);
3244
+ return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId, GeneralConstants.VISUAL_DATA_REPORT);
3235
3245
  }
3236
3246
  isQuickFilterAvailable() {
3237
3247
  if (this.api.layoutApi.isCurrentLayoutPivot() &&
@@ -3437,7 +3447,11 @@ class AdaptableAgGrid {
3437
3447
  });
3438
3448
  perfApplyColumnState.end();
3439
3449
  this.api.gridApi.setColumnSorts(layout.ColumnSorts);
3440
- this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
3450
+ if (shouldUpdatePivoted) {
3451
+ // simply setting PivotColumns fires an AG Grid 'modelChanged' event which cascades to a full row reload in SSRM
3452
+ // this includes the case when we simply set an empty array of pivot columns
3453
+ this.agGridAdapter.getAgGridApi().setPivotColumns(layout.PivotColumns || []);
3454
+ }
3441
3455
  // 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
3442
3456
  // the group column is not possitioned correctly at the start of the layout
3443
3457
  // 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
  }
@@ -591,6 +591,18 @@ class AgGridAdapter {
591
591
  };
592
592
  colDefs.forEach((colDef) => applyPatch(colDef));
593
593
  }
594
+ traverseColDefs(colDefs, modifyFn) {
595
+ const applyModification = (colDef) => {
596
+ if ('children' in colDef) {
597
+ const updatedChildren = colDef.children.map(applyModification).filter(Boolean);
598
+ return Object.assign(Object.assign({}, colDef), { children: updatedChildren });
599
+ }
600
+ else {
601
+ return modifyFn(colDef);
602
+ }
603
+ };
604
+ return colDefs.map(applyModification).filter(Boolean);
605
+ }
594
606
  getDefaultColumnDefinition() {
595
607
  var _a, _b;
596
608
  // 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.
@@ -143,6 +143,7 @@ class AgGridColumnAdapter {
143
143
  const isQuickSearchActive = hasQuickSearchStyleClassName && this.isQuickSearchActive(gridCell, params);
144
144
  const editableClassName = this.getEditableCellClass(gridCell, params);
145
145
  const readonlyClassName = this.getReadonlyCellClass(gridCell, params);
146
+ const editedClassName = this.getEditedCellClass(gridCell, params);
146
147
  const highlightAlertClassName = this.getAlertCellClass(gridCell, params);
147
148
  const flashingClassName = this.getFlashingCellClass(gridCell, params);
148
149
  const styledColumn = this.adaptableApi.styledColumnApi.getStyledColumnForColumnId(colId);
@@ -157,6 +158,7 @@ class AgGridColumnAdapter {
157
158
  isQuickSearchActive ? quickSearchStyleClassName : null,
158
159
  editableClassName,
159
160
  readonlyClassName,
161
+ editedClassName,
160
162
  highlightAlertClassName,
161
163
  flashingClassName,
162
164
  noteClassName,
@@ -179,7 +181,7 @@ class AgGridColumnAdapter {
179
181
  const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, abColumn.columnId);
180
182
  const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(gridCell, params);
181
183
  const userDefined = typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle;
182
- 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));
184
+ 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));
183
185
  return (0, StyleHelper_1.normalizeStyleForAgGrid)(result);
184
186
  };
185
187
  return cellStyle;
@@ -429,19 +431,9 @@ class AgGridColumnAdapter {
429
431
  if (typeof userValue === 'boolean' && userValue === false) {
430
432
  return userValue;
431
433
  }
432
- const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
433
434
  const editableCallback = (params) => {
434
- // Adaptable Row Summarie rows are not editable
435
- // if (params.node.data[ROW_SUMMARY_ROW_ID]) {
436
- if (this.adaptableApi.gridApi.isSummaryNode(params.node)) {
437
- return false;
438
- }
439
- if (!cellEditableFn) {
440
- return typeof userValue === 'function' ? userValue(params) : userValue;
441
- }
442
435
  const gridCell = this.adaptableInstance.getGridCellFromRowNode(params.node, params.column.getColId());
443
- const cellEditableContext = Object.assign({ gridCell }, this.adaptableApi.internalApi.buildBaseContext());
444
- return cellEditableFn(cellEditableContext);
436
+ return this.adaptableApi.gridApi.isCellEditable(gridCell);
445
437
  };
446
438
  return editableCallback;
447
439
  });
@@ -591,6 +583,14 @@ class AgGridColumnAdapter {
591
583
  const isCellReadonly = !this.adaptableApi.gridApi.isCellEditable(gridCell);
592
584
  return isCellReadonly ? readonlyCellStyle.ClassName : null;
593
585
  }
586
+ getEditedCellClass(gridCell, params) {
587
+ const editedCellStyle = this.adaptableApi.userInterfaceApi.getEditedCellStyle();
588
+ if (!(editedCellStyle === null || editedCellStyle === void 0 ? void 0 : editedCellStyle.ClassName)) {
589
+ return null;
590
+ }
591
+ const isCellEdited = this.adaptableApi.gridApi.isCellEdited(gridCell);
592
+ return isCellEdited ? editedCellStyle.ClassName : null;
593
+ }
594
594
  getAlertCellClass(gridCell, params) {
595
595
  var _a, _b;
596
596
  const alert = this.adaptableApi.alertApi.internalApi.getAdaptableAlertWithHighlightCell(gridCell.column.columnId, params.node);
@@ -691,6 +691,18 @@ class AgGridColumnAdapter {
691
691
  }
692
692
  return undefined;
693
693
  }
694
+ getEditedCellStyle(gridCell, params) {
695
+ const editedCellStyle = this.adaptableApi.userInterfaceApi.getEditedCellStyle();
696
+ if (!editedCellStyle) {
697
+ return undefined;
698
+ }
699
+ if (gridCell) {
700
+ if (this.adaptableApi.gridApi.isCellEdited(gridCell)) {
701
+ return (0, StyleHelper_1.convertAdaptableStyleToCSS)(editedCellStyle);
702
+ }
703
+ }
704
+ return undefined;
705
+ }
694
706
  /**
695
707
  * The combination of styled column and format cells
696
708
  * This functiond decides when the two can be merged.
@@ -701,7 +713,7 @@ class AgGridColumnAdapter {
701
713
  if (styledColumn && !(styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended)) {
702
714
  const styledCellStyle = this.getStyledColumnStyle(styledColumn, gridCell.column, params);
703
715
  // for percentbar we want to merge
704
- if (styledColumn.PercentBarStyle || styledColumn.BadgeStyle) {
716
+ if (styledColumn.PercentBarStyle || styledColumn.BadgeStyle || styledColumn.GradientStyle) {
705
717
  styledColumnStyle = styledCellStyle;
706
718
  }
707
719
  else {
@@ -710,6 +722,7 @@ class AgGridColumnAdapter {
710
722
  }
711
723
  }
712
724
  const activeFormatColumnsWithStyle = this.adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithStyleForColumn(gridCell.column);
725
+ // background color of styledColumn.GradientStyle has precedence and wins over FormatColumn
713
726
  return Object.assign(Object.assign({}, this.getFormatColumnCellStyle(gridCell.column, activeFormatColumnsWithStyle, params)), styledColumnStyle);
714
727
  }
715
728
  getStyledColumnStyle(styledColumn, abColumn, params) {
@@ -67,7 +67,7 @@ const getPercentBarRendererForColumn = (styledColumn, abColumn, api) => {
67
67
  textEl.innerText = (_b = (_a = params.formatValue) === null || _a === void 0 ? void 0 : _a.call(params, params.value)) !== null && _b !== void 0 ? _b : params.value;
68
68
  }
69
69
  if (percentBarStyle.CellText.includes('PercentageValue')) {
70
- textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
70
+ textEl.innerText += ' ' + `${percentageValue.toFixed(0)}%`;
71
71
  }
72
72
  switch (percentBarStyle.CellTextPosition) {
73
73
  case 'Above':
@@ -288,6 +288,7 @@ const DefaultAdaptableOptions = {
288
288
  colorPalette: UIHelper_1.default.getDefaultColors(),
289
289
  editableCellStyle: undefined,
290
290
  readOnlyCellStyle: undefined,
291
+ editedCellStyle: undefined,
291
292
  styleClassNames: GeneralConstants_1.EMPTY_ARRAY,
292
293
  permittedValues: undefined,
293
294
  editLookUpItems: undefined,
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  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: 1724773418300 || Date.now(),
6
- VERSION: "19.0.0" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1728328943635 || Date.now(),
6
+ VERSION: "19.0.2" || '--current-version--',
7
7
  };