@adaptabletools/adaptable-cjs 18.1.14 → 19.0.0-canary.0

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 (160) hide show
  1. package/package.json +2 -2
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -5
  3. package/src/AdaptableOptions/AlertOptions.d.ts +2 -1
  4. package/src/AdaptableOptions/ChartingOptions.d.ts +5 -1
  5. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +5 -1
  6. package/src/AdaptableOptions/DashboardOptions.d.ts +5 -1
  7. package/src/AdaptableOptions/FlashingCellOptions.d.ts +5 -1
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
  9. package/src/AdaptableOptions/NotificationsOptions.d.ts +6 -2
  10. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +5 -1
  11. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
  12. package/src/Api/ChartingApi.d.ts +2 -2
  13. package/src/Api/ColumnApi.d.ts +6 -0
  14. package/src/Api/ConfigApi.d.ts +22 -2
  15. package/src/Api/Events/LiveDataChanged.d.ts +1 -1
  16. package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -1
  17. package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -1
  18. package/src/Api/Implementation/ChartingApiImpl.js +2 -2
  19. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  20. package/src/Api/Implementation/ColumnApiImpl.js +3 -0
  21. package/src/Api/Implementation/ConfigApiImpl.d.ts +4 -1
  22. package/src/Api/Implementation/ConfigApiImpl.js +16 -1
  23. package/src/Api/Implementation/EntitlementApiImpl.d.ts +4 -1
  24. package/src/Api/Implementation/EntitlementApiImpl.js +31 -6
  25. package/src/Api/Implementation/ExportApiImpl.js +5 -7
  26. package/src/Api/Implementation/GridApiImpl.js +1 -1
  27. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  28. package/src/Api/Implementation/LayoutApiImpl.js +61 -0
  29. package/src/Api/Implementation/TeamSharingApiImpl.js +2 -6
  30. package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -6
  31. package/src/Api/Internal/AdaptableInternalApi.js +5 -11
  32. package/src/Api/Internal/EntitlementInternalApi.d.ts +4 -0
  33. package/src/Api/Internal/EntitlementInternalApi.js +15 -0
  34. package/src/Api/Internal/ExportInternalApi.d.ts +33 -8
  35. package/src/Api/Internal/ExportInternalApi.js +577 -5
  36. package/src/Api/Internal/NamedQueryInternalApi.d.ts +0 -1
  37. package/src/Api/Internal/NamedQueryInternalApi.js +0 -5
  38. package/src/Api/LayoutApi.d.ts +7 -0
  39. package/src/PredefinedConfig/AdaptableState.d.ts +0 -5
  40. package/src/PredefinedConfig/Common/ExtendedLayoutInfo.d.ts +12 -0
  41. package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +2 -1
  42. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  43. package/src/Redux/ActionsReducers/GridRedux.d.ts +6 -6
  44. package/src/Redux/ActionsReducers/GridRedux.js +11 -11
  45. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
  46. package/src/Redux/ActionsReducers/LayoutRedux.js +10 -10
  47. package/src/Redux/ActionsReducers/NamedQueryRedux.d.ts +1 -1
  48. package/src/Redux/ActionsReducers/NamedQueryRedux.js +1 -1
  49. package/src/Redux/ActionsReducers/PluginsRedux.d.ts +2 -2
  50. package/src/Redux/ActionsReducers/PluginsRedux.js +3 -3
  51. package/src/Redux/Store/AdaptableReduxMerger.js +3 -3
  52. package/src/Redux/Store/AdaptableStore.js +2 -4
  53. package/src/Strategy/AdaptableModuleBase.js +1 -2
  54. package/src/Strategy/ColumnFilterModule.js +1 -2
  55. package/src/Strategy/ExportModule.js +17 -44
  56. package/src/Strategy/FlashingCellModule.js +2 -10
  57. package/src/Strategy/ScheduleModule.js +4 -6
  58. package/src/Strategy/SmartEditModule.js +1 -7
  59. package/src/Strategy/TeamSharingModule.js +2 -2
  60. package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +1 -1
  61. package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +1 -3
  62. package/src/Utilities/Constants/FilterConstants.d.ts +10 -0
  63. package/src/Utilities/Constants/FilterConstants.js +11 -0
  64. package/src/Utilities/Constants/GeneralConstants.d.ts +41 -4
  65. package/src/Utilities/Constants/GeneralConstants.js +44 -5
  66. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -2
  67. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -6
  68. package/src/Utilities/Extensions/ArrayExtensions.d.ts +14 -0
  69. package/src/Utilities/Extensions/ArrayExtensions.js +68 -1
  70. package/src/Utilities/Extensions/EnumExtensions.d.ts +0 -4
  71. package/src/Utilities/Extensions/EnumExtensions.js +3 -15
  72. package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -10
  73. package/src/Utilities/Helpers/AdaptableHelper.js +10 -64
  74. package/src/Utilities/Helpers/FormatHelper.d.ts +9 -0
  75. package/src/Utilities/Helpers/FormatHelper.js +26 -14
  76. package/src/Utilities/Helpers/Helper.d.ts +0 -10
  77. package/src/Utilities/Helpers/Helper.js +1 -76
  78. package/src/Utilities/Services/ChartingService.d.ts +2 -2
  79. package/src/Utilities/Services/ChartingService.js +5 -11
  80. package/src/Utilities/Services/ModuleService.js +35 -31
  81. package/src/Utilities/Services/RowEditService.js +1 -6
  82. package/src/Utilities/Services/RowSummaryService.js +2 -2
  83. package/src/Utilities/Services/ValidationService.js +2 -16
  84. package/src/View/Alert/AlertEmptyView.js +1 -2
  85. package/src/View/Charting/ChartingStatusBarPopover.js +1 -2
  86. package/src/View/Charting/useChartingElements.js +1 -1
  87. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +2 -6
  88. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -4
  89. package/src/View/Components/FilterForm/QuickFilterForm.js +2 -12
  90. package/src/View/Components/ModuleValueSelector/index.js +2 -2
  91. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -5
  92. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -3
  93. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +2 -1
  94. package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -7
  95. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +6 -12
  96. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +3 -23
  97. package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -5
  98. package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -3
  99. package/src/View/Components/ValueSelector/index.js +2 -2
  100. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +2 -2
  101. package/src/View/Dashboard/CustomDashboardButton.js +1 -6
  102. package/src/View/Dashboard/CustomToolbar.js +2 -9
  103. package/src/View/Dashboard/Dashboard.js +2 -4
  104. package/src/View/Dashboard/DashboardPopup.js +1 -3
  105. package/src/View/Dashboard/DashboardToolbarFactory.js +1 -2
  106. package/src/View/Dashboard/PinnedToolbarsSelector.js +1 -2
  107. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -3
  108. package/src/View/Export/ExportViewPanel.js +2 -4
  109. package/src/View/Export/Wizard/ReportSummaryWizard.js +2 -6
  110. package/src/View/GridFilter/GridFilterExpressionEditor.js +2 -2
  111. package/src/View/GridFilter/useGridFilterExpressionEditor.js +2 -6
  112. package/src/View/Layout/LayoutViewPanel.js +1 -1
  113. package/src/View/Layout/PivotDetailsPopoup.js +1 -7
  114. package/src/View/Layout/SaveLayoutButton.js +1 -3
  115. package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
  116. package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -2
  117. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +2 -2
  118. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
  119. package/src/View/Layout/Wizard/sections/RowSummarySection.js +2 -2
  120. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  121. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +3 -3
  122. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  123. package/src/View/SystemStatus/SystemStatusPopup.js +1 -1
  124. package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
  125. package/src/agGrid/ActionColumnRenderer.js +8 -22
  126. package/src/agGrid/AdaptableAgGrid.d.ts +6 -7
  127. package/src/agGrid/AdaptableAgGrid.js +164 -145
  128. package/src/agGrid/AgGridAdapter.d.ts +0 -1
  129. package/src/agGrid/AgGridAdapter.js +7 -10
  130. package/src/agGrid/AgGridColumnAdapter.d.ts +3 -1
  131. package/src/agGrid/AgGridColumnAdapter.js +39 -13
  132. package/src/agGrid/BadgeRenderer.js +4 -22
  133. package/src/agGrid/FloatingFilterWrapper.js +21 -0
  134. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +1 -1
  135. package/src/agGrid/buildSortedColumnStateForLayout.js +2 -2
  136. package/src/agGrid/defaultAdaptableOptions.js +35 -30
  137. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -15
  138. package/src/env.js +2 -2
  139. package/src/metamodel/adaptable.metamodel.d.ts +89 -8
  140. package/src/metamodel/adaptable.metamodel.js +1 -1
  141. package/src/types.d.ts +10 -9
  142. package/tsconfig.cjs.tsbuildinfo +1 -1
  143. package/src/Redux/ActionsReducers/QueryRedux.d.ts +0 -10
  144. package/src/Redux/ActionsReducers/QueryRedux.js +0 -25
  145. package/src/Utilities/Helpers/FormatContentHelper.d.ts +0 -22
  146. package/src/Utilities/Helpers/FormatContentHelper.js +0 -39
  147. package/src/Utilities/Services/EntitlementService.d.ts +0 -14
  148. package/src/Utilities/Services/EntitlementService.js +0 -67
  149. package/src/Utilities/Services/Interface/IEntitlementService.d.ts +0 -10
  150. package/src/Utilities/Services/Interface/IReportService.d.ts +0 -27
  151. package/src/Utilities/Services/Interface/IReportService.js +0 -2
  152. package/src/Utilities/Services/ReportService.d.ts +0 -41
  153. package/src/Utilities/Services/ReportService.js +0 -608
  154. package/src/Utilities/isAdaptableObject.d.ts +0 -2
  155. package/src/Utilities/isAdaptableObject.js +0 -8
  156. package/src/Utilities/reorder.d.ts +0 -1
  157. package/src/Utilities/reorder.js +0 -17
  158. package/src/Utilities/sortWithOrder.d.ts +0 -11
  159. package/src/Utilities/sortWithOrder.js +0 -54
  160. /package/src/{Utilities/Services/Interface/IEntitlementService.js → PredefinedConfig/Common/ExtendedLayoutInfo.js} +0 -0
@@ -21,10 +21,8 @@ const CellPopupService_1 = require("../Utilities/Services/CellPopupService");
21
21
  const ChartingService_1 = require("../Utilities/Services/ChartingService");
22
22
  const ThemeService_1 = require("../Utilities/Services/ThemeService");
23
23
  const ValidationService_1 = require("../Utilities/Services/ValidationService");
24
- const ReportService_1 = require("../Utilities/Services/ReportService");
25
24
  const ModuleService_1 = require("../Utilities/Services/ModuleService");
26
25
  const CalculatedColumnExpressionService_1 = require("../Utilities/Services/CalculatedColumnExpressionService");
27
- const EntitlementService_1 = require("../Utilities/Services/EntitlementService");
28
26
  const QueryLanguageService_1 = require("../Utilities/Services/QueryLanguageService");
29
27
  const AlertService_1 = require("../Utilities/Services/AlertService");
30
28
  const TeamSharingService_1 = require("../Utilities/Services/TeamSharingService");
@@ -89,7 +87,6 @@ const AggregationColumns_1 = require("../PredefinedConfig/Common/AggregationColu
89
87
  const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
90
88
  const RowEditService_1 = require("../Utilities/Services/RowEditService");
91
89
  const weightedAverage_1 = require("./weightedAverage");
92
- const sortWithOrder_1 = require("../Utilities/sortWithOrder");
93
90
  const Enums_1 = require("../PredefinedConfig/Common/Enums");
94
91
  const ObjectFactory_1 = tslib_1.__importStar(require("../Utilities/ObjectFactory"));
95
92
  const EnvVars_1 = require("../EnvVars");
@@ -99,45 +96,54 @@ const AdaptableLoadingScreen_1 = require("../View/Components/Popups/AdaptableLoa
99
96
  const react_1 = require("react");
100
97
  const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
101
98
  const buildSortedColumnStateForLayout_1 = require("./buildSortedColumnStateForLayout");
102
- const RowNodeProto = core_1.RowNode.prototype;
103
- const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
99
+ const RowSummary_1 = require("../PredefinedConfig/Common/RowSummary");
100
+ const LocalEventService_Prototype = core_1.LocalEventService.prototype;
101
+ const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
104
102
  const GridOptionsService_updateGridOptions = core_1.GridOptionsService.prototype.updateGridOptions;
105
- /**
106
- * AgGrid does not expose 'cellChanged' and 'dataChanged'
107
- * so we have to override `dispatchLocalEvent`
108
- * and hook our own functionality into it
109
- */
110
- RowNodeProto.dispatchLocalEvent = function (event) {
111
- const node = event.node;
112
- const result = RowNode_dispatchLocalEvent.apply(this, arguments);
113
- const extractGridApiFromRowNode = (rowNode) => {
114
- var _a, _b, _c, _d;
115
- // starting with AG Grid 26.1.0 the gridApi is wrapped in a Beans property
116
- const rowNodeApi = (_b = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _a === void 0 ? void 0 : _a.gridApi) !== null && _b !== void 0 ? _b : (_d = (_c = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _c === void 0 ? void 0 : _c.gos) === null || _d === void 0 ? void 0 : _d.api;
117
- if (!rowNodeApi) {
118
- AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
119
- }
120
- return rowNodeApi;
121
- };
122
- // we don't know from which instance of aggrid this is coming,
123
- // as this fn is shared by all instances
124
- if (node) {
125
- AdaptableAgGrid.forEachAdaptable((adaptable) => {
103
+ const EventService_Prototype = core_1.EventService.prototype;
104
+ const EventService_wireBeans = EventService_Prototype.wireBeans;
105
+ // AG GRID obfuscates its internals, this is (currently) the best way to get hold of its internal services
106
+ const DANGER_AG_GRID_BEANS_MAP = {};
107
+ EventService_Prototype.wireBeans = function (beans) {
108
+ var _a;
109
+ EventService_wireBeans.apply(this, arguments);
110
+ const gridId = (_a = beans === null || beans === void 0 ? void 0 : beans.context) === null || _a === void 0 ? void 0 : _a.getGridId();
111
+ if (!gridId) {
112
+ console.error('CRITICAL: No gridId found in beans, this should never happen!');
113
+ }
114
+ DANGER_AG_GRID_BEANS_MAP[gridId] = beans;
115
+ };
116
+ LocalEventService_Prototype.dispatchEvent = function (event) {
117
+ LocalEventService_dispatchEvent.apply(this, arguments);
118
+ if (event.type === 'cellChanged' || event.type === 'dataChanged') {
119
+ const eventRowNode = event.node;
120
+ const extractGridApiFromRowNode = (rowNode) => {
126
121
  var _a;
127
- if (extractGridApiFromRowNode(node) !== ((_a = adaptable.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi(true))) {
128
- // the event is coming from another aggrid instance
129
- // so IGNORE IT
130
- return;
122
+ const rowNodeApi = (_a = rowNode === null || rowNode === void 0 ? void 0 : rowNode.beans) === null || _a === void 0 ? void 0 : _a.gridApi;
123
+ if (!rowNodeApi) {
124
+ AdaptableLogger_1.AdaptableLogger.consoleErrorBase(`No GridAPI found in passed RowNode, this should never happen!`, rowNode);
131
125
  }
132
- // we're on the correct instance, so do this
133
- //@ts-ignore
134
- const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
135
- if (fn) {
136
- fn(event);
137
- }
138
- });
126
+ return rowNodeApi;
127
+ };
128
+ // we don't know from which instance of aggrid this is coming,
129
+ // as this fn is shared by all instances
130
+ if (eventRowNode) {
131
+ AdaptableAgGrid.forEachAdaptable((adaptable) => {
132
+ var _a;
133
+ if (extractGridApiFromRowNode(eventRowNode) !== ((_a = adaptable.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi(true))) {
134
+ // the event is coming from another aggrid instance
135
+ // so IGNORE IT
136
+ return;
137
+ }
138
+ // we're on the correct instance, so do this
139
+ //@ts-ignore
140
+ const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
141
+ if (fn) {
142
+ fn(event);
143
+ }
144
+ });
145
+ }
139
146
  }
140
- return result;
141
147
  };
142
148
  const adaptableInstances = {};
143
149
  const publishTimestamp = Number(EnvVars_1.ADAPTABLE_PUBLISH_TIMESTAMP);
@@ -203,6 +209,9 @@ class AdaptableAgGrid {
203
209
  static dismissInstance(adaptable) {
204
210
  delete adaptableInstances[adaptable._id];
205
211
  }
212
+ get isAgGridInitialising() {
213
+ return this.lifecycleState === 'initAgGrid';
214
+ }
206
215
  get isReady() {
207
216
  return this.lifecycleState === 'ready';
208
217
  }
@@ -338,7 +347,7 @@ class AdaptableAgGrid {
338
347
  }
339
348
  this.forPlugins((plugin) => plugin.afterInitialStateLoaded(this));
340
349
  // do this now so it sets module entitlements
341
- this.EntitlementService.setModulesEntitlements();
350
+ this.api.entitlementApi.internalApi.setModulesEntitlements();
342
351
  /**
343
352
  * At this point it's mandatory to have the ALL the Adaptable blocks initialized:
344
353
  * Store, APIs, Services, Modules
@@ -353,6 +362,9 @@ class AdaptableAgGrid {
353
362
  this.lifecycleState = 'initAgGrid';
354
363
  this.agGridAdapter.initialGridOptions = gridOptions;
355
364
  const perfInitAgGrid = this.logger.beginPerf(`initAgGrid()`);
365
+ // AG Grid evaluates early on the floatingFilter params, so we need to "suppres" the floating filter temporarily
366
+ // we will reset it once Adaptable is ready
367
+ this.agGridColumnAdapter.setupColumnFloatingFilterTemporarily(gridOptions);
356
368
  const agGridApi = await this.initializeAgGrid(gridOptions, config.modules, config.renderAgGridFrameworkComponent);
357
369
  if (agGridApi === false) {
358
370
  this.logger.consoleError(`Adaptable failed to initialize AG Grid!`);
@@ -364,6 +376,7 @@ class AdaptableAgGrid {
364
376
  // we need to intercept several AG Grid Api methods and trigger Adaptale state changes
365
377
  this.monkeyPatchingGridOptionsUpdates(agGridApi);
366
378
  this.agGridAdapter.setAgGridApi(agGridApi);
379
+ this.lifecycleState = 'agGridReady';
367
380
  this.logger.info(`Registered AG Grid modules: `, this.agGridAdapter.getRegisteredModuleNames().sort());
368
381
  /**
369
382
  * At this point AG Grid is initialized!
@@ -431,8 +444,8 @@ class AdaptableAgGrid {
431
444
  perfInitAdaptableAgGrid.end();
432
445
  return Promise.resolve(this.api);
433
446
  }
434
- normalizeAdaptableState(state, gridOptions) {
435
- state = this.normaliseLayoutState(state, gridOptions);
447
+ normalizeAdaptableState(state, agGridOptions) {
448
+ state = this.normaliseLayoutState(state, agGridOptions);
436
449
  state = this.normaliseToolPanelState(state);
437
450
  return state;
438
451
  }
@@ -575,7 +588,9 @@ class AdaptableAgGrid {
575
588
  * `gridId`
576
589
  */
577
590
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'gridId', (original_gridId) => {
578
- return original_gridId || this.adaptableOptions.adaptableId;
591
+ const agGridId = original_gridId || this.adaptableOptions.adaptableId;
592
+ this._agGridId = agGridId;
593
+ return agGridId;
579
594
  });
580
595
  /**
581
596
  * `getRowId`
@@ -602,12 +617,20 @@ class AdaptableAgGrid {
602
617
  };
603
618
  }
604
619
  return (params) => {
605
- var _a;
606
- if (params.data[primaryKey]) {
607
- return params.data[primaryKey];
608
- }
609
- // row does not have primary key => might be a group row
610
- const parentKeys = (_a = params.parentKeys) !== null && _a !== void 0 ? _a : [];
620
+ var _a, _b, _c;
621
+ if ((_a = params.data) === null || _a === void 0 ? void 0 : _a[primaryKey]) {
622
+ const primaryKeyValue = params.data[primaryKey];
623
+ return typeof primaryKeyValue === 'number'
624
+ ? `${primaryKeyValue}`
625
+ : params.data[primaryKey];
626
+ }
627
+ // might be a summary row
628
+ if ((_b = params.data) === null || _b === void 0 ? void 0 : _b[RowSummary_1.ROW_SUMMARY_ROW_ID]) {
629
+ return params.data[RowSummary_1.ROW_SUMMARY_ROW_ID];
630
+ }
631
+ // AFL 2024.08.17 - no idea why is this here and when it's used
632
+ // might be a group row
633
+ const parentKeys = (_c = params.parentKeys) !== null && _c !== void 0 ? _c : [];
611
634
  const values = Object.values(params.data);
612
635
  if (values.length) {
613
636
  const id = [...parentKeys, values[0]].join('/');
@@ -808,7 +831,7 @@ class AdaptableAgGrid {
808
831
  // lucky us, no sideBar is defined, so we don't have to do anything
809
832
  return original_sideBar;
810
833
  }
811
- const isAdaptableToolPanelHidden = this.EntitlementService.isModuleHiddenEntitlement('ToolPanel');
834
+ const isAdaptableToolPanelHidden = this.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel');
812
835
  const adaptableToolPanelDef = {
813
836
  id: GeneralConstants.ADAPTABLE_TOOLPANEL_ID,
814
837
  toolPanel: GeneralConstants.ADAPTABLE_TOOLPANEL_COMPONENT,
@@ -1036,7 +1059,7 @@ class AdaptableAgGrid {
1036
1059
  * Either initializes the AG Grid instance or delegates it to the framework wrappers (React/Anglar)
1037
1060
  */
1038
1061
  async initializeAgGrid(gridOptions, modules, renderAgGridFrameworkComponent) {
1039
- var _a, _b, _c;
1062
+ var _a;
1040
1063
  if (renderAgGridFrameworkComponent) {
1041
1064
  const result = await renderAgGridFrameworkComponent(gridOptions);
1042
1065
  if (result === false) {
@@ -1059,7 +1082,7 @@ class AdaptableAgGrid {
1059
1082
  if (!this.getAgGridContainerElement()) {
1060
1083
  // initialize the agGridContainerElement from the AgGrid instance
1061
1084
  // @ts-ignore
1062
- const gridRoot = (_c = (_b = (_a = agGridApi.ctrlsService) === null || _a === void 0 ? void 0 : _a.getGridBodyCtrl) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.eGridBody;
1085
+ const gridRoot = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.eGridDiv;
1063
1086
  const gridContainer = gridRoot === null || gridRoot === void 0 ? void 0 : gridRoot.closest('[class*="ag-theme"]');
1064
1087
  if (!gridContainer) {
1065
1088
  this.logger.consoleError(`No AG Grid container could be derived from the Adaptable framework wrapper.
@@ -1106,14 +1129,10 @@ class AdaptableAgGrid {
1106
1129
  }
1107
1130
  return false;
1108
1131
  };
1109
- const isColGroupDef = (columnDefinition) => {
1110
- // @ts-ignore
1111
- return columnDefinition['children'] != null;
1112
- };
1113
1132
  const processedSpecialColDefIds = [];
1114
1133
  const mapColDefs = (colDefs) => {
1115
1134
  return colDefs.map((colDef) => {
1116
- if (isColGroupDef(colDef)) {
1135
+ if (this.agGridColumnAdapter.isColGroupDef(colDef)) {
1117
1136
  // if it's a group column, recursively map its children
1118
1137
  colDef.children = mapColDefs(colDef.children);
1119
1138
  return colDef;
@@ -1249,7 +1268,7 @@ class AdaptableAgGrid {
1249
1268
  .map((colDef) => colDef.colId),
1250
1269
  };
1251
1270
  agGridState.columnOrder = {
1252
- orderedColIds: (0, sortWithOrder_1.sortWithOrderArray)(allAgGridColDefIds, currentLayout.Columns || [], {
1271
+ orderedColIds: ArrayExtensions_1.default.sortArrayWithOrder(allAgGridColDefIds, currentLayout.Columns || [], {
1253
1272
  sortUnorderedItems: false,
1254
1273
  }),
1255
1274
  };
@@ -1358,12 +1377,12 @@ class AdaptableAgGrid {
1358
1377
  this.deriveAdaptableColumnStateFromAgGrid();
1359
1378
  }, GeneralConstants_1.HALF_SECOND);
1360
1379
  const columnEventsThatTriggersStateChange = [
1361
- core_1.Events.EVENT_COLUMN_MOVED,
1362
- core_1.Events.EVENT_GRID_COLUMNS_CHANGED,
1363
- core_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED,
1364
- core_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,
1365
- core_1.Events.EVENT_COLUMN_VISIBLE,
1366
- core_1.Events.EVENT_NEW_COLUMNS_LOADED,
1380
+ 'columnMoved',
1381
+ 'gridColumnsChanged',
1382
+ 'columnEverythingChanged',
1383
+ 'displayedColumnsChanged',
1384
+ 'columnVisible',
1385
+ 'newColumnsLoaded',
1367
1386
  ];
1368
1387
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerStateChange = (type) => {
1369
1388
  if (columnEventsThatTriggersStateChange.indexOf(type) > -1) {
@@ -1374,7 +1393,7 @@ class AdaptableAgGrid {
1374
1393
  * Use Case: User has started inline editing but its distabled in Action Row Options
1375
1394
  * Action: Stop editing
1376
1395
  */
1377
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_CELL_EDITING_STARTED, (this.listenerCellEditingStarted = () => {
1396
+ this.agGridAdapter.getAgGridApi().addEventListener('cellEditingStarted', (this.listenerCellEditingStarted = () => {
1378
1397
  var _a;
1379
1398
  if ((_a = this.adaptableOptions.actionRowOptions) === null || _a === void 0 ? void 0 : _a.disableInlineEditing)
1380
1399
  this.agGridAdapter.getAgGridApi().stopEditing();
@@ -1385,7 +1404,7 @@ class AdaptableAgGrid {
1385
1404
  * Action2: Ensure that we have set column data types
1386
1405
  * Note: Deals with scenario where the data is provided to AdapTable after grid has been setup
1387
1406
  */
1388
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_FIRST_DATA_RENDERED, (this.listenerFirstDataRendered = () => {
1407
+ this.agGridAdapter.getAgGridApi().addEventListener('firstDataRendered', (this.listenerFirstDataRendered = () => {
1389
1408
  if (this.initWithLazyData) {
1390
1409
  this.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
1391
1410
  this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
@@ -1398,7 +1417,7 @@ class AdaptableAgGrid {
1398
1417
  * Action 1: Autosize pivot columns when entering pivot mode (if autosize pivot in Layout is true)
1399
1418
  * Action 2: Set pivot mode on / off in api as necessary
1400
1419
  */
1401
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, (this.listenerPivotModeChanged = (params) => {
1420
+ this.agGridAdapter.getAgGridApi().addEventListener('columnPivotModeChanged', (this.listenerPivotModeChanged = (params) => {
1402
1421
  if (params.type == 'columnPivotModeChanged' &&
1403
1422
  params.columnApi != null &&
1404
1423
  params.columnApi.columnController != null &&
@@ -1416,7 +1435,7 @@ class AdaptableAgGrid {
1416
1435
  * Use Case: A pivot column has changed
1417
1436
  * Action: Autosize pivot columns (if autosize pivot in Layout is true)
1418
1437
  */
1419
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_COLUMN_PIVOT_CHANGED, (this.listenerPivotChanged = (params) => {
1438
+ this.agGridAdapter.getAgGridApi().addEventListener('columnPivotChanged', (this.listenerPivotChanged = (params) => {
1420
1439
  if (params.type == 'columnPivotChanged' &&
1421
1440
  params.columnApi != null &&
1422
1441
  params.columnApi.columnController != null &&
@@ -1431,13 +1450,13 @@ class AdaptableAgGrid {
1431
1450
  * Action: Save the Layout (on a debounce)
1432
1451
  */
1433
1452
  const columnEventsThatTriggersAutoLayoutSave = [
1434
- core_1.Events.EVENT_COLUMN_PINNED,
1435
- core_1.Events.EVENT_COLUMN_PIVOT_CHANGED,
1436
- core_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,
1437
- core_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED,
1438
- core_1.Events.EVENT_SORT_CHANGED,
1439
- core_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,
1440
- core_1.Events.EVENT_COLUMN_VALUE_CHANGED,
1453
+ 'columnPinned',
1454
+ 'columnPivotChanged',
1455
+ 'columnPivotModeChanged',
1456
+ 'displayedColumnsChanged',
1457
+ 'sortChanged',
1458
+ 'columnRowGroupChanged',
1459
+ 'columnValueChanged',
1441
1460
  ];
1442
1461
  // ADD filter event
1443
1462
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
@@ -1456,8 +1475,8 @@ class AdaptableAgGrid {
1456
1475
  this.updateLayoutFromGrid();
1457
1476
  }, GeneralConstants_1.HALF_SECOND);
1458
1477
  const rowGroupEventsThatTriggersAutoLayoutSave = [
1459
- core_1.Events.EVENT_ROW_GROUP_OPENED,
1460
- core_1.Events.EVENT_EXPAND_COLLAPSE_ALL,
1478
+ 'rowGroupOpened',
1479
+ 'expandOrCollapseAll',
1461
1480
  ];
1462
1481
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = (type) => {
1463
1482
  if (rowGroupEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
@@ -1470,7 +1489,7 @@ class AdaptableAgGrid {
1470
1489
  * Use Case: Column Row Grouping changes and 'restoreUngroupedColumns' is true
1471
1490
  * Action: Make the column invisiblel
1472
1491
  */
1473
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, (this.listenerColumnRowGroupChanged = (params) => {
1492
+ this.agGridAdapter.getAgGridApi().addEventListener('columnRowGroupChanged', (this.listenerColumnRowGroupChanged = (params) => {
1474
1493
  var _a, _b;
1475
1494
  if (this.api.internalApi.isGridInPivotMode()) {
1476
1495
  return;
@@ -1484,7 +1503,7 @@ class AdaptableAgGrid {
1484
1503
  * Action 1: Save the Layout (on a debounce)
1485
1504
  * Action 2: Emit the internal ColumnResized event - used by Sparkline Column (in Charts)
1486
1505
  */
1487
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_COLUMN_RESIZED, (this.listenerColumnResized = (params) => {
1506
+ this.agGridAdapter.getAgGridApi().addEventListener('columnResized', (this.listenerColumnResized = (params) => {
1488
1507
  if (params.finished == true && params.type == 'columnResized' && params.column) {
1489
1508
  this.debouncedSaveGridLayout(params.type);
1490
1509
  }
@@ -1500,9 +1519,9 @@ class AdaptableAgGrid {
1500
1519
  this.refreshSelectedRowsState();
1501
1520
  }, GeneralConstants_1.HALF_SECOND);
1502
1521
  const columnEventsThatTriggerSetRowSelection = [
1503
- core_1.Events.EVENT_ROW_GROUP_OPENED,
1504
- core_1.Events.EVENT_SELECTION_CHANGED,
1505
- core_1.Events.EVENT_ROW_SELECTED,
1522
+ 'rowGroupOpened',
1523
+ 'selectionChanged',
1524
+ 'rowSelected',
1506
1525
  ];
1507
1526
  this.agGridAdapter.getAgGridApi().addGlobalListener((this.listenerGlobalSetRowSelection = (type) => {
1508
1527
  if (ArrayExtensions_1.default.ContainsItem(columnEventsThatTriggerSetRowSelection, type)) {
@@ -1519,7 +1538,7 @@ class AdaptableAgGrid {
1519
1538
  }
1520
1539
  this.refreshSelectedCellsState();
1521
1540
  }, 250);
1522
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_RANGE_SELECTION_CHANGED, (this.listenerRangeSelectionChanged = (params) => {
1541
+ this.agGridAdapter.getAgGridApi().addEventListener('rangeSelectionChanged', (this.listenerRangeSelectionChanged = (params) => {
1523
1542
  if (params.finished == true) {
1524
1543
  this.debouncedSetSelectedCells();
1525
1544
  }
@@ -1529,18 +1548,18 @@ class AdaptableAgGrid {
1529
1548
  * Action1: Update AdapTable Sort Info
1530
1549
  * Action2: Set Selected Cells (on a debounce)
1531
1550
  */
1532
- this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_SORT_CHANGED, (this.listenerSortChanged = () => {
1551
+ this.agGridAdapter.getAgGridApi().addEventListener('sortChanged', (this.listenerSortChanged = () => {
1533
1552
  this.onSortChanged();
1534
1553
  this.debouncedSetSelectedCells();
1535
1554
  }));
1536
1555
  const eventsThatTriggerChartingChanges = [
1537
- core_1.Events.EVENT_CHART_CREATED,
1556
+ 'chartCreated',
1538
1557
  /** Chart Range selection has changed */
1539
- core_1.Events.EVENT_CHART_RANGE_SELECTION_CHANGED,
1558
+ 'chartRangeSelectionChanged',
1540
1559
  /** Chart Options have changed */
1541
- core_1.Events.EVENT_CHART_OPTIONS_CHANGED,
1560
+ 'chartOptionsChanged',
1542
1561
  /** Chart was destroyed */
1543
- core_1.Events.EVENT_CHART_DESTROYED,
1562
+ 'chartDestroyed',
1544
1563
  ];
1545
1564
  const chartingModule = this.ModuleService.getModuleById('Charting');
1546
1565
  if (chartingModule.isModuleAvailable()) {
@@ -1595,17 +1614,7 @@ class AdaptableAgGrid {
1595
1614
  }
1596
1615
  performAudit(action, oldState, newState) {
1597
1616
  if (this.isReady) {
1598
- const adaptableStateChangedInfo = {
1599
- adaptableApi: this.api,
1600
- actionName: action.type,
1601
- clientTimestamp: new Date(),
1602
- userName: this.adaptableOptions.userName,
1603
- adaptableId: this.adaptableOptions.adaptableId,
1604
- adaptableStateKey: this.adaptableOptions.adaptableStateKey,
1605
- action: action,
1606
- oldState: oldState,
1607
- newState: newState,
1608
- };
1617
+ const adaptableStateChangedInfo = Object.assign(Object.assign({ actionName: action.type, clientTimestamp: new Date() }, this.api.internalApi.buildBaseContext()), { adaptableStateKey: this.adaptableOptions.adaptableStateKey, action: action, oldState: oldState, newState: newState });
1609
1618
  this.api.eventApi.emit('AdaptableStateChanged', adaptableStateChangedInfo);
1610
1619
  }
1611
1620
  }
@@ -1640,10 +1649,8 @@ class AdaptableAgGrid {
1640
1649
  this.ChartingService = new ChartingService_1.ChartingService(this.api);
1641
1650
  this.ThemeService = new ThemeService_1.ThemeService(this.api);
1642
1651
  this.ValidationService = new ValidationService_1.ValidationService(this.api);
1643
- this.ReportService = new ReportService_1.ReportService(this.api);
1644
1652
  this.ModuleService = new ModuleService_1.ModuleService(this.api);
1645
1653
  this.CalculatedColumnExpressionService = new CalculatedColumnExpressionService_1.CalculatedColumnExpressionService(this.api);
1646
- this.EntitlementService = new EntitlementService_1.EntitlementService(this.api);
1647
1654
  this.QueryLanguageService = new QueryLanguageService_1.QueryLanguageService(this.api);
1648
1655
  this.AlertService = new AlertService_1.AlertService(this.api);
1649
1656
  this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this.api);
@@ -1717,20 +1724,27 @@ class AdaptableAgGrid {
1717
1724
  });
1718
1725
  }
1719
1726
  validatePrimaryKey() {
1727
+ var _a;
1720
1728
  if (this.hasAutogeneratedPrimaryKey) {
1721
1729
  return;
1722
1730
  }
1723
1731
  const primaryKey = this.adaptableOptions.primaryKey;
1732
+ // first check if there is a primary key column
1724
1733
  const primaryKeyColDef = this.agGridAdapter.getAgGridApi().getColumnDef(primaryKey);
1725
1734
  if (!primaryKeyColDef) {
1726
- const errorMessage = `The Primary Key Column '${this.adaptableOptions.primaryKey}' does not exist. This will affect many functions in Adaptable.`;
1727
- if (this.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert) {
1728
- // show an alert if that is the option
1729
- this.api.alertApi.showAlertError('No Primary Key', errorMessage);
1730
- }
1731
- else {
1732
- if (this.adaptableOptions.columnOptions.showMissingColumnsWarning) {
1733
- this.logger.consoleError(errorMessage);
1735
+ let errorMessage;
1736
+ // if no primary key column then lets check the first row to see if its a data item
1737
+ const primaryKeyDataItem = (_a = this.getFirstRowNode()) === null || _a === void 0 ? void 0 : _a.data[primaryKey];
1738
+ if (!primaryKeyDataItem) {
1739
+ errorMessage = `The Primary Key '${this.adaptableOptions.primaryKey}' does not exist. This will affect many functions in AdapTable.`;
1740
+ if (this.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert) {
1741
+ // show an alert if that is the option
1742
+ this.api.alertApi.showAlertError('No Primary Key', errorMessage);
1743
+ }
1744
+ else {
1745
+ if (this.adaptableOptions.columnOptions.showMissingColumnsWarning) {
1746
+ this.logger.consoleError(errorMessage);
1747
+ }
1734
1748
  }
1735
1749
  }
1736
1750
  }
@@ -1859,7 +1873,6 @@ class AdaptableAgGrid {
1859
1873
  return this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
1860
1874
  }
1861
1875
  getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
1862
- var _a;
1863
1876
  const isActionColumn = this.api.columnApi.isActionColumn(columnId);
1864
1877
  if (isActionColumn) {
1865
1878
  return this.getCleanValue(rawValue);
@@ -1875,8 +1888,7 @@ class AdaptableAgGrid {
1875
1888
  colDef,
1876
1889
  column,
1877
1890
  api: this.agGridAdapter.getAgGridApi(),
1878
- columnApi: (_a = this.agGridAdapter.getLiveGridOptions()) === null || _a === void 0 ? void 0 : _a.columnApi,
1879
- context: this.agGridAdapter.getLiveGridOptions().context,
1891
+ context: this.agGridAdapter.getGridOption('context'),
1880
1892
  };
1881
1893
  const formattedValue = colDef.valueFormatter(params);
1882
1894
  return formattedValue || '';
@@ -2301,7 +2313,7 @@ class AdaptableAgGrid {
2301
2313
  };
2302
2314
  }),
2303
2315
  layout: Object.assign(Object.assign({}, layout), { Columns: visibleColumnList }),
2304
- gridOptions: this.agGridAdapter.getLiveGridOptions(),
2316
+ groupDisplayType: this.agGridAdapter.getGridOption('groupDisplayType'),
2305
2317
  });
2306
2318
  }
2307
2319
  getDistinctValuesForColumn(column, distinctValuesParams) {
@@ -2443,8 +2455,8 @@ class AdaptableAgGrid {
2443
2455
  return this.agGridAdapter.getAgGridApi().getDisplayedRowAtIndex(index);
2444
2456
  }
2445
2457
  getAgGridStatusPanels() {
2446
- var _a, _b, _c;
2447
- return (_c = (_b = (_a = this.agGridAdapter.getLiveGridOptions()) === null || _a === void 0 ? void 0 : _a.statusBar) === null || _b === void 0 ? void 0 : _b.statusPanels) !== null && _c !== void 0 ? _c : [];
2458
+ var _a, _b;
2459
+ return (_b = (_a = this.agGridAdapter.getGridOption('statusBar')) === null || _a === void 0 ? void 0 : _a.statusPanels) !== null && _b !== void 0 ? _b : [];
2448
2460
  }
2449
2461
  setDataValue(value, column, primaryKeyValue, rowNode) {
2450
2462
  // note: because we use RowNode.setDataValue() this will cause Validation to fire
@@ -2942,35 +2954,35 @@ class AdaptableAgGrid {
2942
2954
  return this.agGridAdapter.getRegisteredModules();
2943
2955
  }
2944
2956
  destroy(config) {
2945
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
2957
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
2946
2958
  if (((_a = this.agGridAdapter) === null || _a === void 0 ? void 0 : _a.getAgGridApi()) && !this.agGridAdapter.getAgGridApi().isDestroyed()) {
2947
2959
  this.agGridAdapter
2948
2960
  .getAgGridApi()
2949
- .removeEventListener(core_1.Events.EVENT_FIRST_DATA_RENDERED, this.listenerFirstDataRendered);
2961
+ .removeEventListener('firstDataRendered', this.listenerFirstDataRendered);
2950
2962
  this.agGridAdapter
2951
2963
  .getAgGridApi()
2952
- .removeEventListener(core_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.listenerPivotModeChanged);
2964
+ .removeEventListener('columnPivotModeChanged', this.listenerPivotModeChanged);
2953
2965
  this.agGridAdapter
2954
2966
  .getAgGridApi()
2955
- .removeEventListener(core_1.Events.EVENT_COLUMN_PIVOT_CHANGED, this.listenerPivotChanged);
2967
+ .removeEventListener('columnPivotChanged', this.listenerPivotChanged);
2956
2968
  this.agGridAdapter
2957
2969
  .getAgGridApi()
2958
- .removeEventListener(core_1.Events.EVENT_CELL_EDITING_STARTED, this.listenerCellEditingStarted);
2970
+ .removeEventListener('cellEditingStarted', this.listenerCellEditingStarted);
2959
2971
  this.agGridAdapter
2960
2972
  .getAgGridApi()
2961
- .removeEventListener(core_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.listenerColumnRowGroupChanged);
2973
+ .removeEventListener('columnRowGroupChanged', this.listenerColumnRowGroupChanged);
2962
2974
  this.agGridAdapter
2963
2975
  .getAgGridApi()
2964
- .removeEventListener(core_1.Events.EVENT_RANGE_SELECTION_CHANGED, this.listenerRangeSelectionChanged);
2976
+ .removeEventListener('rangeSelectionChanged', this.listenerRangeSelectionChanged);
2965
2977
  this.agGridAdapter
2966
2978
  .getAgGridApi()
2967
- .removeEventListener(core_1.Events.EVENT_COLUMN_RESIZED, this.listenerColumnResized);
2979
+ .removeEventListener('columnResized', this.listenerColumnResized);
2968
2980
  this.agGridAdapter
2969
2981
  .getAgGridApi()
2970
- .removeEventListener(core_1.Events.EVENT_SORT_CHANGED, this.listenerSortChanged);
2982
+ .removeEventListener('sortChanged', this.listenerSortChanged);
2971
2983
  this.agGridAdapter
2972
2984
  .getAgGridApi()
2973
- .removeEventListener(core_1.Events.EVENT_MODEL_UPDATED, this.listenerModelUpdated);
2985
+ .removeEventListener('modelUpdated', this.listenerModelUpdated);
2974
2986
  this.agGridAdapter.getAgGridApi().removeGlobalListener(this.listenerGlobalSetRowSelection);
2975
2987
  this.agGridAdapter
2976
2988
  .getAgGridApi()
@@ -2996,7 +3008,7 @@ class AdaptableAgGrid {
2996
3008
  this.listenerGlobalRowGroupEventsThatTriggerAutoLayoutSave = null;
2997
3009
  this.throttleFilterOnEditDataChange = null;
2998
3010
  this.throttleFilterOnTickingDataChange = null;
2999
- const liveGridOptions = this.agGridAdapter.getLiveGridOptions();
3011
+ const liveGridOptions = this.DANGER_getPrivateAgGridBeans().gridOptions;
3000
3012
  if (liveGridOptions) {
3001
3013
  this.agGridOptionsService.revertGridOptionsPropertiesToUserValue(liveGridOptions, [
3002
3014
  'aggFuncs',
@@ -3024,6 +3036,7 @@ class AdaptableAgGrid {
3024
3036
  }
3025
3037
  }
3026
3038
  }
3039
+ DANGER_AG_GRID_BEANS_MAP[this._agGridId] = null;
3027
3040
  if ((config === null || config === void 0 ? void 0 : config.destroyApi) === true) {
3028
3041
  (_b = this.agGridAdapter.getAgGridApi()) === null || _b === void 0 ? void 0 : _b.destroy();
3029
3042
  }
@@ -3073,27 +3086,23 @@ class AdaptableAgGrid {
3073
3086
  this.CalculatedColumnExpressionService = null;
3074
3087
  (_o = (_m = this.DataService) === null || _m === void 0 ? void 0 : _m.destroy) === null || _o === void 0 ? void 0 : _o.call(_m);
3075
3088
  this.DataService = null;
3076
- (_q = (_p = this.EntitlementService) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
3077
- this.EntitlementService = null;
3078
- (_s = (_r = this.Fdc3Service) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
3089
+ (_q = (_p = this.Fdc3Service) === null || _p === void 0 ? void 0 : _p.destroy) === null || _q === void 0 ? void 0 : _q.call(_p);
3079
3090
  this.Fdc3Service = null;
3080
- (_u = (_t = this.ReportService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
3081
- this.ReportService = null;
3082
- (_w = (_v = this.ModuleService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
3091
+ (_s = (_r = this.ModuleService) === null || _r === void 0 ? void 0 : _r.destroy) === null || _s === void 0 ? void 0 : _s.call(_r);
3083
3092
  this.ModuleService = null;
3084
- (_y = (_x = this.ValidationService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
3093
+ (_u = (_t = this.ValidationService) === null || _t === void 0 ? void 0 : _t.destroy) === null || _u === void 0 ? void 0 : _u.call(_t);
3085
3094
  this.ValidationService = null;
3086
- (_0 = (_z = this.QueryLanguageService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
3095
+ (_w = (_v = this.QueryLanguageService) === null || _v === void 0 ? void 0 : _v.destroy) === null || _w === void 0 ? void 0 : _w.call(_v);
3087
3096
  this.QueryLanguageService = null;
3088
- (_2 = (_1 = this.AlertService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
3097
+ (_y = (_x = this.AlertService) === null || _x === void 0 ? void 0 : _x.destroy) === null || _y === void 0 ? void 0 : _y.call(_x);
3089
3098
  this.AlertService = null;
3090
- (_4 = (_3 = this.TeamSharingService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
3099
+ (_0 = (_z = this.TeamSharingService) === null || _z === void 0 ? void 0 : _z.destroy) === null || _0 === void 0 ? void 0 : _0.call(_z);
3091
3100
  this.TeamSharingService = null;
3092
- (_6 = (_5 = this.RowEditService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
3101
+ (_2 = (_1 = this.RowEditService) === null || _1 === void 0 ? void 0 : _1.destroy) === null || _2 === void 0 ? void 0 : _2.call(_1);
3093
3102
  this.RowEditService = null;
3094
- (_8 = (_7 = this.MetamodelService) === null || _7 === void 0 ? void 0 : _7.destroy) === null || _8 === void 0 ? void 0 : _8.call(_7);
3103
+ (_4 = (_3 = this.MetamodelService) === null || _3 === void 0 ? void 0 : _3.destroy) === null || _4 === void 0 ? void 0 : _4.call(_3);
3095
3104
  this.MetamodelService = null;
3096
- (_10 = (_9 = this.LicenseService) === null || _9 === void 0 ? void 0 : _9.destroy) === null || _10 === void 0 ? void 0 : _10.call(_9);
3105
+ (_6 = (_5 = this.LicenseService) === null || _5 === void 0 ? void 0 : _5.destroy) === null || _6 === void 0 ? void 0 : _6.call(_5);
3097
3106
  this.LicenseService = null;
3098
3107
  }
3099
3108
  canExportToExcel() {
@@ -3146,13 +3155,13 @@ class AdaptableAgGrid {
3146
3155
  }
3147
3156
  exportVisualDataToExcel() {
3148
3157
  try {
3149
- const exportExcelStyles = this.ReportService.buildExcelStylesForVisualReports();
3158
+ const exportExcelStyles = this.api.exportApi.internalApi.buildExcelStylesForVisualReports();
3150
3159
  // set DANGER_excelStyles without changing the array reference
3151
3160
  this.DANGER_excelStyles.splice(0, this.DANGER_excelStyles.length, ...exportExcelStyles);
3152
3161
  // this.agGridOptionsService.CAREFUL_patchGridOptionsProperty('excelStyles', exportExcelStyles);
3153
3162
  this.agGridAdapter.getAgGridApi().exportDataAsExcel({
3154
3163
  sheetName: 'Sheet 1',
3155
- fileName: this.ReportService.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
3164
+ fileName: this.api.exportApi.internalApi.getReportFileName(this.adaptableOptions.adaptableId, 'Excel'),
3156
3165
  // delegate the cell value processing to Adaptable
3157
3166
  processCellCallback: ({ node, column, value }) => {
3158
3167
  var _a;
@@ -3211,18 +3220,18 @@ class AdaptableAgGrid {
3211
3220
  rawValue = dateRawValue;
3212
3221
  }
3213
3222
  }
3214
- return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
3223
+ return this.api.exportApi.internalApi.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
3215
3224
  }
3216
3225
  processCellForExcelExport(rowNode, columnId) {
3217
3226
  if (this.api.exportApi.internalApi.isVisualDataExportInProgress()) {
3218
3227
  const cellKey = this.agGridColumnAdapter.getExcelClassNameForCell(columnId, this.getPrimaryKeyValueFromRowNode(rowNode));
3219
- const isoFormattedDate = this.ReportService.getExcelStyleWithFormattedDate(cellKey);
3228
+ const isoFormattedDate = this.api.exportApi.internalApi.getExcelStyleWithFormattedDate(cellKey);
3220
3229
  if (isoFormattedDate) {
3221
3230
  // this is a Date cell which will be formatted by Excel
3222
3231
  return isoFormattedDate;
3223
3232
  }
3224
3233
  }
3225
- return this.ReportService.getCellExportValueFromRowNode(rowNode, columnId);
3234
+ return this.api.exportApi.internalApi.getCellExportValueFromRowNode(rowNode, columnId);
3226
3235
  }
3227
3236
  isQuickFilterAvailable() {
3228
3237
  if (this.api.layoutApi.isCurrentLayoutPivot() &&
@@ -4013,8 +4022,11 @@ class AdaptableAgGrid {
4013
4022
  }
4014
4023
  // we need to intercept some of the GridOptions updates and refresh the Adaptable state
4015
4024
  monkeyPatchingGridOptionsUpdates(agGridApi) {
4016
- // @ts-ignore
4017
- const gridOptionsService = agGridApi.gos;
4025
+ var _a;
4026
+ const gridOptionsService = (_a = this.DANGER_getPrivateAgGridBeans()) === null || _a === void 0 ? void 0 : _a.gos;
4027
+ if (!gridOptionsService) {
4028
+ this.logger.consoleError('Could not get hold of GridOptionsService! This is a critical error and will prevent Adaptable from working correctly.');
4029
+ }
4018
4030
  const self = this;
4019
4031
  gridOptionsService.updateGridOptions = function ({ options, force, source = 'api', }) {
4020
4032
  // `columnDefs`
@@ -4044,5 +4056,12 @@ class AdaptableAgGrid {
4044
4056
  GridOptionsService_updateGridOptions.apply(this, arguments);
4045
4057
  };
4046
4058
  }
4059
+ DANGER_getPrivateAgGridBeans() {
4060
+ const beans = DANGER_AG_GRID_BEANS_MAP[this._agGridId];
4061
+ if (!beans) {
4062
+ this.logger.consoleError('Could not get hold of AgGridBeans! This is a critical error and will prevent Adaptable from working correctly.');
4063
+ }
4064
+ return beans;
4065
+ }
4047
4066
  }
4048
4067
  exports.AdaptableAgGrid = AdaptableAgGrid;