@adaptabletools/adaptable 19.1.0 → 19.1.2-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 (154) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -5
  3. package/src/AdaptableOptions/AlertOptions.d.ts +3 -0
  4. package/src/AdaptableOptions/ColumnMenuOptions.d.ts +1 -1
  5. package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
  6. package/src/AdaptableOptions/NoteOptions.d.ts +2 -2
  7. package/src/Api/AdaptableApi.d.ts +21 -11
  8. package/src/Api/Events/GridDataChanged.d.ts +3 -0
  9. package/src/Api/GridApi.d.ts +8 -3
  10. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +0 -2
  11. package/src/Api/Implementation/ActionColumnApiImpl.js +1 -4
  12. package/src/Api/Implementation/ActionRowApiImpl.d.ts +1 -1
  13. package/src/Api/Implementation/ActionRowApiImpl.js +4 -4
  14. package/src/Api/Implementation/AdaptableApiImpl.d.ts +5 -6
  15. package/src/Api/Implementation/AdaptableApiImpl.js +7 -1
  16. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
  17. package/src/Api/Implementation/AlertApiImpl.js +16 -15
  18. package/src/Api/Implementation/ApiBase.d.ts +12 -3
  19. package/src/Api/Implementation/ApiBase.js +39 -24
  20. package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +1 -1
  21. package/src/Api/Implementation/CalculatedColumnApiImpl.js +3 -3
  22. package/src/Api/Implementation/CalendarApiImpl.js +1 -1
  23. package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -1
  24. package/src/Api/Implementation/ChartingApiImpl.js +9 -9
  25. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  26. package/src/Api/Implementation/ColumnApiImpl.js +18 -18
  27. package/src/Api/Implementation/ColumnFilterApiImpl.d.ts +1 -1
  28. package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
  29. package/src/Api/Implementation/ColumnMenuApiImpl.d.ts +0 -2
  30. package/src/Api/Implementation/ColumnMenuApiImpl.js +2 -5
  31. package/src/Api/Implementation/CommentsApiImpl.d.ts +1 -1
  32. package/src/Api/Implementation/CommentsApiImpl.js +6 -4
  33. package/src/Api/Implementation/ConfigApiImpl.js +23 -24
  34. package/src/Api/Implementation/ContextMenuApiImpl.d.ts +0 -2
  35. package/src/Api/Implementation/ContextMenuApiImpl.js +1 -4
  36. package/src/Api/Implementation/CustomSortApiImpl.d.ts +1 -1
  37. package/src/Api/Implementation/CustomSortApiImpl.js +3 -3
  38. package/src/Api/Implementation/DashboardApiImpl.d.ts +1 -1
  39. package/src/Api/Implementation/DashboardApiImpl.js +5 -5
  40. package/src/Api/Implementation/DataImportApiImpl.d.ts +1 -1
  41. package/src/Api/Implementation/DataImportApiImpl.js +3 -3
  42. package/src/Api/Implementation/DataSetApiImpl.d.ts +1 -1
  43. package/src/Api/Implementation/DataSetApiImpl.js +5 -5
  44. package/src/Api/Implementation/EntitlementApiImpl.d.ts +1 -1
  45. package/src/Api/Implementation/EntitlementApiImpl.js +5 -5
  46. package/src/Api/Implementation/EventApiImpl.d.ts +1 -1
  47. package/src/Api/Implementation/EventApiImpl.js +2 -2
  48. package/src/Api/Implementation/ExportApiImpl.d.ts +1 -1
  49. package/src/Api/Implementation/ExportApiImpl.js +7 -7
  50. package/src/Api/Implementation/ExpressionApiImpl.d.ts +1 -1
  51. package/src/Api/Implementation/ExpressionApiImpl.js +5 -5
  52. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +1 -1
  53. package/src/Api/Implementation/Fdc3ApiImpl.js +4 -4
  54. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +1 -1
  55. package/src/Api/Implementation/FlashingCellApiImpl.js +7 -7
  56. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -1
  57. package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
  58. package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +1 -1
  59. package/src/Api/Implementation/FreeTextColumnApiImpl.js +4 -4
  60. package/src/Api/Implementation/GridApiImpl.d.ts +3 -2
  61. package/src/Api/Implementation/GridApiImpl.js +108 -103
  62. package/src/Api/Implementation/GridFilterApiImpl.d.ts +1 -1
  63. package/src/Api/Implementation/GridFilterApiImpl.js +4 -4
  64. package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -1
  65. package/src/Api/Implementation/LayoutApiImpl.js +3 -3
  66. package/src/Api/Implementation/NamedQueryApiImpl.d.ts +1 -1
  67. package/src/Api/Implementation/NamedQueryApiImpl.js +3 -3
  68. package/src/Api/Implementation/NoteApiImpl.d.ts +1 -1
  69. package/src/Api/Implementation/NoteApiImpl.js +3 -3
  70. package/src/Api/Implementation/OptionsApiImpl.js +7 -7
  71. package/src/Api/Implementation/PluginsApiImpl.js +1 -1
  72. package/src/Api/Implementation/PlusMinusApiImpl.js +1 -1
  73. package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -1
  74. package/src/Api/Implementation/PredicateApiImpl.js +4 -4
  75. package/src/Api/Implementation/ScheduleApiImpl.d.ts +1 -1
  76. package/src/Api/Implementation/ScheduleApiImpl.js +3 -3
  77. package/src/Api/Implementation/SettingsPanelApiImpl.js +1 -1
  78. package/src/Api/Implementation/StatusBarApiImpl.js +1 -1
  79. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +1 -1
  80. package/src/Api/Implementation/StyledColumnApiImpl.js +4 -4
  81. package/src/Api/Implementation/SystemStatusApiImpl.d.ts +1 -1
  82. package/src/Api/Implementation/SystemStatusApiImpl.js +4 -4
  83. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +1 -1
  84. package/src/Api/Implementation/TeamSharingApiImpl.js +11 -11
  85. package/src/Api/Implementation/ThemeApiImpl.d.ts +1 -1
  86. package/src/Api/Implementation/ThemeApiImpl.js +8 -8
  87. package/src/Api/Implementation/ToolPanelApiImpl.js +2 -2
  88. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -1
  89. package/src/Api/Implementation/UserInterfaceApiImpl.js +5 -5
  90. package/src/Api/Internal/ActionRowInternalApi.js +8 -8
  91. package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -0
  92. package/src/Api/Internal/AdaptableInternalApi.js +55 -50
  93. package/src/Api/Internal/AlertInternalApi.js +9 -9
  94. package/src/Api/Internal/CalculatedColumnInternalApi.js +11 -9
  95. package/src/Api/Internal/ChartingInternalApi.js +1 -1
  96. package/src/Api/Internal/ColumnFilterInternalApi.js +7 -9
  97. package/src/Api/Internal/ColumnInternalApi.js +3 -3
  98. package/src/Api/Internal/CommentsInternalApi.d.ts +1 -0
  99. package/src/Api/Internal/CommentsInternalApi.js +4 -0
  100. package/src/Api/Internal/CustomSortInternalApi.js +3 -3
  101. package/src/Api/Internal/DashboardInternalApi.js +4 -3
  102. package/src/Api/Internal/DataImportInternalApi.js +2 -2
  103. package/src/Api/Internal/DataSetInternalApi.js +2 -2
  104. package/src/Api/Internal/ExportInternalApi.js +21 -22
  105. package/src/Api/Internal/ExpressionInternalApi.js +4 -4
  106. package/src/Api/Internal/Fdc3InternalApi.d.ts +0 -1
  107. package/src/Api/Internal/Fdc3InternalApi.js +9 -12
  108. package/src/Api/Internal/FlashingCellInternalApi.js +2 -2
  109. package/src/Api/Internal/FormatColumnInternalApi.js +2 -3
  110. package/src/Api/Internal/FreeTextColumnInternalApi.js +5 -2
  111. package/src/Api/Internal/GridFilterInternalApi.js +2 -2
  112. package/src/Api/Internal/GridInternalApi.js +26 -26
  113. package/src/Api/Internal/LayoutInternalApi.js +6 -5
  114. package/src/Api/Internal/NamedQueryInternalApi.js +2 -2
  115. package/src/Api/Internal/NoteInternalApi.d.ts +1 -0
  116. package/src/Api/Internal/NoteInternalApi.js +4 -0
  117. package/src/Api/Internal/PredicateInternalApi.js +5 -5
  118. package/src/Api/Internal/ScheduleInternalApi.js +1 -1
  119. package/src/Api/Internal/StyledColumnInternalApi.js +2 -2
  120. package/src/Api/Internal/SystemStatusInternalApi.js +1 -1
  121. package/src/Api/Internal/TeamSharingInternalApi.js +2 -2
  122. package/src/Api/Internal/ThemeInternalApi.js +1 -1
  123. package/src/PredefinedConfig/Common/ExtendedLayoutInfo.d.ts +15 -0
  124. package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +3 -0
  125. package/src/Strategy/NoteModule.d.ts +0 -1
  126. package/src/Strategy/NoteModule.js +4 -5
  127. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
  128. package/src/Utilities/Services/AggregatedScalarLiveValue.js +1 -1
  129. package/src/Utilities/Services/CellPopupService.js +4 -4
  130. package/src/Utilities/Services/Fdc3Service.js +1 -3
  131. package/src/Utilities/Services/FlashingCellService.d.ts +0 -2
  132. package/src/Utilities/Services/FlashingCellService.js +2 -3
  133. package/src/Utilities/Services/RowEditService.js +3 -5
  134. package/src/View/Alert/AlertStatusSubPanel.js +4 -4
  135. package/src/View/Charting/ShowChartButton.js +4 -4
  136. package/src/View/Comments/CommentsEditor.js +2 -2
  137. package/src/View/Comments/CommentsPopup.js +1 -4
  138. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  139. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +14 -13
  140. package/src/View/Layout/TransposedPopup.js +2 -2
  141. package/src/View/Note/NotePopup.js +1 -4
  142. package/src/agGrid/AdaptableAgGrid.d.ts +2 -5
  143. package/src/agGrid/AdaptableAgGrid.js +47 -26
  144. package/src/agGrid/AgGridAdapter.js +3 -3
  145. package/src/agGrid/FloatingFilterWrapper.js +4 -3
  146. package/src/agGrid/defaultAdaptableOptions.js +100 -96
  147. package/src/components/Datepicker/index.d.ts +1 -1
  148. package/src/components/ExpressionEditor/DataTableEditor.js +3 -3
  149. package/src/components/ExpressionEditor/ExpressionPreview.js +4 -4
  150. package/src/env.js +2 -2
  151. package/src/metamodel/adaptable.metamodel.d.ts +32 -0
  152. package/src/metamodel/adaptable.metamodel.js +1 -1
  153. package/src/types.d.ts +1 -1
  154. package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "19.1.0",
3
+ "version": "19.1.2-canary.0",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ChartModel, ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
3
- import { AdaptableApi } from '../Api/AdaptableApi';
3
+ import { AdaptableApi, DestroyConfig } from '../Api/AdaptableApi';
4
4
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
5
5
  import { ColumnSort } from '../PredefinedConfig/Common/ColumnSort';
6
6
  import { DataUpdateConfig } from '../PredefinedConfig/Common/DataUpdateConfig';
@@ -262,10 +262,7 @@ export interface IAdaptable {
262
262
  getAgGridColumnForColumnId(columnId: string): Column;
263
263
  getMinMaxCachedValueForColumn(column: AdaptableColumn, minMax: 'min' | 'max'): number | undefined;
264
264
  getAgGridRegisteredModules(): Module[];
265
- destroy(config?: {
266
- unmount: boolean;
267
- destroyApi?: boolean;
268
- }): void;
265
+ destroy(config?: DestroyConfig): void;
269
266
  setLayout(layout?: Layout): void;
270
267
  canExportToExcel(): boolean;
271
268
  exportToExcel(reportData: ReportData, fileName: string): void;
@@ -68,6 +68,9 @@ export interface AlertOptions<TData = any> {
68
68
  */
69
69
  showMissingPrimaryKeyAlert?: boolean;
70
70
  }
71
+ /**
72
+ * Cell Change that will trigger an Alert: can be 'rawValue' or 'formattedValue'
73
+ */
71
74
  export type DataChangeDetectionPolicy = 'rawValue' | 'formattedValue';
72
75
  /**
73
76
  * Handles a Form Button Action
@@ -91,4 +91,4 @@ export interface UserColumnMenuItem {
91
91
  /**
92
92
  * Defines AG Grid Column Menu Items
93
93
  */
94
- export type AgGridColumnMenuItemType = 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
94
+ export type AgGridColumnMenuItemType = 'sortAscending' | 'sortDescending' | 'sortUnSort' | 'columnFilter' | 'columnChooser' | 'pinSubMenu' | 'valueAggSubMenu' | 'autoSizeThis' | 'autoSizeAll' | 'rowGroup' | 'rowUnGroup' | 'resetColumns' | 'expandAll' | 'contractAll' | 'separator';
@@ -17,11 +17,11 @@ export interface CommentOptions<TData = any> {
17
17
  */
18
18
  persistCommentThreads?(commentThreads: CommentThread[]): Promise<void>;
19
19
  /**
20
- * Format string for dates in Comments Popup
20
+ * Format string for Dates in Comments Popup
21
21
  *
22
22
  * @defaultValue 'dd-MM-yyyy HH:mm:ss'
23
23
  */
24
- dateFormat?: string;
24
+ dateFormat?: string | (() => string);
25
25
  /**
26
26
  * Show the Close Button in the Comments Popup
27
27
  * @defaultValue true
@@ -8,11 +8,11 @@ export interface NoteOptions<TData = any> {
8
8
  */
9
9
  isCellNotable?: (context: NotableCellContext) => boolean;
10
10
  /**
11
- * Format string for formatting in the Notes Popup
11
+ * Format string for Dates in Notes Popup
12
12
  *
13
13
  * @defaultValue 'dd-MM-yyyy HH:mm:ss'
14
14
  */
15
- dateFormat?: string;
15
+ dateFormat?: string | (() => string);
16
16
  /**
17
17
  * Show the Close Button in the Notes Popup
18
18
  *
@@ -258,23 +258,33 @@ export interface AdaptableApi {
258
258
  */
259
259
  gridFilterApi: GridFilterApi;
260
260
  /**
261
- * Cleanup method - should be called only when using the vanilla javascript component, as framework components cleanup is performed when the component is destroyed/unmounted.
262
- * This destroys the Adaptable instance.
261
+ * 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.
262
+ * @param config - optional configuration object
263
263
  */
264
- destroy: (config?: {
265
- unmount: boolean;
266
- destroyApi?: boolean;
267
- }) => void;
264
+ destroy: (config?: DestroyConfig) => void;
268
265
  /**
269
266
  * Whether the Adaptable instance has been destroyed
270
267
  */
271
268
  isDestroyed: () => boolean;
269
+ }
270
+ /**
271
+ * Adaptable Destroy Configuration
272
+ */
273
+ export interface DestroyConfig {
274
+ /**
275
+ * Unmount the Adaptable component (Dashboard)
276
+ *
277
+ * @defaultValue true
278
+ */
279
+ unmount: boolean;
280
+ /**
281
+ * @deprecated use `destroyAgGrid` instead
282
+ */
283
+ destroyApi?: boolean;
272
284
  /**
273
- * Cleanup method that only cleans up this api instance (clears event listeners and sets every property to null), but does not destroy the Adaptable instance.
285
+ * Destroy the AgGrid instance
274
286
  *
287
+ * @defaultValue true
275
288
  */
276
- internalDestroySelf: (config?: {
277
- unmount: boolean;
278
- destroyApi?: boolean;
279
- }) => void;
289
+ destroyAgGrid: boolean;
280
290
  }
@@ -1,5 +1,8 @@
1
1
  import { IRowNode } from '@ag-grid-community/core';
2
2
  import { BaseEventInfo } from './BaseEventInfo';
3
+ /**
4
+ * What row action triggered the Grid change: 'Add', 'Update', 'Delete' or 'Load'
5
+ */
3
6
  export type GridDataChangeTrigger = 'Add' | 'Update' | 'Delete' | 'Load';
4
7
  /**
5
8
  * EventInfo returned by GridDataChanged event
@@ -456,7 +456,12 @@ export interface GridApi {
456
456
  * @param rowNodes agGrid RowNodes which contain cells to refresh
457
457
  * @param columnIds ColumnIds which contain cells to refresh
458
458
  */
459
- refreshCells(rowNodes: IRowNode[], columnIds: string[]): void;
459
+ refreshCells(rowNodes: IRowNode[], columnIds: string[], suppressFlash?: boolean): void;
460
+ /**
461
+ * Refreshes all Cells in the Grid
462
+ * @param forceUpdate forces AG Grid change detection
463
+ */
464
+ refreshAllCells(forceUpdate?: boolean): void;
460
465
  /**
461
466
  * Refreshes a single Grid Cell
462
467
  * @param gridCell GridCell to refresh
@@ -468,7 +473,7 @@ export interface GridApi {
468
473
  */
469
474
  refreshGridCells(gridCells: GridCell[]): void;
470
475
  /**
471
- * Forces a re-render of the row with the given primary key value
476
+ * Forces a re-render of Row with given Primary Key value
472
477
  * @param primaryKey row primary key
473
478
  */
474
479
  refreshRowByPrimaryKey(primaryKey: any): void;
@@ -503,7 +508,7 @@ export interface GridApi {
503
508
  */
504
509
  getVisibleColumnCount(): number;
505
510
  /**
506
- * Destroys current AdapTable instance
511
+ * @deprecated use `AdaptableApi.destroy()` instead
507
512
  */
508
513
  destroy(): void;
509
514
  /**
@@ -1,9 +1,7 @@
1
1
  import { ActionColumn, ActionColumnApi } from '../../../types';
2
2
  import { ApiBase } from './ApiBase';
3
- import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
4
3
  import { ColDef } from '@ag-grid-community/core';
5
4
  export declare class ActionColumnApiImpl extends ApiBase implements ActionColumnApi {
6
- constructor(adaptable: IAdaptable);
7
5
  getActionColumns(): ActionColumn[];
8
6
  getColDefsForActionColumns(): ColDef[];
9
7
  }
@@ -2,9 +2,6 @@ import { ApiBase } from './ApiBase';
2
2
  import { ActionColumnRenderer, ReactActionColumnRenderer } from '../../agGrid/ActionColumnRenderer';
3
3
  import { AB_SPECIAL_COLUMN } from '../../Utilities/Constants/GeneralConstants';
4
4
  export class ActionColumnApiImpl extends ApiBase {
5
- constructor(adaptable) {
6
- super(adaptable);
7
- }
8
5
  getActionColumns() {
9
6
  var _a;
10
7
  return (_a = this.getActionColumnOptions().actionColumns) !== null && _a !== void 0 ? _a : [];
@@ -28,7 +25,7 @@ export class ActionColumnApiImpl extends ApiBase {
28
25
  filter: false,
29
26
  sortable: false,
30
27
  enableRowGroup: false,
31
- cellRenderer: this.getAdaptableApi().internalApi.getAdaptableInstance().variant === 'react'
28
+ cellRenderer: this.getGridApi().getVariant() === 'react'
32
29
  ? ReactActionColumnRenderer
33
30
  : ActionColumnRenderer,
34
31
  type: [AB_SPECIAL_COLUMN, 'abColDefObject'],
@@ -4,7 +4,7 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
4
4
  import { ActionRowInternalApi } from '../Internal/ActionRowInternalApi';
5
5
  export declare class ActionRowApiImpl extends ApiBase implements ActionRowApi {
6
6
  internalApi: ActionRowInternalApi;
7
- constructor(adaptable: IAdaptable);
7
+ constructor(_adaptable: IAdaptable);
8
8
  getActionRowButtons(): ActionRowButtonType[];
9
9
  displayEditActionRow(primaryKey: any): void;
10
10
  displayCreateActionRow(): void;
@@ -2,14 +2,14 @@ import { PopupShowForm } from '../../Redux/ActionsReducers/PopupRedux';
2
2
  import { ApiBase } from './ApiBase';
3
3
  import { ActionRowInternalApi } from '../Internal/ActionRowInternalApi';
4
4
  export class ActionRowApiImpl extends ApiBase {
5
- constructor(adaptable) {
6
- super(adaptable);
7
- this.internalApi = new ActionRowInternalApi(adaptable);
5
+ constructor(_adaptable) {
6
+ super(_adaptable);
7
+ this.internalApi = new ActionRowInternalApi(_adaptable);
8
8
  }
9
9
  getActionRowButtons() {
10
10
  var actionRowButtons = this.getActionRowOptions().actionRowButtons;
11
11
  if (typeof actionRowButtons === 'function') {
12
- const context = this.getAdaptableApi().internalApi.buildBaseContext();
12
+ const context = this.getAdaptableInternalApi().buildBaseContext();
13
13
  actionRowButtons = actionRowButtons(context);
14
14
  }
15
15
  return actionRowButtons !== null && actionRowButtons !== void 0 ? actionRowButtons : [];
@@ -1,6 +1,6 @@
1
1
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
2
  import { AdaptableInternalApi } from '../Internal/AdaptableInternalApi';
3
- import { AdaptableApi, ColumnMenuApi, ContextMenuApi, DataImportApi, NamedQueryApi, OptionsApi, SettingsPanelApi } from '../../types';
3
+ import { AdaptableApi, ColumnMenuApi, ContextMenuApi, DataImportApi, DestroyConfig, NamedQueryApi, OptionsApi, SettingsPanelApi } from '../../types';
4
4
  import { AlertApi } from '../AlertApi';
5
5
  import { BulkUpdateApi } from '../BulkUpdateApi';
6
6
  import { CalendarApi } from '../CalendarApi';
@@ -104,16 +104,15 @@ export declare class AdaptableApiImpl implements AdaptableApi {
104
104
  /**
105
105
  * This is only meant to be called by the Adaptable instance.
106
106
  */
107
- internalDestroySelf(): void;
108
- destroy(config?: {
109
- unmount: boolean;
110
- destroyApi?: boolean;
111
- }): void;
107
+ _internalDestroySelf(): void;
108
+ destroy(config?: DestroyConfig): void;
112
109
  isDestroyed(): boolean;
110
+ logConsoleMessage(message: string, ...optionalParams: any[]): void;
113
111
  logInfo(message: string, ...optionalParams: any[]): void;
114
112
  logSuccess(message: string, ...optionalParams: any[]): void;
115
113
  logWarn(message: string, ...optionalParams: any[]): void;
116
114
  logError(message: string, ...optionalParams: any[]): void;
115
+ consoleLog(message: string, ...optionalParams: any[]): void;
117
116
  consoleError(message: string, ...optionalParams: any[]): void;
118
117
  consoleWarn(message: string, ...optionalParams: any[]): void;
119
118
  }
@@ -113,7 +113,7 @@ export class AdaptableApiImpl {
113
113
  /**
114
114
  * This is only meant to be called by the Adaptable instance.
115
115
  */
116
- internalDestroySelf() {
116
+ _internalDestroySelf() {
117
117
  if (this.destroyed) {
118
118
  return;
119
119
  }
@@ -166,6 +166,9 @@ export class AdaptableApiImpl {
166
166
  isDestroyed() {
167
167
  return this.destroyed;
168
168
  }
169
+ logConsoleMessage(message, ...optionalParams) {
170
+ this.adaptable.logger.consoleLog(message, optionalParams);
171
+ }
169
172
  logInfo(message, ...optionalParams) {
170
173
  this.adaptable.logger.info(message, optionalParams);
171
174
  }
@@ -178,6 +181,9 @@ export class AdaptableApiImpl {
178
181
  logError(message, ...optionalParams) {
179
182
  this.adaptable.logger.error(message, optionalParams);
180
183
  }
184
+ consoleLog(message, ...optionalParams) {
185
+ this.adaptable.logger.consoleLog(message, optionalParams);
186
+ }
181
187
  consoleError(message, ...optionalParams) {
182
188
  this.adaptable.logger.consoleError(message, optionalParams);
183
189
  }
@@ -8,7 +8,7 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
8
8
  import { AlertInternalApi } from '../Internal/AlertInternalApi';
9
9
  export declare class AlertApiImpl extends ApiBase implements AlertApi {
10
10
  internalApi: AlertInternalApi;
11
- constructor(adaptable: IAdaptable);
11
+ constructor(_adaptable: IAdaptable);
12
12
  getAlertState(): AlertState;
13
13
  getAlertDefinitions(config?: LayoutAssociatedObjectLoadConfig): AlertDefinition[];
14
14
  getSuspendedAlertDefinitions(config?: {
@@ -8,9 +8,9 @@ import { isAdaptableCellChangedAlert, isAdaptableRowChangedAlert, } from '../../
8
8
  import StringExtensions from '../../Utilities/Extensions/StringExtensions';
9
9
  import { AlertInternalApi } from '../Internal/AlertInternalApi';
10
10
  export class AlertApiImpl extends ApiBase {
11
- constructor(adaptable) {
12
- super(adaptable);
13
- this.internalApi = new AlertInternalApi(adaptable);
11
+ constructor(_adaptable) {
12
+ super(_adaptable);
13
+ this.internalApi = new AlertInternalApi(_adaptable);
14
14
  }
15
15
  getAlertState() {
16
16
  return this.getAdaptableState().Alert;
@@ -43,7 +43,7 @@ export class AlertApiImpl extends ApiBase {
43
43
  this.addUidToAdaptableObject(alertToShow);
44
44
  this.dispatchAction(SystemRedux.SystemAlertAdd(alertToShow, this.getAlertOptions().maxAlertsInStore));
45
45
  // 2. Publish the Alert Fired Event
46
- const alertFiredInfo = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { alert: alertToShow });
46
+ const alertFiredInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { alert: alertToShow });
47
47
  const results = await this.getAdaptableApi().eventApi.emit('AlertFired', alertFiredInfo);
48
48
  const showPopup = results.reduce((endResult, aResult) => {
49
49
  return endResult && aResult !== false;
@@ -59,7 +59,7 @@ export class AlertApiImpl extends ApiBase {
59
59
  }
60
60
  // 2. Log to console
61
61
  if (alertProperties.LogToConsole) {
62
- this.adaptable.logger.consoleLogByMessageType(alertToShow.header + ': ' + alertToShow.message, alertDefinition.MessageType);
62
+ this.getAdatableLogger().consoleLogByMessageType(alertToShow.header + ': ' + alertToShow.message, alertDefinition.MessageType);
63
63
  }
64
64
  // 3. Show it in a Div (if one has been set)
65
65
  if (alertProperties.ShowInDiv) {
@@ -79,7 +79,7 @@ export class AlertApiImpl extends ApiBase {
79
79
  if (alertProperties.JumpToCell &&
80
80
  isAdaptableCellChangedAlert(alertToShow) &&
81
81
  alertToShow.cellDataChangedInfo) {
82
- this.adaptable.jumpToCell(alertToShow.cellDataChangedInfo.column.columnId, alertToShow.cellDataChangedInfo.rowNode);
82
+ this._adaptable.jumpToCell(alertToShow.cellDataChangedInfo.column.columnId, alertToShow.cellDataChangedInfo.rowNode);
83
83
  }
84
84
  // 5: Jump to the Row
85
85
  else if (alertProperties.JumpToRow &&
@@ -87,7 +87,7 @@ export class AlertApiImpl extends ApiBase {
87
87
  ((_a = alertToShow.gridDataChangedInfo) === null || _a === void 0 ? void 0 : _a.rowTrigger) === 'Add') {
88
88
  const [firstRowNode] = alertToShow.gridDataChangedInfo.rowNodes;
89
89
  if (firstRowNode) {
90
- this.adaptable.jumpToRow(firstRowNode);
90
+ this._adaptable.jumpToRow(firstRowNode);
91
91
  }
92
92
  }
93
93
  // 6: For CellChanged Alerts either Highlight the cell or row
@@ -97,20 +97,20 @@ export class AlertApiImpl extends ApiBase {
97
97
  (alertProperties.HighlightCell || alertProperties.HighlightRow)) {
98
98
  let alertNode = alertToShow.cellDataChangedInfo.rowNode;
99
99
  if (!alertNode) {
100
- alertNode = this.adaptable.getRowNodeForPrimaryKey(alertToShow.cellDataChangedInfo.primaryKeyValue);
100
+ alertNode = this.getGridApi().getRowNodeForPrimaryKey(alertToShow.cellDataChangedInfo.primaryKeyValue);
101
101
  }
102
102
  if (alertNode) {
103
103
  if (alertProperties.HighlightRow) {
104
104
  this.getAdaptableApi().gridApi.refreshRowNodes([alertNode]);
105
105
  setTimeout(() => {
106
106
  this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
107
- }, this.adaptable.adaptableOptions.alertOptions.rowHighlightDuration);
107
+ }, this.getAlertOptions().rowHighlightDuration);
108
108
  }
109
109
  if (alertProperties.HighlightCell) {
110
110
  this.getAdaptableApi().gridApi.refreshCells([alertNode], [alertToShow.cellDataChangedInfo.column.columnId]);
111
111
  setTimeout(() => {
112
112
  this.dispatchAction(SystemRedux.SystemAlertRemoveCellHighlight(alertToShow));
113
- }, this.adaptable.adaptableOptions.alertOptions.cellHighlightDuration);
113
+ }, this.getAlertOptions().cellHighlightDuration);
114
114
  }
115
115
  }
116
116
  }
@@ -121,7 +121,7 @@ export class AlertApiImpl extends ApiBase {
121
121
  this.getAdaptableApi().gridApi.refreshRowNodes(alertToShow.gridDataChangedInfo.rowNodes);
122
122
  setTimeout(() => {
123
123
  this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
124
- }, this.adaptable.adaptableOptions.alertOptions.rowHighlightDuration);
124
+ }, this.getAlertOptions().rowHighlightDuration);
125
125
  }
126
126
  }
127
127
  }
@@ -195,7 +195,7 @@ export class AlertApiImpl extends ApiBase {
195
195
  });
196
196
  }
197
197
  findAlertDefinitions(criteria) {
198
- return this.getAdaptableApi().internalApi.findAdaptableObjectsByLookupCriteria(criteria, this.getAlertDefinitions({
198
+ return this.getAdaptableInternalApi().findAdaptableObjectsByLookupCriteria(criteria, this.getAlertDefinitions({
199
199
  includeLayoutNotAssociatedObjects: true,
200
200
  }));
201
201
  }
@@ -220,11 +220,12 @@ export class AlertApiImpl extends ApiBase {
220
220
  }
221
221
  createCellDataChangeInfoStubs(relevantColumnIds) {
222
222
  const cellDataChangeInfos = [];
223
+ //const adaptable: IAdaptable = this.getAdaptableInternalApi().getAdaptableInstance();
223
224
  const relevantColumns = this.getAdaptableApi()
224
225
  .columnApi.getColumnsWithColumnIds(relevantColumnIds)
225
226
  .filter(Boolean);
226
227
  const changedAt = Date.now();
227
- this.adaptable.forAllRowNodesDo((rowNode) => {
228
+ this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
228
229
  relevantColumns.forEach((column) => {
229
230
  const cellDataChangeInfoStub = {
230
231
  changedAt,
@@ -232,8 +233,8 @@ export class AlertApiImpl extends ApiBase {
232
233
  column,
233
234
  rowData: rowNode.data,
234
235
  oldValue: null,
235
- newValue: this.adaptable.getRawValueFromRowNode(rowNode, column.columnId),
236
- primaryKeyValue: this.adaptable.getPrimaryKeyValueFromRowNode(rowNode),
236
+ newValue: this.getGridApi().getRawValueFromRowNode(rowNode, column.columnId),
237
+ primaryKeyValue: this.getGridApi().getPrimaryKeyValueForRowNode(rowNode),
237
238
  };
238
239
  cellDataChangeInfos.push(cellDataChangeInfoStub);
239
240
  });
@@ -6,21 +6,27 @@ import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
6
6
  import { ModuleInfo } from '../../Strategy/Interface/IModule';
7
7
  import { AdaptableOptions } from '../../AdaptableOptions/AdaptableOptions';
8
8
  import { AdaptableApi } from '../AdaptableApi';
9
+ import { GridApi as AgGridApi } from '@ag-grid-community/core';
9
10
  import { ExportOptions } from '../../AdaptableOptions/ExportOptions';
10
11
  import { ActionColumnApi, ActionColumnOptions, ActionRowApi, ActionRowOptions, AlertApi, AlertOptions, ApplicationApi, BulkUpdateApi, CalculatedColumnApi, CalendarApi, CalendarOptions, CellSummaryApi, CellSummaryOptions, ChartingApi, ChartingOptions, ColumnApi, ColumnFilterApi, ColumnFilterOptions, ColumnOptions, CommentOptions, ConfigApi, ContainerOptions, CustomSortApi, CustomSortOptions, DashboardApi, DashboardOptions, DataChangeHistoryApi, DataChangeHistoryOptions, DataSetApi, DataSetOptions, EditOptions, EntitlementApi, EntitlementOptions, EventApi, ExportApi, ExpressionApi, ExpressionOptions, Fdc3Api, Fdc3Options, FlashingCellApi, FlashingCellOptions, FormatColumnApi, FormatColumnOptions, FreeTextColumnApi, GridApi, GridFilterApi, GroupingOptions, LayoutApi, LayoutAssociatedObject, LayoutOptions, NamedQueryApi, NoteOptions, NotificationsOptions, PluginsApi, PlusMinusApi, PredicateApi, PredicateOptions, QuickSearchApi, QuickSearchOptions, ScheduleApi, ColumnScopeApi, SettingsPanelApi, SettingsPanelOptions, ShortcutApi, SmartEditApi, StateOptions, StatusBarApi, StyledColumnApi, SystemStatusApi, TeamSharingApi, TeamSharingOptions, ThemeApi, ToolPanelApi, ToolPanelOptions, UserInterfaceApi, UserInterfaceOptions, ColumnMenuOptions, ContextMenuOptions } from '../../types';
11
12
  import { ModuleParams } from '../../View/Components/SharedProps/ModuleViewPopupProps';
13
+ import { AdaptableInternalApi } from '../Internal/AdaptableInternalApi';
14
+ import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
15
+ import { IAdaptableStore } from '../../Redux/Store/Interface/IAdaptableStore';
12
16
  export declare abstract class ApiBase {
13
- protected adaptable: IAdaptable;
17
+ protected _adaptable: IAdaptable;
14
18
  /**
15
19
  * Constructor for all the api classes which simply takes and assigns an instance of Adaptable
16
- * @param adaptable the core IAdaptable object
20
+ * @param _adaptable the core IAdaptable object
17
21
  */
18
- constructor(adaptable: IAdaptable);
22
+ constructor(_adaptable: IAdaptable);
23
+ protected getAdatableLogger(): AdaptableLogger;
19
24
  protected logInfo(message: string, ...optionalParams: any[]): void;
20
25
  protected logSuccess(message: string, ...optionalParams: any[]): void;
21
26
  protected logWarn(message: string, ...optionalParams: any[]): void;
22
27
  protected logError(message: string, ...optionalParams: any[]): void;
23
28
  protected getAdaptableVariant(): AdaptableVariant;
29
+ protected isAdapTableReady(): boolean;
24
30
  /**
25
31
  * Base api helper method which ensure that Adaptable Object being used in the function is not null or undefined
26
32
  *
@@ -46,6 +52,7 @@ export declare abstract class ApiBase {
46
52
  * This is a simple *getState()* call
47
53
  */
48
54
  getAdaptableState(): AdaptableState;
55
+ protected getAdaptableSore(): IAdaptableStore;
49
56
  protected addUidToAdaptableObject(adaptableObject: AdaptableObject): void;
50
57
  protected getModuleInfoByModuleId(module: AdaptableModule): ModuleInfo;
51
58
  protected showModulePopup(module: AdaptableModule, moduleParams?: ModuleParams): void;
@@ -85,6 +92,8 @@ export declare abstract class ApiBase {
85
92
  protected getSettingsPanelOptions(): SettingsPanelOptions;
86
93
  protected getFdc3Options(): Fdc3Options;
87
94
  protected getAdaptableApi(): AdaptableApi;
95
+ protected getAgGridApi(): AgGridApi;
96
+ protected getAdaptableInternalApi(): AdaptableInternalApi;
88
97
  protected getActionColumnApi(): ActionColumnApi;
89
98
  protected getActionRowApi(): ActionRowApi;
90
99
  protected getApplicationApi(): ApplicationApi;
@@ -4,25 +4,31 @@ import { createUuid } from '../../PredefinedConfig/Uuid';
4
4
  export class ApiBase {
5
5
  /**
6
6
  * Constructor for all the api classes which simply takes and assigns an instance of Adaptable
7
- * @param adaptable the core IAdaptable object
7
+ * @param _adaptable the core IAdaptable object
8
8
  */
9
- constructor(adaptable) {
10
- this.adaptable = adaptable;
9
+ constructor(_adaptable) {
10
+ this._adaptable = _adaptable;
11
+ }
12
+ getAdatableLogger() {
13
+ return this._adaptable.logger;
11
14
  }
12
15
  logInfo(message, ...optionalParams) {
13
- this.adaptable.logger.info(message, ...optionalParams);
16
+ this._adaptable.logger.info(message, ...optionalParams);
14
17
  }
15
18
  logSuccess(message, ...optionalParams) {
16
- this.adaptable.logger.success(message, ...optionalParams);
19
+ this._adaptable.logger.success(message, ...optionalParams);
17
20
  }
18
21
  logWarn(message, ...optionalParams) {
19
- this.adaptable.logger.warn(message, ...optionalParams);
22
+ this._adaptable.logger.warn(message, ...optionalParams);
20
23
  }
21
24
  logError(message, ...optionalParams) {
22
- this.adaptable.logger.error(message, ...optionalParams);
25
+ this._adaptable.logger.error(message, ...optionalParams);
23
26
  }
24
27
  getAdaptableVariant() {
25
- return this.adaptable.variant;
28
+ return this._adaptable.variant;
29
+ }
30
+ isAdapTableReady() {
31
+ return this._adaptable.isReady;
26
32
  }
27
33
  /**
28
34
  * Base api helper method which ensure that Adaptable Object being used in the function is not null or undefined
@@ -51,19 +57,19 @@ export class ApiBase {
51
57
  return objectList;
52
58
  }
53
59
  const associatedLayout = (config === null || config === void 0 ? void 0 : config.associatedWithLayout)
54
- ? this.adaptable.api.layoutApi.getLayoutByName(config.associatedWithLayout)
60
+ ? this._adaptable.api.layoutApi.getLayoutByName(config.associatedWithLayout)
55
61
  : this.getAdaptableApi().layoutApi.getCurrentLayout();
56
- return objectList.filter((objectItem) => this.adaptable.api.layoutApi.internalApi.isObjectAvailableInLayout(objectItem, module, associatedLayout));
62
+ return objectList.filter((objectItem) => this._adaptable.api.layoutApi.internalApi.isObjectAvailableInLayout(objectItem, module, associatedLayout));
57
63
  }
58
64
  /**
59
65
  * Base api Helper method that dispatches a *Redux Action* to the Store
60
66
  * @param action the Redux Action to be dispatched
61
67
  */
62
68
  dispatchAction(action) {
63
- if (this.adaptable.isDestroyed) {
69
+ if (this._adaptable.isDestroyed) {
64
70
  return;
65
71
  }
66
- this.adaptable.adaptableStore.TheStore.dispatch(action);
72
+ this._adaptable.adaptableStore.TheStore.dispatch(action);
67
73
  }
68
74
  /**
69
75
  * Returns the entire State from the Store
@@ -71,7 +77,10 @@ export class ApiBase {
71
77
  * This is a simple *getState()* call
72
78
  */
73
79
  getAdaptableState() {
74
- return this.adaptable.adaptableStore.TheStore.getState();
80
+ return this.getAdaptableSore().TheStore.getState();
81
+ }
82
+ getAdaptableSore() {
83
+ return this._adaptable.adaptableStore;
75
84
  }
76
85
  // Add the Uuid to the object if not present;
77
86
  // It's generally done in Redux also but no harm checking in Api also in case we missed it.
@@ -81,16 +90,16 @@ export class ApiBase {
81
90
  }
82
91
  }
83
92
  getModuleInfoByModuleId(module) {
84
- return this.adaptable.ModuleService.getModuleInfoByModule(module);
93
+ return this._adaptable.ModuleService.getModuleInfoByModule(module);
85
94
  }
86
95
  showModulePopup(module, moduleParams) {
87
96
  let moduleInfo = this.getModuleInfoByModuleId(module);
88
97
  if (moduleInfo) {
89
- this.adaptable.api.internalApi.showPopupScreen(moduleInfo.ModuleName, moduleInfo.Popup, moduleParams);
98
+ this._adaptable.api.internalApi.showPopupScreen(moduleInfo.ModuleName, moduleInfo.Popup, moduleParams);
90
99
  }
91
100
  }
92
101
  getOptions() {
93
- return this.adaptable.adaptableOptions;
102
+ return this._adaptable.adaptableOptions;
94
103
  }
95
104
  getActionColumnOptions() {
96
105
  return this.getOptions().actionColumnOptions;
@@ -177,25 +186,31 @@ export class ApiBase {
177
186
  return this.getOptions().toolPanelOptions;
178
187
  }
179
188
  getChartingOptions() {
180
- return this.adaptable.adaptableOptions.chartingOptions;
189
+ return this.getOptions().chartingOptions;
181
190
  }
182
191
  getDataChangeHistoryOptions() {
183
- return this.adaptable.adaptableOptions.dataChangeHistoryOptions;
192
+ return this.getOptions().dataChangeHistoryOptions;
184
193
  }
185
194
  getEntitlementOptions() {
186
- return this.adaptable.adaptableOptions.entitlementOptions;
195
+ return this.getOptions().entitlementOptions;
187
196
  }
188
197
  getFlashingCellOptions() {
189
- return this.adaptable.adaptableOptions.flashingCellOptions;
198
+ return this.getOptions().flashingCellOptions;
190
199
  }
191
200
  getSettingsPanelOptions() {
192
- return this.adaptable.adaptableOptions.settingsPanelOptions;
201
+ return this.getOptions().settingsPanelOptions;
193
202
  }
194
203
  getFdc3Options() {
195
- return this.adaptable.adaptableOptions.fdc3Options;
204
+ return this.getOptions().fdc3Options;
196
205
  }
197
206
  getAdaptableApi() {
198
- return this.adaptable.api;
207
+ return this._adaptable.api;
208
+ }
209
+ getAgGridApi() {
210
+ return this.getAdaptableApi().agGridApi;
211
+ }
212
+ getAdaptableInternalApi() {
213
+ return this.getAdaptableApi().internalApi;
199
214
  }
200
215
  getActionColumnApi() {
201
216
  return this.getAdaptableApi().actionColumnApi;
@@ -330,6 +345,6 @@ export class ApiBase {
330
345
  return this.getAdaptableApi().fdc3Api;
331
346
  }
332
347
  destroy() {
333
- delete this.adaptable;
348
+ delete this._adaptable;
334
349
  }
335
350
  }
@@ -5,7 +5,7 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
5
5
  import { CalculatedColumnInternalApi } from '../Internal/CalculatedColumnInternalApi';
6
6
  export declare class CalculatedColumnApiImpl extends ApiBase implements CalculatedColumnApi {
7
7
  internalApi: CalculatedColumnInternalApi;
8
- constructor(adaptable: IAdaptable);
8
+ constructor(_adaptable: IAdaptable);
9
9
  getCalculatedColumnState(): CalculatedColumnState;
10
10
  getCalculatedColumns(): CalculatedColumn[];
11
11
  getCalculatedColumnById(id: CalculatedColumn['Uuid']): CalculatedColumn;
@@ -3,9 +3,9 @@ import { ApiBase } from './ApiBase';
3
3
  import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
4
4
  import { CalculatedColumnInternalApi } from '../Internal/CalculatedColumnInternalApi';
5
5
  export class CalculatedColumnApiImpl extends ApiBase {
6
- constructor(adaptable) {
7
- super(adaptable);
8
- this.internalApi = new CalculatedColumnInternalApi(adaptable);
6
+ constructor(_adaptable) {
7
+ super(_adaptable);
8
+ this.internalApi = new CalculatedColumnInternalApi(_adaptable);
9
9
  }
10
10
  getCalculatedColumnState() {
11
11
  return this.getAdaptableState().CalculatedColumn;
@@ -42,7 +42,7 @@ export class CalendarApiImpl extends ApiBase {
42
42
  const holidays = this.getCalendarOptions().holidays;
43
43
  if (holidays) {
44
44
  if (typeof holidays === 'function') {
45
- return holidays(this.getAdaptableApi().internalApi.buildBaseContext());
45
+ return holidays(this.getAdaptableInternalApi().buildBaseContext());
46
46
  }
47
47
  else {
48
48
  return holidays;
@@ -5,7 +5,7 @@ import { ChartContainer, ChartDefinition } from '../../types';
5
5
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
6
6
  import { ExternalChartDefinition } from '../../PredefinedConfig/ChartingState';
7
7
  export declare class ChartingApiImpl extends ApiBase implements ChartingApi {
8
- constructor(adaptable: IAdaptable);
8
+ constructor(_adaptable: IAdaptable);
9
9
  isChartingEnabled(): boolean;
10
10
  getCurrentChartModels(): ChartModel[];
11
11
  getChartRef(chartId: string): ChartRef;