@adaptabletools/adaptable 24.0.2 → 24.0.4

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 (117) hide show
  1. package/devtools.d.ts +506 -5
  2. package/devtools.js +11 -1
  3. package/index.css +15 -5
  4. package/package.json +1 -1
  5. package/src/AdaptableInterfaces/IAdaptable.d.ts +13 -1
  6. package/src/AdaptableOptions/DataImportOptions.d.ts +1 -1
  7. package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
  8. package/src/AdaptableState/Common/AdaptableFormat.d.ts +2 -10
  9. package/src/AdaptableState/Common/RowSummary.d.ts +2 -0
  10. package/src/AdaptableState/LayoutState.d.ts +1 -1
  11. package/src/Api/AdaptableApi.d.ts +12 -0
  12. package/src/Api/GridApi.d.ts +13 -3
  13. package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
  14. package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
  15. package/src/Api/Implementation/AlertApiImpl.js +2 -0
  16. package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
  17. package/src/Api/Implementation/GridApiImpl.js +1 -1
  18. package/src/Api/Internal/AlertInternalApi.d.ts +7 -0
  19. package/src/Api/Internal/AlertInternalApi.js +42 -9
  20. package/src/Api/Internal/CalculatedColumnInternalApi.js +25 -3
  21. package/src/Api/Internal/ExportInternalApi.d.ts +2 -0
  22. package/src/Api/Internal/ExportInternalApi.js +39 -3
  23. package/src/Api/Internal/LayoutInternalApi.d.ts +11 -1
  24. package/src/Api/Internal/LayoutInternalApi.js +34 -3
  25. package/src/Api/Internal/NoteInternalApi.d.ts +12 -0
  26. package/src/Api/Internal/NoteInternalApi.js +11 -0
  27. package/src/EnvVars.d.ts +1 -0
  28. package/src/EnvVars.js +1 -0
  29. package/src/Redux/Store/AdaptableStore.js +4 -7
  30. package/src/Strategy/FlashingCellModule.js +4 -1
  31. package/src/Utilities/Helpers/CellValueHelper.d.ts +20 -0
  32. package/src/Utilities/Helpers/CellValueHelper.js +35 -0
  33. package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +26 -1
  34. package/src/Utilities/Services/CalculatedColumnExpressionService.js +175 -42
  35. package/src/Utilities/Services/DataService.js +10 -6
  36. package/src/Utilities/Services/FlashingCellService.d.ts +12 -0
  37. package/src/Utilities/Services/FlashingCellService.js +40 -3
  38. package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +12 -0
  39. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +22 -1
  40. package/src/Utilities/Services/QueryLanguageService.d.ts +17 -1
  41. package/src/Utilities/Services/QueryLanguageService.js +75 -2
  42. package/src/Utilities/Services/RowSummaryService.d.ts +2 -0
  43. package/src/Utilities/Services/RowSummaryService.js +6 -1
  44. package/src/Utilities/license/instanceLicense.d.ts +12 -0
  45. package/src/Utilities/license/instanceLicense.js +10 -0
  46. package/src/Utilities/license/licenseStatus.d.ts +26 -0
  47. package/src/Utilities/license/licenseStatus.js +72 -0
  48. package/src/View/Components/CellPopup/index.js +15 -10
  49. package/src/View/GridInfo/GridInfoPopup.js +6 -1
  50. package/src/View/Layout/TransposedPopup.js +1 -0
  51. package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +3 -5
  52. package/src/View/Layout/Wizard/sections/AggregationsSection.js +10 -24
  53. package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -1
  54. package/src/View/ObjectItemViews/Layout/aggregationSummaryHelpers.d.ts +5 -1
  55. package/src/View/ObjectItemViews/Layout/aggregationSummaryHelpers.js +6 -3
  56. package/src/agGrid/AdaptableAgGrid.d.ts +87 -17
  57. package/src/agGrid/AdaptableAgGrid.js +586 -168
  58. package/src/agGrid/AdaptableFilterHandler.d.ts +2 -0
  59. package/src/agGrid/AdaptableFilterHandler.js +34 -0
  60. package/src/agGrid/AgGridAdapter.d.ts +19 -1
  61. package/src/agGrid/AgGridAdapter.js +39 -12
  62. package/src/agGrid/AgGridColumnAdapter.d.ts +2 -0
  63. package/src/agGrid/AgGridColumnAdapter.js +124 -78
  64. package/src/agGrid/AgGridExportAdapter.d.ts +5 -0
  65. package/src/agGrid/AgGridExportAdapter.js +31 -0
  66. package/src/agGrid/AgGridMenuAdapter.js +1 -1
  67. package/src/agGrid/applyGlobalGridOptions.d.ts +9 -0
  68. package/src/agGrid/applyGlobalGridOptions.js +36 -0
  69. package/src/agGrid/cellRenderers/BadgeRenderer.js +22 -0
  70. package/src/agGrid/columnMinMaxCache.d.ts +33 -0
  71. package/src/agGrid/columnMinMaxCache.js +50 -0
  72. package/src/devTools/PerfStore.d.ts +218 -0
  73. package/src/devTools/PerfStore.js +717 -0
  74. package/src/devTools/index.d.ts +33 -0
  75. package/src/devTools/index.js +132 -56
  76. package/src/devTools/logBuffer.d.ts +17 -0
  77. package/src/devTools/logBuffer.js +33 -0
  78. package/src/devTools/memoryInfo.d.ts +15 -0
  79. package/src/devTools/memoryInfo.js +229 -0
  80. package/src/devTools/memoryRoots.d.ts +41 -0
  81. package/src/devTools/memoryRoots.js +136 -0
  82. package/src/devTools/perfContext.d.ts +5 -0
  83. package/src/devTools/perfContext.js +155 -0
  84. package/src/devTools/perfInstrumentation.d.ts +13 -0
  85. package/src/devTools/perfInstrumentation.js +78 -0
  86. package/src/env.js +2 -2
  87. package/src/layout-manager/src/LayoutManagerModel.d.ts +3 -1
  88. package/src/layout-manager/src/expandAllRowGroups.d.ts +6 -0
  89. package/src/layout-manager/src/expandAllRowGroups.js +13 -0
  90. package/src/layout-manager/src/index.js +18 -10
  91. package/src/setupDevTools.js +560 -106
  92. package/tsconfig.esm.tsbuildinfo +1 -1
  93. package/vendor/components/Combobox/index.js +1 -1
  94. package/vendor/components/Combobox/index.js.map +1 -1
  95. package/vendor/components/Radio/index.d.ts.map +1 -1
  96. package/vendor/components/Radio/index.js +1 -1
  97. package/vendor/components/Radio/index.js.map +1 -1
  98. package/vendor/components/Resizable/index.d.ts +14 -9
  99. package/vendor/components/Resizable/index.d.ts.map +1 -1
  100. package/vendor/components/Resizable/index.js +23 -0
  101. package/vendor/components/Resizable/index.js.map +1 -1
  102. package/vendor/components/Resizable/resizableUtils.d.ts +24 -13
  103. package/vendor/components/Resizable/resizableUtils.d.ts.map +1 -1
  104. package/vendor/components/Resizable/resizableUtils.js +13 -3
  105. package/vendor/components/Resizable/resizableUtils.js.map +1 -1
  106. package/vendor/components/index.css +12 -5
  107. package/vendor/components/ui/combobox.js +1 -1
  108. package/vendor/components/ui/combobox.js.map +1 -1
  109. package/vendor/components/ui/input.js +1 -1
  110. package/vendor/components/ui/input.js.map +1 -1
  111. package/vendor/components/ui/select.js +1 -1
  112. package/vendor/components/ui/select.js.map +1 -1
  113. package/vendor/components/ui/textarea.js +1 -1
  114. package/vendor/components/ui/textarea.js.map +1 -1
  115. package/vendor/components/ui/tooltip.d.ts.map +1 -1
  116. package/vendor/components/ui/tooltip.js +3 -1
  117. package/vendor/components/ui/tooltip.js.map +1 -1
@@ -73,7 +73,7 @@ export interface DataImportValidationError {
73
73
  */
74
74
  columnId: string;
75
75
  /**
76
- * The validatoin error text
76
+ * The validation error text
77
77
  */
78
78
  error: string;
79
79
  }
@@ -345,11 +345,11 @@ export interface ProcessExportContext extends BaseExportContext {
345
345
  */
346
346
  getReportColumns: () => ReportColumn[];
347
347
  /**
348
- * Converts the Report Data to Excel format
348
+ * Converts the Report Data to Excel format, using `excelSheetName`, `skipColumnHeaders` and AG Grid's `defaultExcelExportParams`
349
349
  */
350
350
  convertToExcel: (reportData: ReportData) => Blob;
351
351
  /**
352
- * Converts the Report Data to CSV format
352
+ * Converts the Report Data to CSV format, using `csvSeparator`, `skipColumnHeaders` and AG Grid's `defaultCsvExportParams`
353
353
  */
354
354
  convertToCsv: (reportData: ReportData) => string;
355
355
  }
@@ -77,10 +77,7 @@ export interface NumberFormatterOptions extends BaseFormatterOptions {
77
77
  */
78
78
  Multiplier?: number;
79
79
  /**
80
- * When the numeric value is zero (after multiplier and rounding):
81
- * - omitted / undefined, or `'0'` — use normal formatting (e.g. `0`, `0.00`)
82
- * - `''` — show a blank cell (user cleared the default `0` in the wizard)
83
- * - any other string — show that text (e.g. `-`, `—`)
80
+ * What to show when numeric value is zero (after multiplier & rounding)
84
81
  */
85
82
  ZeroDisplay?: string;
86
83
  /**
@@ -112,12 +109,7 @@ export interface NumberFormatterOptions extends BaseFormatterOptions {
112
109
  */
113
110
  Empty?: boolean;
114
111
  /**
115
- * Numeric notation to use when rendering the value.
116
- *
117
- * - `'standard'` (default) — renders the number normally.
118
- * - `'scientific'` — renders the number in scientific notation
119
- * (e.g. `1.23e+5`). When set, `IntegerSeparator` is ignored
120
- * and `FractionDigits` controls the number of mantissa digits.
112
+ * Numeric notation to use when rendering the value - standard or scientific
121
113
  */
122
114
  Notation?: 'standard' | 'scientific';
123
115
  }
@@ -21,6 +21,8 @@ export type RowSummaryPosition = 'Top' | 'Bottom';
21
21
  * A pinned row of column summaries in a table layout.
22
22
  *
23
23
  * `ColumnsMap` is required: each key is a column id and each value is a summary name such as `'SUM'` or `'AVG'`. `Position` is `'Top'` or `'Bottom'`; omit it to pin the row to the bottom. `IncludeOnlyFilteredRows` defaults to true, so the summary uses the rows that pass the current filter. Suspend with `IsSuspended`. Requires AG Grid `PinnedRowModule`.
24
+ *
25
+ * Row Summaries are not displayed while the Layout's `GrandTotalRow` is `'pinnedTop'` or `'pinnedBottom'`, or when AG Grid `enableRowPinning` is set.
24
26
  */
25
27
  export interface RowSummary extends SuspendableObject {
26
28
  /**
@@ -196,7 +196,7 @@ export interface PivotLayout extends LayoutBase {
196
196
  */
197
197
  PivotColumnTotal?: PivotTotalPosition;
198
198
  /**
199
- * Ordered list of Pivot Result Columns; set to `true` to track current display order, or provide custom list
199
+ * Ordered list of Pivot Result Columns; set to `true` to track current display order, or provide custom list (with the Server-Side Row Model it is replaced by the order in which the datasource supplies the columns)
200
200
  */
201
201
  PivotResultColumnsOrder?: string[] | boolean;
202
202
  }
@@ -246,6 +246,18 @@ export interface AdaptableApi {
246
246
  * User Interface: custom icons, editable and read-only cell styles, object tags, the progress indicator, custom windows, and showing or hiding the AdapTable UI.
247
247
  */
248
248
  userInterfaceApi: UserInterfaceApi;
249
+ /**
250
+ * Whether AdapTable has finished initialising and is ready to use.
251
+ *
252
+ * Returns `true` once AG Grid has been created, Adaptable State has been applied to it (columns, theme, filters, sorts, Quick Search and the current Layout) and the AdapTable UI has been rendered. It is already `true` when plugins run `onAdaptableReady` and when the `AdaptableReady` event fires.
253
+ *
254
+ * Returns `false` while AdapTable is still initialising, and after it has been destroyed (see `isDestroyed`).
255
+ *
256
+ * To run code as soon as AdapTable is ready, subscribe to the `AdaptableReady` event instead of polling this method; a listener added after the event has fired is still called.
257
+ *
258
+ * @returns `true` if AdapTable is fully initialised and has not been destroyed, otherwise `false`
259
+ */
260
+ isReady: () => boolean;
249
261
  /**
250
262
  * Cleanup method - call only for vanilla JavaScript components, as framework components handle cleanup on destroy/unmount. By default, it unmounts the Adaptable component and destroys the AG Grid instance.
251
263
  * @param config - optional configuration object
@@ -92,14 +92,19 @@ export interface GridApi {
92
92
  loadGridData(data: any): void;
93
93
  /**
94
94
  * Updates AdapTable (and AG Grid) with rows that have changed
95
- * @param dataRows rows which have been updated - send whole row and AdapTable take cares of the rest
95
+ *
96
+ * Each row is compared with the row it replaces, whether rendered or not, and every changed cell
97
+ * fires a Cell Changed Event. Filters are re-applied once per call, not once per row.
98
+ * @param dataRows rows which have been updated - send whole row, as a new object; changes made in place to a row's current data cannot be detected
96
99
  * @param config batch option and callback function to run post update
97
100
  * @returns The row nodes that were updated
98
101
  */
99
102
  updateGridData(dataRows: any[], config?: DataUpdateConfig): Promise<IRowNode[]>;
100
103
  /**
101
104
  * Adds or Updates AdapTable (and AG Grid) with new and changed rows
102
- * @param dataRows rows to add or update
105
+ *
106
+ * Rows whose Primary Key value is in the grid are updated, and reported as in `updateGridData`.
107
+ * @param dataRows rows to add or update; an updated row must be a new object, not the row's current data changed in place
103
108
  * @param config batch option and callback function to run post change
104
109
  * @returns The row nodes that were added and the row nodes that were updated
105
110
  */
@@ -123,7 +128,9 @@ export interface GridApi {
123
128
  deleteGridData(dataRows: any[], config?: DataUpdateConfig): Promise<IRowNode[]>;
124
129
  /**
125
130
  * Adds, Updates or Deletes rows in AdapTable (and AG Grid) in single transaction
126
- * @param dataRowConfig - Rows to add, update or remove
131
+ *
132
+ * Updated rows are reported as in `updateGridData`.
133
+ * @param dataRowConfig - Rows to add, update or remove; an updated row must be a new object, not the row's current data changed in place
127
134
  * @param dataUpdateConfig - batch option and callback function to run post transaction
128
135
  * @returns The row nodes that were added, updated and removed
129
136
  */
@@ -140,6 +147,9 @@ export interface GridApi {
140
147
  setCellValue(cellUpdateRequest: CellUpdateRequest): void;
141
148
  /**
142
149
  * Updates multiple cells
150
+ *
151
+ * Filters are re-applied once per call, not once per cell, and the Alerts the edits fire are
152
+ * consolidated (see `AlertOptions.consolidateBatchAlerts`).
143
153
  * @param cellUpdateRequests Cells to write, each with a column, row and new value
144
154
  */
145
155
  setCellValues(cellUpdateRequests: CellUpdateRequest[]): void;
@@ -98,6 +98,7 @@ export declare class AdaptableApiImpl implements AdaptableApi {
98
98
  * This is only meant to be called by the Adaptable instance.
99
99
  */
100
100
  _internalDestroySelf(): void;
101
+ isReady(): boolean;
101
102
  destroy(config?: DestroyConfig): void;
102
103
  isDestroyed(): boolean;
103
104
  logConsoleMessage(message: string, ...optionalParams: any[]): void;
@@ -214,6 +214,9 @@ export class AdaptableApiImpl {
214
214
  this.noteApi = null;
215
215
  this.styledColumnApi = null;
216
216
  }
217
+ isReady() {
218
+ return this.adaptable?.isReady ?? false;
219
+ }
217
220
  destroy(config) {
218
221
  this.adaptable.destroy(config);
219
222
  }
@@ -1,4 +1,5 @@
1
1
  import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
2
+ import { getPerfRecorder } from '../../devTools/PerfStore';
2
3
  import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
3
4
  import * as AlertRedux from '../../Redux/ActionsReducers/AlertRedux';
4
5
  import { ApiBase } from './ApiBase';
@@ -45,6 +46,7 @@ export class AlertApiImpl extends ApiBase {
45
46
  batchedAlerts = [];
46
47
  async displayAdaptableAlert(alertToShow) {
47
48
  this.addUidToAdaptableObject(alertToShow);
49
+ getPerfRecorder(this.getAdaptableApi().optionsApi.getAdaptableId())?.count('alertsFired');
48
50
  this.getEventApi().internalApi.fireAlertFiredEvent(alertToShow);
49
51
  this.applyPerChangeAlertEffects(alertToShow);
50
52
  if (this.canConsolidateAlert(alertToShow)) {
@@ -33,16 +33,11 @@ export class FlashingCellApiImpl extends ApiBase {
33
33
  }
34
34
  showFlashingCell(flashingCellToShow) {
35
35
  this.addUidToAdaptableObject(flashingCellToShow);
36
- this.getAdaptableApi()
37
- .internalApi.getFlashingCellService()
38
- .addGridCellFlash(flashingCellToShow);
36
+ const flashingCellService = this.getAdaptableApi().internalApi.getFlashingCellService();
37
+ flashingCellService.addGridCellFlash(flashingCellToShow);
39
38
  const { FlashDuration: FlashDuration } = flashingCellToShow.flashingCellDefinition;
40
39
  if (FlashDuration && FlashDuration !== 'always') {
41
- setTimeout(() => {
42
- this.getAdaptableApi()
43
- .internalApi.getFlashingCellService()
44
- .clearGridCellFlash(flashingCellToShow);
45
- }, FlashDuration);
40
+ flashingCellService.scheduleGridCellFlashClear(flashingCellToShow, FlashDuration);
46
41
  }
47
42
  this.getEventApi().internalApi.fireFlashingCellDisplayedEvent(flashingCellToShow);
48
43
  }
@@ -164,7 +164,7 @@ export class GridApiImpl extends ApiBase {
164
164
  const dataService = this.getAdaptableInternalApi().getDataService();
165
165
  dataService.startDataChangeBatch();
166
166
  try {
167
- cellUpdateRequests?.forEach((cellUpdateRequest) => this.setCellValue(cellUpdateRequest));
167
+ this._adaptable.runPostEditBatch(() => cellUpdateRequests?.forEach((cellUpdateRequest) => this.setCellValue(cellUpdateRequest)));
168
168
  }
169
169
  finally {
170
170
  dataService.endDataChangeBatch();
@@ -12,6 +12,7 @@ import { RowDataChangedInfo } from '../../types';
12
12
  export type AlertRuleClass = 'cellChange' | 'aggregated' | 'live';
13
13
  export declare class AlertInternalApi extends ApiBase {
14
14
  private aggregationAlertBindings;
15
+ private alertDefinitionListsCache;
15
16
  destroy(): void;
16
17
  private releaseAggregationAlertHandles;
17
18
  private pruneAggregationAlertBindings;
@@ -39,6 +40,12 @@ export declare class AlertInternalApi extends ApiBase {
39
40
  * @param name name of the Form
40
41
  */
41
42
  getAdaptableFormByName(name: string): AdaptableForm<AlertFormContext> | undefined;
43
+ /**
44
+ * The lists of Alert Definitions by how their Rule is run, built once and reused until the
45
+ * definitions, the Layout (extensions or current Layout) or the expression functions change.
46
+ * Callers must not change the arrays.
47
+ */
48
+ private getAlertDefinitionLists;
42
49
  /**
43
50
  * Definitions with a Rule of their own — Scheduled and (current-shape) Row
44
51
  * Change Alerts excluded.
@@ -12,8 +12,10 @@ import { errorOnce } from '../../agGrid/AdaptableLogger';
12
12
  const isRowDataChangedInfo = (value) => typeof value.rowTrigger === 'string';
13
13
  export class AlertInternalApi extends ApiBase {
14
14
  aggregationAlertBindings = new Map();
15
+ alertDefinitionListsCache;
15
16
  destroy() {
16
17
  this.releaseAggregationAlertHandles();
18
+ this.alertDefinitionListsCache = undefined;
17
19
  super.destroy();
18
20
  }
19
21
  releaseAggregationAlertHandles() {
@@ -52,10 +54,36 @@ export class AlertInternalApi extends ApiBase {
52
54
  const alertForms = this.getAlertOptions().alertForms || [];
53
55
  return alertForms.find((f) => f.name === name)?.form;
54
56
  }
57
+ getAlertDefinitionLists() {
58
+ const state = this.getAdaptableState();
59
+ const alertDefinitions = state.Alert?.AlertDefinitions;
60
+ const layoutExtensions = state.Layout?.LayoutExtensions;
61
+ const layoutName = this.getLayoutApi().getCurrentLayoutName();
62
+ const functionsGeneration = this.getAdaptableInternalApi()
63
+ .getQueryLanguageService()
64
+ .getFunctionsGeneration();
65
+ const cached = this.alertDefinitionListsCache;
66
+ if (cached &&
67
+ cached.alertDefinitions === alertDefinitions &&
68
+ cached.layoutExtensions === layoutExtensions &&
69
+ cached.layoutName === layoutName &&
70
+ cached.functionsGeneration === functionsGeneration) {
71
+ return cached;
72
+ }
73
+ const lists = {
74
+ alertDefinitions,
75
+ layoutExtensions,
76
+ layoutName,
77
+ functionsGeneration,
78
+ rule: this.getAlertApi()
79
+ .getAlertDefinitions()
80
+ .filter((alertDef) => isRuleBasedAlertDefinition(alertDef) && !isRowChangeAlertDefinition(alertDef)),
81
+ };
82
+ this.alertDefinitionListsCache = lists;
83
+ return lists;
84
+ }
55
85
  getRuleAlertDefinitions() {
56
- return this.getAlertApi()
57
- .getAlertDefinitions()
58
- .filter((alertDef) => isRuleBasedAlertDefinition(alertDef) && !isRowChangeAlertDefinition(alertDef));
86
+ return this.getAlertDefinitionLists().rule;
59
87
  }
60
88
  classifyRule(alertDefinition) {
61
89
  const rule = this.resolveAlertRule(alertDefinition);
@@ -68,19 +96,23 @@ export class AlertInternalApi extends ApiBase {
68
96
  return dependencies && (dependencies.observable || dependencies.time) ? 'live' : 'cellChange';
69
97
  }
70
98
  getDataChangeAlertDefinitions() {
71
- return this.getRuleAlertDefinitions().filter((alertDef) => {
99
+ const lists = this.getAlertDefinitionLists();
100
+ return (lists.dataChange ??= lists.rule.filter((alertDef) => {
72
101
  const ruleClass = this.classifyRule(alertDef);
73
102
  return ruleClass === 'cellChange' || ruleClass === 'aggregated';
74
- });
103
+ }));
75
104
  }
76
105
  getActiveDataChangeAlertDefinitions() {
77
- return this.getDataChangeAlertDefinitions().filter((alertDef) => !alertDef.IsSuspended);
106
+ const lists = this.getAlertDefinitionLists();
107
+ return (lists.activeDataChange ??= this.getDataChangeAlertDefinitions().filter((alertDef) => !alertDef.IsSuspended));
78
108
  }
79
109
  getLiveAlertDefinitions() {
80
- return this.getRuleAlertDefinitions().filter((alertDef) => this.classifyRule(alertDef) === 'live');
110
+ const lists = this.getAlertDefinitionLists();
111
+ return (lists.live ??= lists.rule.filter((alertDef) => this.classifyRule(alertDef) === 'live'));
81
112
  }
82
113
  getActiveLiveAlertDefinitions() {
83
- return this.getLiveAlertDefinitions().filter((alertDef) => !alertDef.IsSuspended);
114
+ const lists = this.getAlertDefinitionLists();
115
+ return (lists.activeLive ??= this.getLiveAlertDefinitions().filter((alertDef) => !alertDef.IsSuspended));
84
116
  }
85
117
  setUpLiveAlerts() {
86
118
  this.getAdaptableInternalApi().getAlertLiveBindingService().syncFromState();
@@ -148,7 +180,8 @@ export class AlertInternalApi extends ApiBase {
148
180
  });
149
181
  }
150
182
  getAlertDefinitionsWithPreventEdit() {
151
- return this.getActiveDataChangeAlertDefinitions().filter((a) => a.AlertProperties != null && a.AlertProperties.PreventEdit === true);
183
+ const lists = this.getAlertDefinitionLists();
184
+ return (lists.preventEdit ??= this.getActiveDataChangeAlertDefinitions().filter((a) => a.AlertProperties != null && a.AlertProperties.PreventEdit === true));
152
185
  }
153
186
  getAlertDefinitionsWithAllowEdit() {
154
187
  return this.getActiveDataChangeAlertDefinitions().filter((a) => a.AlertProperties == null || a.AlertProperties.PreventEdit !== true);
@@ -1,4 +1,5 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
+ import { getPerfRecorder } from '../../devTools/PerfStore';
2
3
  import { expressionContainsAstNodeType, getCalculatedColumnType, isPerRowCalculatedColumnType, supportsCompactExpressionEditor, } from '../../AdaptableState/CalculatedColumnState';
3
4
  import { CreateEmptyCalculatedColumn, CreateInternalAlertDefinitionForMessages, } from '../../Utilities/ObjectFactory';
4
5
  import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
@@ -186,6 +187,15 @@ export class CalculatedColumnInternalApi extends ApiBase {
186
187
  columnTypes.push(...calculatedColumnSettings.ColumnTypes);
187
188
  }
188
189
  const isExternalEvaluation = !this.getExpressionApi().internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', calculatedColumn, calculatedColumn.Expression);
190
+ const adaptableId = this.getAdaptableApi().optionsApi.getAdaptableId();
191
+ const perfKey = `calculatedColumn:${calculatedColumn.ColumnId}`;
192
+ const describePerf = () => ({
193
+ module: 'CalculatedColumn',
194
+ objectId: calculatedColumn.Uuid,
195
+ objectName: calculatedColumn.FriendlyName || calculatedColumn.ColumnId,
196
+ columnId: calculatedColumn.ColumnId,
197
+ expression: calculatedColumn.Expression,
198
+ });
189
199
  const valueGetter = (params) => {
190
200
  if (isExternalEvaluation) {
191
201
  return params.data?.[calculatedColumn.ColumnId];
@@ -193,9 +203,21 @@ export class CalculatedColumnInternalApi extends ApiBase {
193
203
  if (this.getGridApi().getAgGridRowModelType() !== 'clientSide' && isAggregated) {
194
204
  return params.data?.[calculatedColumn.ColumnId];
195
205
  }
196
- return this.getAdaptableInternalApi()
197
- .getCalculatedColumnExpressionService()
198
- .evaluateCalculatedColumnQuery(calculatedColumn, params.node);
206
+ const recorder = getPerfRecorder(adaptableId);
207
+ if (!recorder) {
208
+ return this.getAdaptableInternalApi()
209
+ .getCalculatedColumnExpressionService()
210
+ .evaluateCalculatedColumnQuery(calculatedColumn, params.node);
211
+ }
212
+ const start = performance.now();
213
+ try {
214
+ return this.getAdaptableInternalApi()
215
+ .getCalculatedColumnExpressionService()
216
+ .evaluateCalculatedColumnQuery(calculatedColumn, params.node);
217
+ }
218
+ finally {
219
+ recorder.add('calculatedColumn', perfKey, start, describePerf);
220
+ }
199
221
  };
200
222
  const newColDef = {
201
223
  headerName: calculatedColumn.FriendlyName
@@ -36,5 +36,7 @@ export declare class ExportInternalApi extends ApiBase {
36
36
  private buildExcelConverter;
37
37
  private buildCsvConverter;
38
38
  private executeGridExport;
39
+ private getDefaultExportParams;
40
+ private buildExcelExportParams;
39
41
  private buildCsvExportParams;
40
42
  }
@@ -8,6 +8,21 @@ import { DateFormatter } from '../../Utilities/Helpers/DisplayFormatHelper';
8
8
  import Helper from '../../Utilities/Helpers/Helper';
9
9
  import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
10
10
  import { SystemExportBegin, SystemExportEnd } from '../../Redux/ActionsReducers/InternalRedux';
11
+ const ADAPTABLE_EXPORT_PARAMS = [
12
+ 'columnKeys',
13
+ 'exportedRows',
14
+ 'shouldRowBeSkipped',
15
+ 'skipRowGroups',
16
+ 'rowGroupExpandState',
17
+ 'fileName',
18
+ 'skipColumnHeaders',
19
+ 'getCustomContentBelowRow',
20
+ 'processCellCallback',
21
+ 'processRowGroupCallback',
22
+ 'sheetName',
23
+ 'processNoteCallback',
24
+ 'columnSeparator',
25
+ ];
11
26
  export class ExportInternalApi extends ApiBase {
12
27
  getAllAvailableReportNames() {
13
28
  return this.getExportApi()
@@ -341,7 +356,8 @@ export class ExportInternalApi extends ApiBase {
341
356
  }
342
357
  buildExcelConverter(reportName, reportFormat, exportDestination) {
343
358
  return (reportData) => {
344
- return this.executeGridExport(reportData, reportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsExcel({ ...exportParams }));
359
+ const excelParams = this.buildExcelExportParams(reportName, reportFormat, exportDestination);
360
+ return this.executeGridExport(reportData, reportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsExcel({ ...exportParams, ...excelParams }));
345
361
  };
346
362
  }
347
363
  buildCsvConverter(reportName, reportFormat, exportDestination) {
@@ -366,6 +382,8 @@ export class ExportInternalApi extends ApiBase {
366
382
  theme: this.getAgGridApi().getGridOption('theme'),
367
383
  dataTypeDefinitions: this.getAgGridApi().getGridOption('dataTypeDefinitions'),
368
384
  columnTypes: this.getAgGridApi().getGridOption('columnTypes'),
385
+ defaultExcelExportParams: this.getDefaultExportParams('defaultExcelExportParams'),
386
+ defaultCsvExportParams: this.getDefaultExportParams('defaultCsvExportParams'),
369
387
  };
370
388
  const gridParams = {
371
389
  modules: this.getAdaptableApi()
@@ -395,11 +413,29 @@ export class ExportInternalApi extends ApiBase {
395
413
  }
396
414
  }
397
415
  }
416
+ getDefaultExportParams(propertyName) {
417
+ const defaultExportParams = this.getAgGridApi().getGridOption(propertyName);
418
+ if (!defaultExportParams) {
419
+ return undefined;
420
+ }
421
+ const exportParams = { ...defaultExportParams };
422
+ ADAPTABLE_EXPORT_PARAMS.forEach((key) => delete exportParams[key]);
423
+ return exportParams;
424
+ }
425
+ buildExcelExportParams(reportName, reportFormat, exportDestination) {
426
+ const exportOptions = this.getAdaptableApi().optionsApi.getExportOptions();
427
+ const baseExportContext = this.buildBaseExportContext(reportName, reportFormat, exportDestination);
428
+ return {
429
+ sheetName: resolveValueOrFunction(exportOptions.excelSheetName, baseExportContext),
430
+ skipColumnHeaders: resolveValueOrFunction(exportOptions.skipColumnHeaders, baseExportContext),
431
+ };
432
+ }
398
433
  buildCsvExportParams(reportName, reportFormat, exportDestination) {
399
434
  const exportOptions = this.getAdaptableApi().optionsApi.getExportOptions();
400
- const csvSeparator = resolveValueOrFunction(exportOptions.csvSeparator, this.buildBaseExportContext(reportName, reportFormat, exportDestination));
435
+ const baseExportContext = this.buildBaseExportContext(reportName, reportFormat, exportDestination);
401
436
  return {
402
- columnSeparator: csvSeparator,
437
+ columnSeparator: resolveValueOrFunction(exportOptions.csvSeparator, baseExportContext),
438
+ skipColumnHeaders: resolveValueOrFunction(exportOptions.skipColumnHeaders, baseExportContext),
403
439
  };
404
440
  }
405
441
  }
@@ -2,6 +2,7 @@ import { PivotLayoutCreationDefaultProperties, TableLayoutCreationDefaultPropert
2
2
  import { Layout, LayoutBase } from '../../AdaptableState/LayoutState';
3
3
  import { ApiBase } from '../Implementation/ApiBase';
4
4
  import { LayoutExtension, LayoutExtensionObject, LayoutExtensionModule } from '../../types';
5
+ export type RowSummariesSkippedReason = 'rowPinning' | 'pinnedGrandTotalRow';
5
6
  export declare class LayoutInternalApi extends ApiBase {
6
7
  /**
7
8
  * Compares 2 Layouts for equality
@@ -41,8 +42,17 @@ export declare class LayoutInternalApi extends ApiBase {
41
42
  isLayoutExtensionsUIEnabled(): boolean;
42
43
  showLayoutNonExtendedObjects(): boolean;
43
44
  isLayoutGrouped(layout?: Layout): boolean;
45
+ private lastRowSummariesSkippedWarning;
46
+ /**
47
+ * Row Summaries are rendered as AG Grid pinned row data, which AG Grid does not render
48
+ * when manual row pinning is enabled or the Grand Total Row is pinned.
49
+ * Returns why the Row Summaries of the Layout cannot be displayed, if they cannot.
50
+ */
51
+ getRowSummariesSkippedReason(layout?: Layout): RowSummariesSkippedReason | undefined;
44
52
  setupRowSummaries(): void;
45
- refreshLayout(): void;
53
+ refreshLayout(config?: {
54
+ columnsChanged?: boolean;
55
+ }): void;
46
56
  getChangedColumnSorts(oldSorts: LayoutBase['ColumnSorts'], newSorts: LayoutBase['ColumnSorts']): string[];
47
57
  buildInitialLayout(providedLayout: Partial<Layout> & {
48
58
  Name: string;
@@ -79,12 +79,44 @@ export class LayoutInternalApi extends ApiBase {
79
79
  }
80
80
  return (layout?.RowGroupedColumns?.length || layout?.PivotGroupedColumns?.length) > 0;
81
81
  }
82
+ lastRowSummariesSkippedWarning;
83
+ getRowSummariesSkippedReason(layout) {
84
+ if (!layout) {
85
+ layout = this.getLayoutApi().getCurrentLayout();
86
+ }
87
+ if (this._adaptable.agGridAdapter.getGridOption('enableRowPinning')) {
88
+ return 'rowPinning';
89
+ }
90
+ if (layout?.GrandTotalRow === 'pinnedTop' || layout?.GrandTotalRow === 'pinnedBottom') {
91
+ return 'pinnedGrandTotalRow';
92
+ }
93
+ return undefined;
94
+ }
82
95
  setupRowSummaries() {
83
96
  if (!this.getAdaptableApi().internalApi.getAgGridModulesAdapter().isAgGridModuleRegistered('PinnedRowModule')) {
84
97
  this.getAdaptableApi().consoleError('Layout Row Summaries require the AG Grid "PinnedRowModule". Please register this module.');
85
98
  return;
86
99
  }
87
100
  const rowSummaries = this.getAdaptableState().Internal?.RowSummary?.rowSummaries ?? [];
101
+ const agGridAdapter = this.getAdaptableInternalApi().getAgGridAdapter();
102
+ const skippedReason = this.getRowSummariesSkippedReason();
103
+ let warning;
104
+ if (skippedReason && rowSummaries.length) {
105
+ const layout = this.getLayoutApi().getCurrentLayout();
106
+ const cause = skippedReason === 'rowPinning'
107
+ ? 'AG Grid Row Pinning (enableRowPinning) is enabled'
108
+ : `the Layout pins the Grand Total Row (GrandTotalRow: '${layout.GrandTotalRow}')`;
109
+ warning = `Row Summaries of Layout '${layout.Name}' are not displayed, because ${cause}.`;
110
+ if (warning !== this.lastRowSummariesSkippedWarning) {
111
+ this.getAdaptableApi().consoleWarn(warning);
112
+ }
113
+ }
114
+ this.lastRowSummariesSkippedWarning = warning;
115
+ if (skippedReason) {
116
+ agGridAdapter.setGridOption('pinnedTopRowData', undefined);
117
+ agGridAdapter.setGridOption('pinnedBottomRowData', undefined);
118
+ return;
119
+ }
88
120
  const { top, bottom } = rowSummaries.reduce((acc, summaryRow) => {
89
121
  const row = summaryRow.RowData;
90
122
  if (summaryRow.Position === 'Bottom' || !summaryRow.Position) {
@@ -95,12 +127,11 @@ export class LayoutInternalApi extends ApiBase {
95
127
  }
96
128
  return acc;
97
129
  }, { top: [], bottom: [] });
98
- const agGridAdapter = this.getAdaptableInternalApi().getAgGridAdapter();
99
130
  agGridAdapter.setGridOption('pinnedTopRowData', top);
100
131
  agGridAdapter.setGridOption('pinnedBottomRowData', bottom);
101
132
  }
102
- refreshLayout() {
103
- this._adaptable.refreshLayout();
133
+ refreshLayout(config) {
134
+ this._adaptable.refreshLayout(config);
104
135
  }
105
136
  getChangedColumnSorts(oldSorts, newSorts) {
106
137
  if (ArrayExtensions.IsNullOrEmpty(oldSorts) && ArrayExtensions.IsNullOrEmpty(newSorts)) {
@@ -1,4 +1,6 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
+ import { AdaptableNote } from '../../AdaptableState/NoteState';
3
+ import { AdaptableMessageType } from '../../AdaptableState/Common/AdaptableMessageType';
2
4
  export declare class NoteInternalApi extends ApiBase {
3
5
  areNotesSupported(): boolean;
4
6
  getNotesDateFormat(): string;
@@ -9,4 +11,14 @@ export declare class NoteInternalApi extends ApiBase {
9
11
  * Note State); this is true when the required AG Grid `NotesModule` is registered.
10
12
  */
11
13
  isAgGridNotesActive(): boolean;
14
+ /**
15
+ * Type of the Note, falling back to the configured default Note type (which itself defaults to 'Info'),
16
+ * so untyped notes are treated the same way `addNote` stamps new notes.
17
+ */
18
+ getNoteType(note: AdaptableNote): AdaptableMessageType;
19
+ getDefaultNoteType(): AdaptableMessageType;
20
+ /**
21
+ * Whether any Note in State has a type other than the default Note type
22
+ */
23
+ hasNonDefaultNoteTypes(): boolean;
12
24
  }
@@ -13,4 +13,15 @@ export class NoteInternalApi extends ApiBase {
13
13
  isAgGridNotesActive() {
14
14
  return this.getAdaptableApi().internalApi.getAgGridModulesAdapter().isAgGridModuleRegistered('NotesModule');
15
15
  }
16
+ getNoteType(note) {
17
+ return note.NoteType ?? this.getDefaultNoteType();
18
+ }
19
+ getDefaultNoteType() {
20
+ return this.getNoteOptions()?.defaultNoteType ?? 'Info';
21
+ }
22
+ hasNonDefaultNoteTypes() {
23
+ const notes = this.getAdaptableApi().noteApi.getAllNotes() ?? [];
24
+ const defaultNoteType = this.getDefaultNoteType();
25
+ return notes.some((note) => this.getNoteType(note) !== defaultNoteType);
26
+ }
16
27
  }
package/src/EnvVars.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export declare const ADAPTABLE_VERSION: any;
2
2
  export declare const ADAPTABLE_PUBLISH_TIMESTAMP: any;
3
+ export declare const ADAPTABLE_PUBLISH_DATE: number;
3
4
  export declare const INFINITE_TABLE_LICENSE_KEY: any;
package/src/EnvVars.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import env from './env';
2
2
  export const ADAPTABLE_VERSION = env.VERSION;
3
3
  export const ADAPTABLE_PUBLISH_TIMESTAMP = env.PUBLISH_TIMESTAMP;
4
+ export const ADAPTABLE_PUBLISH_DATE = Number(ADAPTABLE_PUBLISH_TIMESTAMP);
4
5
  export const INFINITE_TABLE_LICENSE_KEY = env.NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY;
@@ -44,7 +44,7 @@ import * as TeamSharingRedux from '../ActionsReducers/TeamSharingRedux';
44
44
  import * as ThemeRedux from '../ActionsReducers/ThemeRedux';
45
45
  import * as ToolPanelRedux from '../ActionsReducers/ToolPanelRedux';
46
46
  import * as UserInterfaceRedux from '../ActionsReducers/UserInterfaceRedux';
47
- import { areAdaptableProfileTracksEnabled, getMarker } from '../../devTools';
47
+ import { getMarker, shouldTimeOperations } from '../../devTools';
48
48
  import { isAdaptableSharedEntity, isCustomSharedEntity, } from '../../AdaptableState/TeamSharingState';
49
49
  const INIT_STATE = 'INIT_STATE';
50
50
  const LOAD_STATE = 'LOAD_STATE';
@@ -284,11 +284,8 @@ function createDevToolsActionMarkerMiddleware(adaptable) {
284
284
  if (!adaptableId) {
285
285
  return null;
286
286
  }
287
- if (!areAdaptableProfileTracksEnabled(adaptableId)) {
288
- return null;
289
- }
290
287
  return (middlewareAPI) => (next) => (action) => {
291
- if (!isTrackableReduxAction(action)) {
288
+ if (!shouldTimeOperations(adaptableId) || !isTrackableReduxAction(action)) {
292
289
  return next(action);
293
290
  }
294
291
  const previousState = middlewareAPI.getState();
@@ -623,7 +620,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
623
620
  if (module) {
624
621
  module.checkListenToCellDataChanged();
625
622
  }
626
- adaptable.api.layoutApi.internalApi.refreshLayout();
623
+ adaptable.api.layoutApi.internalApi.refreshLayout({ columnsChanged: true });
627
624
  return returnAction;
628
625
  }
629
626
  case CalculatedColumnRedux.CALCULATED_COLUMN_ADD:
@@ -657,7 +654,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
657
654
  if (module) {
658
655
  module.checkListenToCellDataChanged();
659
656
  }
660
- adaptable.api.layoutApi.internalApi.refreshLayout();
657
+ adaptable.api.layoutApi.internalApi.refreshLayout({ columnsChanged: true });
661
658
  adaptable.api.internalApi.getLiveRefreshService().syncFromState();
662
659
  if (action.type === CalculatedColumnRedux.CALCULATED_COLUMN_EDIT) {
663
660
  adaptable.api.calculatedColumnApi.internalApi.syncFormulaTraceWithCalculatedColumn(calculatedColumn);