@adaptabletools/adaptable-cjs 18.0.0-canary.4 → 18.0.0-canary.5

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 (169) hide show
  1. package/agGrid.d.ts +4 -21
  2. package/agGrid.js +5 -21
  3. package/base.css +1 -1
  4. package/base.css.map +1 -1
  5. package/index.css +74 -68
  6. package/index.css.map +1 -1
  7. package/package.json +3 -4
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +55 -109
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +6 -0
  10. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
  11. package/src/Api/AdaptableApi.d.ts +5 -0
  12. package/src/Api/ColumnFilterApi.d.ts +0 -5
  13. package/src/Api/Events/AdaptableReady.d.ts +3 -3
  14. package/src/Api/Events/GridDataChanged.d.ts +4 -4
  15. package/src/Api/GridApi.d.ts +14 -13
  16. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
  17. package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
  18. package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
  19. package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
  20. package/src/Api/Implementation/ApiBase.d.ts +2 -1
  21. package/src/Api/Implementation/ApiBase.js +3 -0
  22. package/src/Api/Implementation/ColumnFilterApiImpl.d.ts +0 -1
  23. package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -10
  24. package/src/Api/Implementation/CommentsApiImpl.js +2 -1
  25. package/src/Api/Implementation/ConfigApiImpl.js +8 -3
  26. package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
  27. package/src/Api/Implementation/GridApiImpl.js +20 -14
  28. package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
  29. package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
  30. package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
  31. package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
  32. package/src/Api/Internal/ActionRowInternalApi.js +107 -0
  33. package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
  34. package/src/Api/Internal/AdaptableInternalApi.js +10 -8
  35. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
  36. package/src/Api/Internal/CalculatedColumnInternalApi.js +71 -0
  37. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
  38. package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
  39. package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
  40. package/src/Api/Internal/ColumnInternalApi.js +12 -0
  41. package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
  42. package/src/Api/Internal/CustomSortInternalApi.js +32 -1
  43. package/src/Api/Internal/DataSetInternalApi.js +1 -1
  44. package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
  45. package/src/Api/Internal/FreeTextColumnInternalApi.js +60 -0
  46. package/src/Api/Internal/GridFilterInternalApi.js +1 -1
  47. package/src/Api/Internal/GridInternalApi.d.ts +21 -3
  48. package/src/Api/Internal/GridInternalApi.js +126 -7
  49. package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
  50. package/src/EnvVars.d.ts +3 -0
  51. package/src/EnvVars.js +8 -0
  52. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
  53. package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
  54. package/src/Redux/Store/AdaptableStore.d.ts +4 -6
  55. package/src/Redux/Store/AdaptableStore.js +22 -50
  56. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +7 -1
  57. package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
  58. package/src/Strategy/AdaptableModuleBase.js +4 -7
  59. package/src/Strategy/AlertModule.d.ts +1 -2
  60. package/src/Strategy/AlertModule.js +2 -55
  61. package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
  62. package/src/Strategy/CalculatedColumnModule.js +5 -25
  63. package/src/Strategy/ChartingModule.d.ts +0 -1
  64. package/src/Strategy/ChartingModule.js +0 -21
  65. package/src/Strategy/ColumnFilterModule.d.ts +1 -2
  66. package/src/Strategy/ColumnFilterModule.js +1 -64
  67. package/src/Strategy/CommentsModule.d.ts +1 -0
  68. package/src/Strategy/CommentsModule.js +2 -1
  69. package/src/Strategy/CustomSortModule.js +1 -1
  70. package/src/Strategy/DashboardModule.d.ts +1 -2
  71. package/src/Strategy/DashboardModule.js +1 -8
  72. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  73. package/src/Strategy/DataChangeHistoryModule.js +3 -1
  74. package/src/Strategy/DataSetModule.d.ts +1 -1
  75. package/src/Strategy/DataSetModule.js +1 -1
  76. package/src/Strategy/FlashingCellModule.d.ts +1 -2
  77. package/src/Strategy/FlashingCellModule.js +2 -15
  78. package/src/Strategy/FormatColumnModule.d.ts +0 -2
  79. package/src/Strategy/FormatColumnModule.js +0 -47
  80. package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
  81. package/src/Strategy/FreeTextColumnModule.js +0 -30
  82. package/src/Strategy/GridFilterModule.d.ts +0 -1
  83. package/src/Strategy/GridFilterModule.js +0 -37
  84. package/src/Strategy/Interface/IModule.d.ts +0 -1
  85. package/src/Strategy/LayoutModule.d.ts +1 -3
  86. package/src/Strategy/LayoutModule.js +6 -50
  87. package/src/Strategy/NamedQueryModule.d.ts +0 -1
  88. package/src/Strategy/NamedQueryModule.js +0 -19
  89. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  90. package/src/Strategy/PlusMinusModule.js +1 -1
  91. package/src/Strategy/ScheduleModule.d.ts +1 -1
  92. package/src/Strategy/ScheduleModule.js +1 -1
  93. package/src/Strategy/ShortcutModule.d.ts +1 -1
  94. package/src/Strategy/ShortcutModule.js +1 -1
  95. package/src/Strategy/StyledColumnModule.d.ts +0 -1
  96. package/src/Strategy/StyledColumnModule.js +0 -21
  97. package/src/Strategy/TeamSharingModule.d.ts +1 -0
  98. package/src/Strategy/TeamSharingModule.js +5 -5
  99. package/src/Strategy/ToolPanelModule.d.ts +0 -1
  100. package/src/Strategy/ToolPanelModule.js +0 -23
  101. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  102. package/src/Utilities/Constants/GeneralConstants.js +3 -2
  103. package/src/Utilities/Helpers/AdaptableHelper.d.ts +0 -3
  104. package/src/Utilities/Helpers/AdaptableHelper.js +1 -60
  105. package/src/Utilities/Services/CellPopupService.js +0 -1
  106. package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
  107. package/src/Utilities/Services/LicenseService/index.js +10 -3
  108. package/src/Utilities/Services/MetamodelService.d.ts +1 -1
  109. package/src/Utilities/Services/MetamodelService.js +6 -3
  110. package/src/Utilities/Services/RowEditService.d.ts +3 -2
  111. package/src/Utilities/Services/RowEditService.js +3 -1
  112. package/src/View/AdaptableView.js +0 -2
  113. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
  114. package/src/View/CalculatedColumn/utils.d.ts +1 -1
  115. package/src/View/CellSummary/CellSummaryPopup.js +1 -1
  116. package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
  117. package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
  118. package/src/View/CustomSort/CustomSortSummary.js +1 -1
  119. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  120. package/src/View/GridFilter/GridFilterViewPanel.js +6 -2
  121. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
  122. package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
  123. package/src/agGrid/ActionColumnRenderer.js +4 -4
  124. package/src/agGrid/Adaptable.d.ts +3 -455
  125. package/src/agGrid/Adaptable.js +7 -5291
  126. package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
  127. package/src/agGrid/AdaptableAgGrid.js +3785 -0
  128. package/src/agGrid/AdaptableLogger.js +78 -13
  129. package/src/agGrid/AgGridAdapter.d.ts +54 -0
  130. package/src/agGrid/AgGridAdapter.js +554 -0
  131. package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
  132. package/src/agGrid/AgGridColumnAdapter.js +818 -0
  133. package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
  134. package/src/agGrid/AgGridMenuAdapter.js +276 -0
  135. package/src/agGrid/AgGridOptionsService.d.ts +11 -0
  136. package/src/agGrid/AgGridOptionsService.js +54 -0
  137. package/src/agGrid/BadgeRenderer.js +1 -1
  138. package/src/agGrid/CheckboxRenderer.js +1 -1
  139. package/src/agGrid/FilterWrapper.d.ts +2 -2
  140. package/src/agGrid/FilterWrapper.js +1 -1
  141. package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
  142. package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
  143. package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +72 -9
  144. package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
  145. package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
  146. package/src/components/Datepicker/index.d.ts +1 -1
  147. package/src/components/InfiniteTable/index.js +2 -2
  148. package/src/components/Modal/index.d.ts +1 -0
  149. package/src/components/Modal/index.js +6 -4
  150. package/src/env.js +2 -2
  151. package/src/metamodel/adaptable.metamodel.d.ts +9 -9
  152. package/src/metamodel/adaptable.metamodel.js +7 -0
  153. package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
  154. package/src/migration/AdaptableUpgradeHelper.js +52 -0
  155. package/src/migration/VersionUpgrade.d.ts +8 -0
  156. package/src/migration/VersionUpgrade.js +15 -0
  157. package/src/migration/VersionUpgrade17.d.ts +18 -0
  158. package/src/migration/VersionUpgrade17.js +347 -0
  159. package/src/migration/VersionUpgrade18.d.ts +5 -0
  160. package/src/migration/VersionUpgrade18.js +10 -0
  161. package/src/types.d.ts +5 -4
  162. package/tsconfig.cjs.tsbuildinfo +1 -1
  163. package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
  164. package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
  165. package/src/Utilities/Services/Interface/IRowEditService.js +0 -2
  166. package/src/agGrid/agGridHelper.d.ts +0 -57
  167. package/src/agGrid/agGridHelper.js +0 -691
  168. package/src/agGrid/agGridMenuHelper.d.ts +0 -46
  169. package/src/agGrid/agGridMenuHelper.js +0 -673
@@ -1,4 +1,4 @@
1
- import { ChartModel, ChartRef, Column, GridOptions, IRowNode, Module, ModuleNames, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
1
+ import { ChartModel, ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
2
2
  import { AdaptableApi } from '../Api/AdaptableApi';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { ColumnSort } from '../PredefinedConfig/Common/ColumnSort';
@@ -10,8 +10,7 @@ import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo
10
10
  import { AdaptableTheme } from '../PredefinedConfig/ThemeState';
11
11
  import { IAdaptableStore } from '../Redux/Store/Interface/IAdaptableStore';
12
12
  import { IModuleCollection } from '../Strategy/Interface/IModule';
13
- import { ActionColumnContext, AdaptableButton, AdaptableMenuItem, AdaptableOptions, AdaptablePlugin, ChartDefinition, CustomSort, SelectedRowInfo } from '../types';
14
- import { IPPStyle } from '../Utilities/Interface/IPPStyle';
13
+ import { AdaptableMenuItem, AdaptableOptions, AdaptablePlugin, ChartDefinition, SelectedRowInfo } from '../types';
15
14
  import { ICalculatedColumnExpressionService } from '../Utilities/Services/Interface/ICalculatedColumnExpressionService';
16
15
  import { IDataService } from '../Utilities/Services/Interface/IDataService';
17
16
  import { CellPopupService } from '../Utilities/Services/CellPopupService';
@@ -25,11 +24,13 @@ import { IAlertService } from '../Utilities/Services/Interface/IAlertService';
25
24
  import { ITeamSharingService } from '../Utilities/Services/Interface/ITeamSharingService';
26
25
  import { AdaptableFrameworkComponent } from '../AdaptableOptions/AdaptableFrameworkComponent';
27
26
  import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelService';
28
- import { ColumnValuesComparer } from '../AdaptableOptions/CustomSortOptions';
29
- import { IRowEditService } from '../Utilities/Services/Interface/IRowEditService';
30
27
  import { RenderReactRootFn } from '../renderReactRoot';
31
28
  import { AdaptableLogger } from '../agGrid/AdaptableLogger';
32
29
  import { Fdc3Service } from '../Utilities/Services/Fdc3Service';
30
+ import { AgGridAdapter } from '../agGrid/AgGridAdapter';
31
+ import { AgGridColumnAdapter } from '../agGrid/AgGridColumnAdapter';
32
+ import { AgGridMenuAdapter } from '../agGrid/AgGridMenuAdapter';
33
+ import { RowEditService } from '../Utilities/Services/RowEditService';
33
34
  /**
34
35
  * Contains AG Grid Options and Modules - used when instantiating AdapTable vanilla
35
36
  */
@@ -59,37 +60,18 @@ export type AdaptableVariant = 'vanilla' | 'react' | 'angular';
59
60
  export interface IAdaptable {
60
61
  logger: AdaptableLogger;
61
62
  variant: AdaptableVariant;
62
- renderReactRoot: RenderReactRootFn;
63
+ isReady: boolean;
64
+ isDestroyed: boolean;
63
65
  api: AdaptableApi;
64
66
  adaptableOptions: AdaptableOptions;
65
- _rawAdaptableOptions: AdaptableOptions;
66
67
  adaptableStore: IAdaptableStore;
67
68
  adaptableModules: IModuleCollection;
68
- gridOptions: GridOptions;
69
- /**
70
- * If using AG Grid community (which has no menu)
71
- */
69
+ agGridAdapter: AgGridAdapter;
70
+ agGridMenuAdapter: AgGridMenuAdapter;
71
+ agGridColumnAdapter: AgGridColumnAdapter;
72
72
  embedColumnMenu: boolean;
73
- /**
74
- * Set when Adaptable is fully initialised
75
- *
76
- * Avoid unnecessary store calls and rendering
77
- */
78
- isInitialised: boolean;
79
- /**
80
- * Set to true when adaptable is destroyed.
81
- */
82
- isDestroyed: boolean;
83
- /**
84
- * TRUE iff:
85
- * 1. isInitialised = TRUE
86
- * 2. isDestroyed = FALSE
87
- */
88
- isLive: boolean;
89
- /**
90
- * TRUE if the Adaptable custom tool panel (side-bar) is displayed
91
- */
92
73
  hasAdaptableToolPanel: boolean;
74
+ renderReactRoot: RenderReactRootFn;
93
75
  /**
94
76
  * Adaptable contains a number of 'Services' which are created at Startup
95
77
  *
@@ -105,7 +87,7 @@ export interface IAdaptable {
105
87
  AlertService: IAlertService;
106
88
  TeamSharingService: ITeamSharingService;
107
89
  MetamodelService: IMetamodelService;
108
- RowEditService: IRowEditService;
90
+ RowEditService: RowEditService;
109
91
  Fdc3Service: Fdc3Service;
110
92
  CellPopupService: CellPopupService;
111
93
  /**
@@ -149,20 +131,34 @@ export interface IAdaptable {
149
131
  componentType: string;
150
132
  }): Promise<any>;
151
133
  _emitSync(eventName: 'CreateAdaptableContextMenuItems', data?: any): Promise<any>;
152
- prepareGrid(): void;
134
+ /**
135
+ *
136
+ */
137
+ getAgGridContainerElement(): HTMLElement | null;
153
138
  redrawBody(): void;
154
- redrawRenderedRows(): void;
155
- redrawHeader(): void;
139
+ refreshHeader(): void;
156
140
  redrawRow(rowNode: IRowNode): void;
157
- redrawRows(rowNodes: IRowNode[]): void;
141
+ redrawRows(rowNodes?: IRowNode[]): void;
158
142
  refreshCells(rowNodes: IRowNode[], columns: (string | any)[], forceUpdate: boolean, suppressFlash?: boolean): void;
159
143
  refreshColumns(columns: (string | Column)[], forceUpdate: boolean, suppressFlash?: boolean): void;
160
- setSelectedCells(): SelectedCellInfo | undefined;
161
- setSelectedRows(): SelectedRowInfo | undefined;
144
+ refreshSelectedCellsState(): SelectedCellInfo | undefined;
145
+ refreshSelectedRowsState(): SelectedRowInfo | undefined;
146
+ selectColumn(columnId: string, config?: {
147
+ keepExistingSelection?: boolean;
148
+ }): void;
149
+ selectColumns(columnIds: string[], config?: {
150
+ keepExistingSelection?: boolean;
151
+ }): void;
152
+ selectAll(): void;
153
+ deselectAll(): void;
154
+ selectNodes(rowNodes: IRowNode[], clearSelection: boolean): void;
155
+ deSelectNodes(rowNodes: IRowNode[], clearSelection: boolean): void;
156
+ selectNode(rowNode: IRowNode, clearSelection: boolean): void;
157
+ deSelectNode(rowNode: IRowNode, clearSelection: boolean): void;
158
+ selectCells(columnIds: string[], startNode: IRowNode, endNode: IRowNode, clearSelection?: boolean): void;
162
159
  jumpToRow(rowNode: IRowNode): void;
163
160
  jumpToColumn(columnId: string): void;
164
161
  jumpToCell(columnId: string, rowNode: IRowNode): void;
165
- getAgGridContainerElement(): HTMLElement | null;
166
162
  setGridData(dataSource: any): void;
167
163
  getGridData(): any[];
168
164
  getFilteredData(): any[];
@@ -173,50 +169,22 @@ export interface IAdaptable {
173
169
  updated: IRowNode[];
174
170
  }>;
175
171
  deleteRows(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): Promise<IRowNode[]>;
176
- selectColumn(columnId: string, config?: {
177
- keepExistingSelection?: boolean;
178
- }): void;
179
- selectColumns(columnIds: string[], config?: {
180
- keepExistingSelection?: boolean;
181
- }): void;
182
- selectAll(): void;
183
- deselectAll(): void;
184
- hideColumn(columnId: string): void;
185
- showColumn(columnId: string): void;
186
- autoSizeColumn(columnId: string): void;
187
- autoSizeColumns(columnIds: string[]): void;
188
- autoSizeAllColumns(): void;
189
- updateColumnsIntoStore(): void;
190
- setColumnOrder(visibleColumnList: string[]): void;
191
- getPrimaryKeyValueFromRowNode(rowNode: IRowNode): any;
192
- getColumnValueDisplayValuePairList(columnId: string, visibleRowsOnly: boolean, onlyIncludeIds?: {
193
- [key: string]: boolean;
194
- }): any[];
172
+ getPrimaryKeyValueFromRowNode(rowNode: IRowNode, gridApi?: GridApi): any;
195
173
  getDistinctValuesForColumn(column: AdaptableColumn, distinctValuesParams: DistinctValuesParams): GridCell[];
196
- getDistinctFilterListValuesForColumn(column: AdaptableColumn, filter: string, distinctValuesParams: DistinctValuesParams): Promise<{
197
- gridCells: GridCell[];
198
- suppressClientSideFilter?: boolean;
199
- }>;
200
- getDistinctCustomSortValuesForColumn(column: AdaptableColumn, distinctValuesParams: DistinctValuesParams): Promise<GridCell[]>;
201
- getDistinctBulkUpdateValuesForColumn(column: AdaptableColumn, selectedGridCells: GridCell[], distinctValuesParams: DistinctValuesParams): Promise<GridCell[]>;
202
- getDisplayValue(id: any, columnId: string): string | undefined;
203
174
  getGridCellFromRowNode(rowNode: IRowNode, columnId: string): GridCell | undefined;
204
175
  getRawValueFromRowNode(rowNode: IRowNode, columnId: string): any;
205
176
  getDisplayValueFromRowNode(rowNode: IRowNode, columnId: string): string | undefined;
206
177
  getDisplayValueFromRawValue(rowNode: IRowNode, columnId: string, rawValue: any): string | undefined;
207
178
  getNormalisedValueFromRawValue(rawValue: any, column: AdaptableColumn): string | number | boolean | Date | unknown;
208
179
  getGridCellsForColumn(columnId: string): GridCell[] | undefined;
209
- getDataRowFromRowNode(rowNode: IRowNode): any;
210
180
  getRowNodesForPrimaryKeys(primaryKeyValues: any[]): IRowNode[];
211
181
  getRowNodeForPrimaryKey(primaryKeyValue: any): IRowNode;
212
182
  getRowNodeByIndex(index: number): IRowNode;
213
183
  getAgGridStatusPanels(): StatusPanelDef[];
214
184
  forPlugins(callback: (plugin: AdaptablePlugin) => any): void;
215
- lookupPlugins(propertyName: string, ...args: any): any;
216
185
  getPluginProperty(pluginId: string, propertyName: string, ...args: any): any;
217
186
  getPlugin(pluginId: string): AdaptablePlugin;
218
187
  setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: IRowNode): void;
219
- cancelEdit(): any;
220
188
  isCellEditable(rowNode: IRowNode, column: Column): boolean;
221
189
  getFirstRowNode(): IRowNode | undefined;
222
190
  getFirstDisplayedRowNode(): IRowNode | undefined;
@@ -228,10 +196,6 @@ export interface IAdaptable {
228
196
  includeGroupRows?: boolean;
229
197
  filterFn?: (rowNode: IRowNode) => boolean;
230
198
  }): void;
231
- getVisibleRowNodes(config?: {
232
- includeGroupRows?: boolean;
233
- filterFn?: (rowNode: IRowNode) => boolean;
234
- }): IRowNode[];
235
199
  getAllRowNodes(config?: {
236
200
  includeGroupRows?: boolean;
237
201
  filterFn?: (rowNode: IRowNode) => boolean;
@@ -242,26 +206,25 @@ export interface IAdaptable {
242
206
  updateRowGroupsExpandedState(layout?: Layout): void;
243
207
  getRowsInViewport(): IRowNode[];
244
208
  isGroupRowNode(rowNode: IRowNode): boolean;
245
- isVisibleNode(rowNode: IRowNode): boolean;
246
- selectNodes(rowNodes: IRowNode[], clearSelection: boolean): void;
247
- deSelectNodes(rowNodes: IRowNode[], clearSelection: boolean): void;
248
- selectNode(rowNode: IRowNode, clearSelection: boolean): void;
249
- deSelectNode(rowNode: IRowNode, clearSelection: boolean): void;
250
- selectCells(columnIds: string[], startNode: IRowNode, endNode: IRowNode, clearSelection?: boolean): void;
251
- getFirstGroupedColumn(): AdaptableColumn | undefined;
252
209
  isRowNodeVisible(rowNode: IRowNode): boolean;
253
210
  getAgGridColumnType(columnId: string): string | string[];
254
- getActiveColumnComparator(columnId: string, customSort?: CustomSort, customSortComparer?: ColumnValuesComparer): (valueA: any, valueB: any, nodeA?: IRowNode, nodeB?: IRowNode, isInverted?: boolean) => number | undefined;
211
+ hideColumn(columnId: string): void;
212
+ showColumn(columnId: string): void;
213
+ autoSizeColumn(columnId: string): void;
214
+ autoSizeColumns(columnIds: string[]): void;
215
+ autoSizeAllColumns(): void;
216
+ setColumnOrder(visibleColumnList: string[]): void;
255
217
  setColumnSort(columnSorts: ColumnSort[]): void;
256
218
  clearColumnSort(): void;
257
219
  hideColumnFilterForm(): void;
258
- applyColumnFiltering(): void;
259
220
  clearColumnFiltering(): void;
260
221
  clearColumnFilteringForColumns(columnIds: string[]): void;
222
+ applyColumnFiltering(): void;
261
223
  applyGridFiltering(): void;
262
- canExportToExcel(): boolean;
263
- exportToExcel(reportData: ReportData, fileName: string): void;
264
- exportVisualDataToExcel(): void;
224
+ showQuickFilter(): void;
225
+ hideQuickFilter(): void;
226
+ isQuickFilterAvailable(): boolean;
227
+ setAgGridQuickSearch(query: string): void;
265
228
  canGenerateCharts(): boolean;
266
229
  canDisplaySparklines(): boolean;
267
230
  showCharts(charts: ChartDefinition[]): ChartRef[];
@@ -270,32 +233,13 @@ export interface IAdaptable {
270
233
  updateChart(chart: ChartDefinition): void;
271
234
  getChartModels(): ChartModel[];
272
235
  getAgGridRowModelType(): RowModelType;
273
- getCurrentIPPStyle(): IPPStyle;
274
- getDefaultIPPStyle(): IPPStyle;
275
236
  getRowCount(): number;
276
237
  getColumnCount(): number;
277
- getVisibleRowCount(): number;
278
238
  getVisibleColumnCount(): number;
279
- setLayout(layout: Layout): void;
280
239
  isGridSelectable(): boolean;
281
- isGridRangeSelectable(): boolean;
282
- isGridGroupable(): boolean;
283
- isGridPivotable(): boolean;
284
240
  isGridGroupingActive(): boolean;
285
- showQuickFilter(): void;
286
- hideQuickFilter(): void;
287
- isQuickFilterAvailable(): boolean;
288
- setAgGridQuickSearch(query: string): void;
289
- getAgGridLightThemeName(): string;
290
241
  getAgGridCurrentThemeName(): string;
291
242
  applyAdaptableTheme(theme: AdaptableTheme | string): void;
292
- /**
293
- * called when you want to destroy the instance & cleanup resources
294
- */
295
- destroy(config?: {
296
- unmount: boolean;
297
- destroyApi?: boolean;
298
- }): void;
299
243
  setRowGroupColumns(columnIds: string[]): void;
300
244
  getAgGridAllGridColumns(): Column<any>[];
301
245
  clearRowGroupColumns(): void;
@@ -305,14 +249,16 @@ export interface IAdaptable {
305
249
  getExpandRowGroupsKeys(): any[];
306
250
  getAdaptableContainerElement(): HTMLElement | null;
307
251
  getAgGridContainerElement(): HTMLElement | null;
308
- buildStandaloneColumnHeader(adaptableColumn: AdaptableColumn): AdaptableMenuItem[];
309
- setupColumns(): void;
310
- updateColDefsForSpecialColumns({ skipSetupColumns }?: {
311
- skipSetupColumns?: boolean;
312
- }): void;
252
+ updateColumnModelAndRefreshGrid(): void;
313
253
  getAgGridColumnForColumnId(columnId: string): Column;
314
- isAgGridModulePresent(moduleName: ModuleNames): boolean;
315
254
  getMinMaxCachedValueForColumn(column: AdaptableColumn, minMax: 'min' | 'max'): number | undefined;
316
255
  getAgGridRegisteredModules(): Module[];
317
- getActionRowButtonDefs: () => AdaptableButton<ActionColumnContext<any>>[];
256
+ destroy(config?: {
257
+ unmount: boolean;
258
+ destroyApi?: boolean;
259
+ }): void;
260
+ setLayout(layout?: Layout): void;
261
+ canExportToExcel(): boolean;
262
+ exportToExcel(reportData: ReportData, fileName: string): void;
263
+ exportVisualDataToExcel(): void;
318
264
  }
@@ -65,6 +65,12 @@ export interface AdaptableOptions<TData = any> {
65
65
  * Commercial license key. If the license is not provided or is expired, various visual information notes will be displayed and some functionality may be limited.
66
66
  */
67
67
  licenseKey?: string;
68
+ /**
69
+ * Automatically migrate the state from the previous version of Adaptable to the current version.
70
+ *
71
+ * @defaultValue true
72
+ */
73
+ autoMigrateState?: boolean;
68
74
  /**
69
75
  * User State set at design-time and shipped with AdapTable for first use; can be `PredefinedConfig` object or url to file containing config
70
76
  *
@@ -111,6 +111,23 @@ export interface UserInterfaceOptions<TData = any> {
111
111
  * @noCodeItem
112
112
  */
113
113
  showLoadingScreen?: boolean;
114
+ /**
115
+ * Delay in milliseconds before Loading Screen appears. `showLoadingScreen` must be true for this to take effect
116
+ *
117
+ * @defaultValue 200
118
+ */
119
+ loadingScreenDelay?: number;
120
+ /**
121
+ * Title to display in Loading Screen.
122
+ * @defaultValue 'Initialising Grid'
123
+ */
124
+ loadingScreenTitle?: string;
125
+ /**
126
+ * Text to display in Loading Screen.
127
+ *
128
+ * @defaultValue 'Retrieving your settings and setting up the grid...'
129
+ */
130
+ loadingScreenText?: string;
114
131
  }
115
132
  /**
116
133
  * Base class for all Permitted Values related objects
@@ -1,3 +1,4 @@
1
+ import { GridApi as AgGridApi } from '@ag-grid-community/core';
1
2
  import { AlertApi } from './AlertApi';
2
3
  import { PluginsApi } from './PluginsApi';
3
4
  import { BulkUpdateApi } from './BulkUpdateApi';
@@ -53,6 +54,10 @@ import { CommentApi } from './CommentApi';
53
54
  * Has a huge number of classes each dedicated to a specific AdapTable Module or functionality
54
55
  */
55
56
  export interface AdaptableApi {
57
+ /**
58
+ * AG Grid API; try to use the API methods provided by Adaptable instead of using this directly
59
+ */
60
+ agGridApi: AgGridApi;
56
61
  /**
57
62
  * Provides access to Action Columns
58
63
  */
@@ -122,9 +122,4 @@ export interface ColumnFilterApi {
122
122
  * @param columnFilterConfig - Column Filter to set
123
123
  */
124
124
  setColumnFilterForColumn(columnId: string, columnFilterConfig: ColumnFilterConfig): void;
125
- /**
126
- * Gets the maximum Filter Values to show for a Column
127
- * @param column Column to Filter
128
- */
129
- getMaxFilterValue(column: AdaptableColumn): number | undefined;
130
125
  }
@@ -1,11 +1,11 @@
1
- import { GridOptions } from '@ag-grid-community/core';
1
+ import { GridApi } from '@ag-grid-community/core';
2
2
  import { BaseEventInfo } from './BaseEventInfo';
3
3
  /**
4
4
  * Object returned by `AdaptableReady` event - fired when AdapTable has loaded
5
5
  */
6
6
  export interface AdaptableReadyInfo<TData = any> extends BaseEventInfo {
7
7
  /**
8
- * Underlying AG Grid GridOptions object
8
+ * Underlying AG Grid API
9
9
  */
10
- gridOptions: GridOptions<TData>;
10
+ agGridApi: GridApi<TData>;
11
11
  }
@@ -1,9 +1,9 @@
1
1
  import { IRowNode } from '@ag-grid-community/core';
2
2
  import { BaseEventInfo } from './BaseEventInfo';
3
+ export type GridDataChangeTrigger = 'Add' | 'Edit' | 'Delete' | 'Load';
3
4
  /**
4
5
  * EventInfo returned by GridDataChanged event
5
- */
6
- export interface GridDataChangedInfo<TData = any> extends BaseEventInfo {
6
+ */ export interface GridDataChangedInfo<TData = any> extends BaseEventInfo {
7
7
  /**
8
8
  * Timestamp of change occurrence (in milliseconds)
9
9
  */
@@ -13,9 +13,9 @@ export interface GridDataChangedInfo<TData = any> extends BaseEventInfo {
13
13
  */
14
14
  dataRows: TData[];
15
15
  /**
16
- * Trigger for row change: 'Add', 'Edit' or 'Delete'
16
+ * Trigger for row change: 'Add', 'Edit', 'Delete', 'Load'
17
17
  */
18
- rowTrigger: 'Add' | 'Edit' | 'Delete';
18
+ rowTrigger: GridDataChangeTrigger;
19
19
  /**
20
20
  * Row Nodes that were affected by this change
21
21
  */
@@ -7,7 +7,7 @@ import { DataUpdateConfig } from '../PredefinedConfig/Common/DataUpdateConfig';
7
7
  import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
8
8
  import { CellHighlightInfo } from '../PredefinedConfig/Common/CellHighlightInfo';
9
9
  import { RowHighlightInfo } from '../PredefinedConfig/Common/RowHighlightInfo';
10
- import { GridOptions, IRowNode, RowModelType } from '@ag-grid-community/core';
10
+ import { IRowNode, RowModelType } from '@ag-grid-community/core';
11
11
  import { GridCellRange } from '../PredefinedConfig/Selection/GridCellRange';
12
12
  import { RowsHighlightInfo } from '../PredefinedConfig/Common/RowsHighlightInfo';
13
13
  /**
@@ -27,15 +27,18 @@ export interface GridApi {
27
27
  */
28
28
  getFilteredData(): any[];
29
29
  /**
30
- * Repopulates Grid with given data; fires `GridDataChanged` Event
31
- * @param data any data suitable as AG Grid data source
30
+ * @deprecated use `loadGridData()` instead
32
31
  */
33
32
  resetGridData(data: any[]): void;
34
33
  /**
35
- * Sets grid with given data for FIRST use; doesn't fire 'GridDataChanged' Event
36
- * @param dataany data suitable as AG Grid data source
34
+ * @deprecated use `loadGridData()` instead
37
35
  */
38
36
  setInitialGridData(data: any): void;
37
+ /**
38
+ * Loads data into grid and fire a `GridDataChanged.trigger='Load'` event
39
+ * @param data data to load
40
+ */
41
+ loadGridData(data: any): void;
39
42
  /**
40
43
  * Updates AdapTable (and AG Grid) with rows that have changed
41
44
  * @param dataRows rows which have been updated - send whole row and AdapTable take cares of the rest
@@ -86,10 +89,6 @@ export interface GridApi {
86
89
  * Returns all current Selected Rows in AdapTable
87
90
  */
88
91
  getSelectedRowInfo(): SelectedRowInfo;
89
- /**
90
- * Returns Ag Grid instance (passed into Adaptable Options at start-up)
91
- */
92
- getAgGridInstance(): GridOptions;
93
92
  /**
94
93
  * Returns Column Sort information in AdapTable
95
94
  */
@@ -469,10 +468,6 @@ export interface GridApi {
469
468
  * Returns number of rows in Data Source
470
469
  */
471
470
  getRowCount(): number;
472
- /**
473
- * Returns number of visible rows in Data Source
474
- */
475
- getVisibleRowCount(): number;
476
471
  /**
477
472
  * Returns number of columns in Data Source
478
473
  */
@@ -515,4 +510,10 @@ export interface GridApi {
515
510
  * Returns AG Grid Row Model Type
516
511
  */
517
512
  getAgGridRowModelType(): RowModelType;
513
+ /**
514
+ * Returns number of visible rows in Data Source
515
+ *
516
+ * @deprecated use `getRowCount()` instead
517
+ */
518
+ getVisibleRowCount(): number;
518
519
  }
@@ -1,7 +1,9 @@
1
1
  import { ActionColumn, ActionColumnApi } from '../../../types';
2
2
  import { ApiBase } from './ApiBase';
3
3
  import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
4
+ import { ColDef } from '@ag-grid-community/core';
4
5
  export declare class ActionColumnApiImpl extends ApiBase implements ActionColumnApi {
5
6
  constructor(adaptable: IAdaptable);
6
7
  getActionColumns(): ActionColumn[];
8
+ getColDefsForActionColumns(): ColDef[];
7
9
  }
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionColumnApiImpl = void 0;
4
4
  const ApiBase_1 = require("./ApiBase");
5
+ const ActionColumnRenderer_1 = require("../../agGrid/ActionColumnRenderer");
6
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
5
7
  class ActionColumnApiImpl extends ApiBase_1.ApiBase {
6
8
  constructor(adaptable) {
7
9
  super(adaptable);
@@ -10,5 +12,36 @@ class ActionColumnApiImpl extends ApiBase_1.ApiBase {
10
12
  var _a;
11
13
  return (_a = this.getActionColumnOptions().actionColumns) !== null && _a !== void 0 ? _a : [];
12
14
  }
15
+ getColDefsForActionColumns() {
16
+ const defaultActionColumnSettings = {
17
+ resizable: true,
18
+ suppressMenu: false,
19
+ suppressMovable: false,
20
+ };
21
+ return this.getActionColumnApi()
22
+ .getActionColumns()
23
+ .map((actionColumn) => {
24
+ const actionColumnSettings = Object.assign(Object.assign({}, defaultActionColumnSettings), actionColumn.actionColumnSettings);
25
+ const newColDef = {
26
+ headerName: actionColumn.friendlyName ? actionColumn.friendlyName : actionColumn.columnId,
27
+ colId: actionColumn.columnId,
28
+ hide: false,
29
+ editable: false,
30
+ width: actionColumnSettings.width,
31
+ resizable: actionColumnSettings.resizable,
32
+ suppressMenu: actionColumnSettings.suppressMenu,
33
+ suppressMovable: actionColumnSettings.suppressMovable,
34
+ filter: false,
35
+ sortable: false,
36
+ enableRowGroup: false,
37
+ cellRenderer: this.getAdaptableApi().internalApi.getAdaptableInstance().variant === 'react'
38
+ ? ActionColumnRenderer_1.ReactActionColumnRenderer
39
+ : ActionColumnRenderer_1.ActionColumnRenderer,
40
+ type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
41
+ };
42
+ this.getAdaptableApi().logInfo('Setting up Action Column: ' + actionColumn.columnId);
43
+ return newColDef;
44
+ });
45
+ }
13
46
  }
14
47
  exports.ActionColumnApiImpl = ActionColumnApiImpl;
@@ -98,6 +98,7 @@ export declare class AdaptableApiImpl implements AdaptableApi {
98
98
  commentApi: CommentApi;
99
99
  private destroyed;
100
100
  constructor(adaptable: IAdaptable);
101
+ get agGridApi(): import("@ag-grid-community/core/dist/esm/es6/gridApi").GridApi<any>;
101
102
  /**
102
103
  * This is only meant to be called by the Adaptable instance.
103
104
  */
@@ -106,6 +106,9 @@ class AdaptableApiImpl {
106
106
  // adaptable internal api
107
107
  this.internalApi = new AdaptableInternalApi_1.AdaptableInternalApi(adaptable);
108
108
  }
109
+ get agGridApi() {
110
+ return this.adaptable.agGridAdapter.getAgGridApi();
111
+ }
109
112
  /**
110
113
  * This is only meant to be called by the Adaptable instance.
111
114
  */
@@ -1,5 +1,5 @@
1
1
  import { Action } from 'redux';
2
- import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
2
+ import { AdaptableVariant, IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
3
3
  import { AdaptableState } from '../../PredefinedConfig/AdaptableState';
4
4
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
5
5
  import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
@@ -20,6 +20,7 @@ export declare abstract class ApiBase {
20
20
  protected logSuccess(message: string, ...optionalParams: any[]): void;
21
21
  protected logWarn(message: string, ...optionalParams: any[]): void;
22
22
  protected logError(message: string, ...optionalParams: any[]): void;
23
+ protected getAdaptableVariant(): AdaptableVariant;
23
24
  /**
24
25
  * Base api helper method which ensure that Adaptable Object being used in the function is not null or undefined
25
26
  *
@@ -25,6 +25,9 @@ class ApiBase {
25
25
  logError(message, ...optionalParams) {
26
26
  this.adaptable.logger.error(message, ...optionalParams);
27
27
  }
28
+ getAdaptableVariant() {
29
+ return this.adaptable.variant;
30
+ }
28
31
  /**
29
32
  * Base api helper method which ensure that Adaptable Object being used in the function is not null or undefined
30
33
  *
@@ -41,5 +41,4 @@ export declare class ColumnFilterApiImpl extends ApiBase implements ColumnFilter
41
41
  unSuspendAllColumnFilters(): void;
42
42
  getColumnFilterForColumn(columnId: string): ColumnFilter | undefined;
43
43
  clearColumnFilterForColumn(columnId: string): void;
44
- getMaxFilterValue(column: AdaptableColumn): number | undefined;
45
44
  }
@@ -173,15 +173,5 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
173
173
  this.adaptable.clearColumnFilteringForColumns([columnId]);
174
174
  }
175
175
  }
176
- getMaxFilterValue(column) {
177
- const maxFilterValues = this.getColumnFilterOptions().valuesFilterOptions.maxFilterValuesToDisplay;
178
- if (typeof maxFilterValues === 'function') {
179
- const columnFilterContext = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { column: column });
180
- return maxFilterValues(columnFilterContext);
181
- }
182
- else {
183
- return maxFilterValues;
184
- }
185
- }
186
176
  }
187
177
  exports.ColumnFilterApiImpl = ColumnFilterApiImpl;
@@ -14,7 +14,8 @@ class CommentsApiImpl extends ApiBase_1.ApiBase {
14
14
  return CommentRedux.GetCellCommentSelector(this.getAdaptableState().Comment, address);
15
15
  }
16
16
  getCommentThreads() {
17
- return this.getAdaptableState().Comment.CommentThreads;
17
+ var _a;
18
+ return (_a = this.getAdaptableState().Comment.CommentThreads) !== null && _a !== void 0 ? _a : [];
18
19
  }
19
20
  editComment(comment, address) {
20
21
  this.dispatchAction(CommentRedux.CommentsEdit({ comment, cellAddress: address }));
@@ -121,7 +121,6 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
121
121
  setAdaptableStateKey(adaptableStateKey, config) {
122
122
  return new Promise((resolve, reject) => {
123
123
  this.adaptable.api.internalApi.executeWithProgressIndicator(`Initialising...`, () => {
124
- this.adaptable.adaptableOptions.adaptableStateKey = adaptableStateKey;
125
124
  const flushCurrentState = !config || config.flushCurrentState !== false;
126
125
  // make sure we persist any "pending" changes to state - since stateOptions.debounceStateDelay can cause
127
126
  // the state to be persisted with a delay, which we dont want in this case
@@ -129,14 +128,20 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
129
128
  ? this.adaptable.adaptableStore.saveStateNow(this.adaptable)
130
129
  : Promise.resolve(true);
131
130
  flushStatePromise.then(() => {
131
+ this.adaptable.adaptableOptions.adaptableStateKey = adaptableStateKey;
132
132
  let predefinedConfig = config === null || config === void 0 ? void 0 : config.predefinedConfig;
133
133
  if (predefinedConfig) {
134
134
  predefinedConfig = (0, AdaptableHelper_1.initPredefinedConfigWithUuids)(predefinedConfig);
135
135
  }
136
- const promise = this.adaptable.adaptableStore.loadStore(this.adaptable, adaptableStateKey, predefinedConfig);
136
+ const promise = this.adaptable.adaptableStore.loadStore({
137
+ adaptable: this.adaptable,
138
+ adaptableStateKey,
139
+ predefinedConfig,
140
+ });
137
141
  promise
138
142
  .then(() => {
139
- this.adaptable.prepareGrid();
143
+ this.adaptable.updateColumnModelAndRefreshGrid();
144
+ this.adaptable.setLayout();
140
145
  this.adaptable.api.userInterfaceApi.hideLoadingScreen();
141
146
  })
142
147
  .then(() => {