@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
@@ -1,5 +1,5 @@
1
1
  import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
2
- import { ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from 'ag-grid-enterprise';
2
+ import { CellValueChangedEvent, ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from 'ag-grid-enterprise';
3
3
  import { AdaptableLogger } from './AdaptableLogger';
4
4
  import { AdaptableApi, DestroyConfig } from '../Api/AdaptableApi';
5
5
  import { AdaptableVariant, GridRefreshScope, IAdaptable, NormalizeAdaptableStateOptions } from '../AdaptableInterfaces/IAdaptable';
@@ -97,11 +97,38 @@ export declare class AdaptableAgGrid implements IAdaptable {
97
97
  private ChartingService;
98
98
  private isListeningToAgGridRowNodeEvents;
99
99
  /**
100
- * Nested / overlapping `applyTransaction` updates. Rendered rows report
101
- * `dataChanged` via the monkey-patch; off-screen rows do not, and are
102
- * synthesized from the pre-transaction snapshot after the call returns.
100
+ * Row node -> the data object last reported for it, for the rows of Adaptable API transactions.
101
+ * Rendered rows report `dataChanged` via the monkey-patch; rows that are not rendered do not, and
102
+ * are diffed against the stored object after the transaction (see `reportTrackedRowUpdates`).
103
+ * Cleared when no transaction is in progress or pending.
103
104
  */
104
- private offScreenRowUpdateTrackers;
105
+ private trackedRowData;
106
+ /** rows of async Adaptable API transactions whose callback has not run yet, with a count per row */
107
+ private pendingAsyncRowNodes;
108
+ private pendingAsyncTransactions;
109
+ private syncTransactionDepth;
110
+ /** a rendered row of an async flush asked for a re-filter; done once, in the callback */
111
+ private refilterAfterAsyncFlush;
112
+ /**
113
+ * Cell changes already reported, per row node and column id, with how many times: the async
114
+ * `cellValueChanged` AG Grid fires for the same edits skips them (see `onAgGridCellValueChanged`).
115
+ */
116
+ private reportedCellChanges;
117
+ private isReportedCellChangesClearScheduled;
118
+ /**
119
+ * While `updateCell` runs: the `cellValueChanged` events AG Grid dispatched, and the cells a
120
+ * row-node `cellChanged` event reported
121
+ */
122
+ private updateCellCapture;
123
+ private postEditBatch;
124
+ /** refreshes of pinned copies that wait for AG Grid to give the copy the new row data */
125
+ private pendingPinnedCopyRefreshes;
126
+ private dataBackedColumnsCache;
127
+ /** `getRowId` was installed by AdapTable, so a row id is the primary key value */
128
+ private isRowIdPrimaryKey;
129
+ private primaryKeyLookup;
130
+ private hasLoggedPrimaryKeyLookupFallback;
131
+ private hasWarnedSameObjectUpdate;
105
132
  private debouncedSetSelectedRows;
106
133
  private debouncedSetSelectedCells;
107
134
  private agGridListenerKeydown;
@@ -111,7 +138,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
111
138
  private listenerGlobalChartingChanges;
112
139
  private listenerCellEditingStarted;
113
140
  private listenerFirstDataRendered;
114
- private listenerPivotChanged;
115
141
  private listenerCellSelectionChanged;
116
142
  private listenerSortChanged;
117
143
  private listenerColumnGroupOpened;
@@ -234,14 +260,22 @@ export declare class AdaptableAgGrid implements IAdaptable {
234
260
  */
235
261
  onAgGridRowNodeEvent(event: RowNodeEvent): void;
236
262
  /**
237
- * Off-screen complement to row-node `cellChanged`. AG Grid fires this from
238
- * `ValueService.setValue` for every row; the row-node event only exists
239
- * when the node has a `LocalEventService` (rendered rows). Handling both
240
- * on a rendered row applies the delta twice, so rendered rows stay on
241
- * `cellChanged` (correct values for valueGetters / prevent-edit).
263
+ * Complement to row-node `cellChanged`. AG Grid fires this, after the edit, from
264
+ * `ValueService.setValue` for every row; the row-node event only exists when the node had a
265
+ * `LocalEventService` (a rendered row) at the time of the edit. The changes already reported
266
+ * (from a row-node event, or by `updateCell`) are skipped, so each edit is reported once even if
267
+ * the row has been rendered or removed from the DOM since.
242
268
  */
243
269
  private onAgGridCellValueChanged;
244
- private noteRowNodeDataChanged;
270
+ /**
271
+ * see #local_event_service_monkey_patch (AgGridAdapter.ts)
272
+ *
273
+ * AG Grid's `cellValueChanged`, received while AG Grid dispatches it. Only recorded while
274
+ * `updateCell` runs, which reports the edits once `setDataValue` has returned.
275
+ */
276
+ onAgGridCellValueChangedDispatch(event: CellValueChangedEvent): void;
277
+ private noteCellChangeReported;
278
+ private takeCellChangeReported;
245
279
  private shouldAutoSizeLayout;
246
280
  private autoSizeLayoutIfNeeded;
247
281
  forPlugins(callback: (plugin: AdaptablePlugin) => any): void;
@@ -356,6 +390,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
356
390
  * `dataChanged`. Snapshot old data first and synthesize `onRowDataChanged`
357
391
  * for those nodes after the transaction (see #off_screen_row_update).
358
392
  */
393
+ private countTransactionForPerf;
359
394
  private applyAgGridTransaction;
360
395
  /**
361
396
  * This method internally differentiates between server-side and client-side row model
@@ -367,10 +402,14 @@ export declare class AdaptableAgGrid implements IAdaptable {
367
402
  *
368
403
  * CSRM `applyTransaction({ update })` does not emit per-cell `cellValueChanged`.
369
404
  * Rendered rows still fire row-node `dataChanged`; off-screen rows do not.
405
+ * Stores the data each updated row has before the transaction, unless a pending transaction
406
+ * already did; returns the rows found.
370
407
  */
371
- private beginOffScreenRowUpdateTracking;
372
- private endOffScreenRowUpdateTracking;
373
- private emitOffScreenRowUpdates;
408
+ private trackRowUpdates;
409
+ /** Reports each updated row whose data is not the data last reported for it */
410
+ private reportTrackedRowUpdates;
411
+ private releaseTrackedRows;
412
+ private warnSameObjectUpdate;
374
413
  updateRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
375
414
  addRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
376
415
  addOrUpdateRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<{
@@ -384,6 +423,15 @@ export declare class AdaptableAgGrid implements IAdaptable {
384
423
  }>;
385
424
  deleteRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
386
425
  getRowNodeForPrimaryKey(primaryKeyValue: any): any;
426
+ private readPrimaryKeyValue;
427
+ /**
428
+ * For rows whose id is not their primary key value (an application `getRowId`, tree data,
429
+ * the server-side row model): a map from primary key value to row node, built on a miss and
430
+ * rebuilt at most once per synchronous turn.
431
+ */
432
+ private getRowNodeFromPrimaryKeyLookup;
433
+ /** The lookup is not rebuilt in the turn that built it, so the rows a transaction adds go in too */
434
+ private addToPrimaryKeyLookup;
387
435
  hideColumn(columnId: string): void;
388
436
  showColumn(columnId: string): void;
389
437
  autoSizeColumn(columnId: string): void;
@@ -473,6 +521,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
473
521
  getChartRef(chartId: string): ChartRef;
474
522
  updateLayoutInManagerAfterStoreHasChanged(layout?: Layout): void;
475
523
  private getActiveAdaptableAggFuncForCol;
524
+ private getDataBackedColumns;
476
525
  private onRowDataChanged;
477
526
  private onCellDataChanged;
478
527
  private isUndoChange;
@@ -480,6 +529,20 @@ export declare class AdaptableAgGrid implements IAdaptable {
480
529
  * There are a few things we need to do AFTER we edit a cell and it makes sense to put them in one place
481
530
  */
482
531
  private performPostEditChecks;
532
+ private performPostEditChecksNow;
533
+ /**
534
+ * Runs `fn` with a post-edit batch open: the changes reported while it runs are re-filtered,
535
+ * refreshed column-wide and checked against the selection once, when `fn` returns, instead of
536
+ * once per row or cell. A nested call joins the open batch.
537
+ */
538
+ runPostEditBatch<T>(fn: () => T): T;
539
+ private flushPostEditBatch;
540
+ private recordChangedCellForSelection;
541
+ /**
542
+ * Whether the row is rendered. Inside a post-edit batch the rendered rows are read once per
543
+ * batch. A pinned row is always rendered.
544
+ */
545
+ isRowNodeRendered(rowNode: IRowNode): boolean;
483
546
  /**
484
547
  * Collect format / freetext / styled / observable / relative-styled columns
485
548
  * into one scope. Edited-row-only ids stay in `columnIds`; `ALL_ROWS()`
@@ -491,14 +554,21 @@ export declare class AdaptableAgGrid implements IAdaptable {
491
554
  * AdapTable flashing is driven by `CellDataChanged`, not AG Grid cell flash.
492
555
  */
493
556
  private applyPostEditRefresh;
557
+ private applyPendingPinnedCopyRefresh;
558
+ private refreshRenderedRows;
559
+ /** The row and its pinned copy, those of them that are rendered */
560
+ private getRenderedCopiesOfRow;
494
561
  private checkStyledColumnComparisonChanges;
495
562
  private checkFormatColumnPredicateStyleChanges;
496
563
  private checkFreeTextColumnChanges;
497
564
  private checkFormatColumnExpressionStyleChanges;
498
565
  private checkIfChangedCellCurrentlySelected;
499
- private resetMinMaxCachedValueForColumn;
566
+ private updateMinMaxCachedValueForColumn;
500
567
  private filterOnDataChange;
501
- refreshLayout(): void;
568
+ refreshLayout(config?: {
569
+ columnsChanged?: boolean;
570
+ }): void;
571
+ private isAnyFilterActive;
502
572
  private isRowGroupDifferentInLayout;
503
573
  private hasPivotTotalsInLayout;
504
574
  private onLayoutChange;