@adaptabletools/adaptable 10.0.0-canary.3 → 10.0.3

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 (129) hide show
  1. package/base.css +77 -29
  2. package/index.css +89 -31
  3. package/package.json +1 -5
  4. package/publishTimestamp.d.ts +1 -1
  5. package/publishTimestamp.js +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
  7. package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
  8. package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
  9. package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
  10. package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
  11. package/src/AdaptableOptions/QueryLanguageOptions.d.ts +7 -0
  12. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +89 -4
  13. package/src/Api/AlertApi.d.ts +1 -1
  14. package/src/Api/ColumnApi.d.ts +33 -0
  15. package/src/Api/ConfigApi.d.ts +8 -0
  16. package/src/Api/DataChangeHistoryApi.d.ts +10 -4
  17. package/src/Api/GridApi.d.ts +34 -8
  18. package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
  19. package/src/Api/Implementation/AlertApiImpl.js +11 -4
  20. package/src/Api/Implementation/ColumnApiImpl.d.ts +7 -0
  21. package/src/Api/Implementation/ColumnApiImpl.js +37 -1
  22. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
  23. package/src/Api/Implementation/ConfigApiImpl.js +28 -17
  24. package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +1 -0
  25. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +3 -0
  26. package/src/Api/Implementation/FreeTextColumnApiImpl.js +2 -1
  27. package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
  28. package/src/Api/Implementation/GridApiImpl.js +17 -1
  29. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
  30. package/src/Api/Implementation/InternalApiImpl.js +16 -0
  31. package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -0
  32. package/src/Api/Implementation/QueryLanguageApiImpl.js +3 -0
  33. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +11 -8
  34. package/src/Api/Implementation/UserInterfaceApiImpl.js +57 -80
  35. package/src/Api/InternalApi.d.ts +2 -0
  36. package/src/Api/QueryLanguageApi.d.ts +5 -0
  37. package/src/Api/UserInterfaceApi.d.ts +14 -5
  38. package/src/PredefinedConfig/AlertState.d.ts +10 -0
  39. package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
  40. package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -15
  41. package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
  42. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
  43. package/src/{AdaptableOptions/DataChangeTrackingOptions.js → PredefinedConfig/Common/SpecialColumnSettings.js} +0 -0
  44. package/src/PredefinedConfig/FilterState.d.ts +1 -1
  45. package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
  46. package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
  47. package/src/PredefinedConfig/SystemState.d.ts +4 -1
  48. package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -6
  49. package/src/Redux/ActionsReducers/SystemRedux.js +11 -11
  50. package/src/Redux/Store/AdaptableReduxMerger.js +7 -1
  51. package/src/Redux/Store/AdaptableStore.js +12 -0
  52. package/src/Strategy/AlertModule.js +1 -1
  53. package/src/Strategy/DataChangeHistoryModule.js +1 -1
  54. package/src/Strategy/ExportModule.d.ts +0 -2
  55. package/src/Strategy/ExportModule.js +58 -61
  56. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -4
  57. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +11 -5
  58. package/src/Utilities/Helpers/DateHelper.d.ts +8 -2
  59. package/src/Utilities/Helpers/DateHelper.js +42 -20
  60. package/src/Utilities/ObjectFactory.d.ts +1 -1
  61. package/src/Utilities/ObjectFactory.js +13 -1
  62. package/src/Utilities/Services/AlertService.d.ts +1 -0
  63. package/src/Utilities/Services/AlertService.js +5 -0
  64. package/src/Utilities/Services/DataService.d.ts +0 -4
  65. package/src/Utilities/Services/DataService.js +2 -18
  66. package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -1
  67. package/src/Utilities/Services/Interface/IDataService.d.ts +0 -2
  68. package/src/Utilities/Services/Interface/ILicenseService.d.ts +2 -1
  69. package/src/Utilities/Services/LicenseService.d.ts +2 -2
  70. package/src/Utilities/Services/MetamodelService.js +1 -0
  71. package/src/Utilities/Services/ModuleService.js +31 -24
  72. package/src/Utilities/Services/ReportService.js +1 -1
  73. package/src/Utilities/Services/TeamSharingService.d.ts +1 -0
  74. package/src/Utilities/Services/TeamSharingService.js +4 -2
  75. package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
  76. package/src/Utilities/runIfNotResolvedIn.js +23 -0
  77. package/src/View/AdaptableView.js +1 -1
  78. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
  79. package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
  80. package/src/View/BulkUpdate/BulkUpdatePopup.js +4 -2
  81. package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
  82. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
  83. package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
  84. package/src/View/Components/FilterForm/FilterForm.js +44 -23
  85. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
  86. package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
  87. package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
  88. package/src/View/Components/FilterForm/QuickFilterForm.js +64 -23
  89. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
  90. package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
  91. package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
  92. package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
  93. package/src/View/Components/Selectors/ColumnValueSelector.js +45 -13
  94. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
  95. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +42 -32
  96. package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +5 -1
  97. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +8 -5
  98. package/src/View/FreeTextColumn/FreeTextColumnPopup.js +3 -1
  99. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +3 -1
  100. package/src/View/GridInfo/GridInfoPopup.js +4 -1
  101. package/src/View/Query/QueryViewPanel.js +1 -1
  102. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.d.ts +1 -1
  103. package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +6 -8
  104. package/src/View/UIHelper.d.ts +2 -0
  105. package/src/View/UIHelper.js +10 -1
  106. package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
  107. package/src/agGrid/ActionColumnRenderer.js +20 -3
  108. package/src/agGrid/Adaptable.d.ts +20 -4
  109. package/src/agGrid/Adaptable.js +186 -55
  110. package/src/components/Dashboard/Dashboard.js +1 -1
  111. package/src/components/DropdownButton/index.js +1 -1
  112. package/src/components/ExpressionEditor/index.js +2 -1
  113. package/src/components/Loader/Loader.d.ts +7 -0
  114. package/src/components/Loader/Loader.js +13 -0
  115. package/src/components/Loader/index.d.ts +2 -0
  116. package/src/components/Loader/index.js +7 -0
  117. package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
  118. package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
  119. package/src/metamodel/adaptable.metamodel.d.ts +74 -34
  120. package/src/metamodel/adaptable.metamodel.js +346 -116
  121. package/src/parser/src/types.d.ts +11 -11
  122. package/src/types.d.ts +4 -4
  123. package/version.d.ts +1 -1
  124. package/version.js +1 -1
  125. package/src/AdaptableOptions/DataChangeTrackingOptions.d.ts +0 -16
  126. package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
  127. package/src/Utilities/Interface/ProgressIndicator.js +0 -2
  128. package/src/View/Export/ProgressIndicator.d.ts +0 -6
  129. package/src/View/Export/ProgressIndicator.js +0 -25
@@ -1,6 +1,7 @@
1
1
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
2
2
  import { DataType } from '../PredefinedConfig/Common/Enums';
3
3
  import { RowNode } from '@ag-grid-community/all-modules';
4
+ import { GridCell } from '../../types';
4
5
  /**
5
6
  * A large range of column-related functions in AdapTable
6
7
  */
@@ -131,6 +132,10 @@ export interface ColumnApi {
131
132
  * @param columnId Column to check
132
133
  */
133
134
  isNumericColumn(column: AdaptableColumn): boolean;
135
+ /**
136
+ * Is Column Boolean
137
+ * @param columnId Column to check
138
+ */
134
139
  isBooleanColumn(column: AdaptableColumn): boolean;
135
140
  /**
136
141
  * Is Column a Date
@@ -205,6 +210,26 @@ export interface ColumnApi {
205
210
  * @param columnId Column to check
206
211
  */
207
212
  getDistinctDisplayValuesForColumn(columnId: string): any[];
213
+ /**
214
+ * Gets all distinct display values in for filter column, used for Floating Filter and Column Header filter
215
+ * @param columnId Column to check
216
+ * @param columnFilter Current applied filter
217
+ */
218
+ getDistinctFilterDisplayValuesForColumn(columnId: string, filter: string): Promise<{
219
+ values: any[];
220
+ suppressClientSideFilter: boolean;
221
+ }>;
222
+ /**
223
+ * Gets all distinct column display values in for custom sort.
224
+ * @param columnId Column to check
225
+ */
226
+ getDistinctCustomSortDisplayValuesForColumn(columnId: string): Promise<any[]>;
227
+ /**
228
+ * Gets all distinct column display values for bulk update.
229
+ * @param columnId Column to check
230
+ * @param selectedGridCells Selected grid cells
231
+ */
232
+ getDistinctBulkUpdateDisplayValuesForColumn(columnId: string, selectedGridCells: GridCell[]): Promise<any[]>;
208
233
  /**
209
234
  * Gets all distinct visible display values in the Column
210
235
  * @param columnId Column to check
@@ -234,6 +259,14 @@ export interface ColumnApi {
234
259
  * @param columnId string
235
260
  */
236
261
  getVendorGridColumnFieldForColumn(columnId: string): string;
262
+ /**
263
+ * Does Column use AdapTable's Filter Form
264
+ * @param columnId Column to Check
265
+ */
237
266
  usesAdaptableFilterForm(columnId: string): boolean;
267
+ /**
268
+ * Does Column use AdapTable's Quick Filter
269
+ * @param columnId Column to Check
270
+ */
238
271
  usesAdaptableQuickFilter(columnId: string): boolean;
239
272
  }
@@ -94,6 +94,10 @@ export interface ConfigApi {
94
94
  * @param returnJson whether to return section as JSON or object
95
95
  */
96
96
  getUserStateByStateKey(stateKey: AdaptableStateKey, returnJson: boolean): ConfigState | string;
97
+ /**
98
+ * Adds '1' to current revision number of State element
99
+ * @param stateKey Adaptable State Key to update
100
+ */
97
101
  incrementUerStateRevision(stateKey: AdaptableStateKey): void;
98
102
  /**
99
103
  * Returns Alert section of Adaptable State
@@ -200,5 +204,9 @@ export interface ConfigApi {
200
204
  * @param returnJson return as JSON rather than object
201
205
  */
202
206
  getToolPanelState(returnJson: boolean): ToolPanelState;
207
+ /**
208
+ * Sent by each Module when it is Ready
209
+ * @param module Module which is Ready
210
+ */
203
211
  dispatchStateReadyAction(module: AdaptableModule): void;
204
212
  }
@@ -4,17 +4,17 @@ import { DataChangedInfo } from '../PredefinedConfig/Common/DataChangedInfo';
4
4
  **/
5
5
  export interface DataChangeHistoryApi {
6
6
  /**
7
- * Retrieves current Data Change History mode
7
+ * Retrieves current Data Change History mode: 'ACTIVE', 'INACTIVE', 'SUSPENDED'
8
8
  */
9
9
  getDataChangeHistoryMode(): 'ACTIVE' | 'INACTIVE' | 'SUSPENDED';
10
10
  /**
11
- * Activates data change history tracking (or resumes it, if it is currently suspended)
11
+ * Activates Data Change History tracking (or resumes it, if it is currently suspended)
12
12
  *
13
- * @param forceReset reactivate the Data Change History even if it is currently suspended
13
+ * @param forceReset reactivates the Data Change History even if it is currently suspended
14
14
  */
15
15
  activateDataChangeHistory(forceReset?: boolean): void;
16
16
  /**
17
- * Deactivates data change history tracking
17
+ * Deactivates Data Change History tracking and flushes the cache
18
18
  */
19
19
  deactivateDataChangeHistory(): void;
20
20
  /**
@@ -25,4 +25,10 @@ export interface DataChangeHistoryApi {
25
25
  * Retrieves all data changes which are currently available
26
26
  */
27
27
  getDataChangeHistoryLog(): DataChangedInfo[];
28
+ /**
29
+ * Reverts the provided data change to its previous value
30
+ *
31
+ * @param dataChangeInfo the change to be undone
32
+ */
33
+ undoDataChangeHistoryEntry(dataChangeInfo: DataChangedInfo): void;
28
34
  }
@@ -23,6 +23,14 @@ export interface GridApi {
23
23
  * @param data any data from any datasource that is suitable for the underlying grid.
24
24
  */
25
25
  setGridData(data: any): void;
26
+ /**
27
+ * Retrieves all data from the grid
28
+ */
29
+ getGridData(): any[];
30
+ /**
31
+ * Retrieves filtered data from the grid
32
+ */
33
+ getFilteredData(): any[];
26
34
  /**
27
35
  * Loads grid with given data
28
36
  * @param data any data from any datasource that is suitable for the underlying grid.
@@ -55,6 +63,15 @@ export interface GridApi {
55
63
  *
56
64
  */
57
65
  setCellValue(columnId: string, newValue: any, primaryKeyValue: any, forceFilter: boolean): void;
66
+ /**
67
+ * Updates multiple cells
68
+ * @param gridCells cells to update
69
+ */
70
+ setCellsValue(gridCells: {
71
+ columnId: any;
72
+ newValue: any;
73
+ primaryKeyValue: any;
74
+ }[]): void;
58
75
  /**
59
76
  * Reverses a data change (if triggered by cell edit)
60
77
  * @param dataChangedInfo data change to undo
@@ -185,10 +202,10 @@ export interface GridApi {
185
202
  getPrimaryKeyValueForRowNode(rowNode: RowNode): any;
186
203
  /**
187
204
  * Retrieves Cell in given Row and Column
188
- * @param rowwNode Row to use
205
+ * @param rowNode Row to use
189
206
  * @param columnId ColumnId to lookup
190
207
  */
191
- getGridCellFromRowNode(rowwNode: RowNode, columnId: string): GridCell | undefined;
208
+ getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
192
209
  /**
193
210
  * Retrieves Display Value for a given cell
194
211
  * @param primaryKeyValue (unique) value in Primary Key Column
@@ -209,10 +226,10 @@ export interface GridApi {
209
226
  getCellNormalisedValue(primaryKeyValue: any, columnId: string): any | undefined;
210
227
  /**
211
228
  * Retrieves Raw Value for Cell in given Row and Column
212
- * @param rowwNode Row to use
229
+ * @param rowNode Row to use
213
230
  * @param columnId ColumnId to lookup
214
231
  */
215
- getRawValueFromRowNode(rowwNode: RowNode, columnId: string): any | undefined;
232
+ getRawValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
216
233
  /**
217
234
  * Retrieves Formatted Value for a given Raw Value in given Column
218
235
  * @param columnId ColumnId to lookup
@@ -221,16 +238,16 @@ export interface GridApi {
221
238
  getFormattedValueFromRawValue(columnId: string, rawValue: any): string | undefined;
222
239
  /**
223
240
  * Retrieves Display Value for Cell in given Row and Column
224
- * @param rowwNode Row to use
241
+ * @param rowNode Row to use
225
242
  * @param columnId ColumnId to lookup
226
243
  */
227
- getDisplayValueFromRowNode(rowwNode: RowNode, columnId: string): any | undefined;
244
+ getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
228
245
  /**
229
246
  * Retrieves Normalised Value for Cell in given Row and Column
230
- * @param rowwNode Row to use
247
+ * @param rowNode Row to use
231
248
  * @param columnId ColumnId to lookup
232
249
  */
233
- getNormalisedValueFromRowNode(rowwNode: RowNode, columnId: string): any | undefined;
250
+ getNormalisedValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
234
251
  /**
235
252
  * Sets the grid to Row Group
236
253
  * @param columnIds ColumnIds to row group
@@ -335,6 +352,11 @@ export interface GridApi {
335
352
  * @param columnIds ColumnIds which contain cells to refresh
336
353
  */
337
354
  refreshCells(rowNodes: RowNode[], columnIds: string[]): void;
355
+ /**
356
+ * Forces a render of a row
357
+ * @param primaryKey row primary key
358
+ */
359
+ refreshRow(primaryKey: any): void;
338
360
  /**
339
361
  * Returns number of rows in Data Source
340
362
  */
@@ -373,4 +395,8 @@ export interface GridApi {
373
395
  * Deselects all selected rows, cells and ranges
374
396
  */
375
397
  deselectAll(): void;
398
+ /**
399
+ * Returns the Grid Container in which the Adaptable Instance is present
400
+ */
401
+ getGridContainerElement(): HTMLElement | null;
376
402
  }
@@ -54,6 +54,6 @@ export declare class AlertApiImpl extends ApiBase implements AlertApi {
54
54
  unSuspendFlashingAlertDefinition(flashingAlertDefinition: FlashingAlertDefinition): FlashingAlertDefinition;
55
55
  addFlashingAlertDefinitions(flashingAlertDefinitions: FlashingAlertDefinition[]): FlashingAlertDefinition[];
56
56
  editFlashingAlertDefinitions(flashingAlertDefinitions: FlashingAlertDefinition[]): FlashingAlertDefinition[];
57
- getAlertDescription(alert: AlertDefinition): string;
57
+ getAlertDescription(alertDefinition: AlertDefinition, dataChangedInfo?: DataChangedInfo): string;
58
58
  getAlertRuleDescription(alert: BaseAlertDefinition): string;
59
59
  }
@@ -284,7 +284,6 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
284
284
  }
285
285
  addFlashingAlertDefinition(flashingAlertDefinition) {
286
286
  this.dispatchAction(AlertRedux.FlashingAlertDefinitionAdd(flashingAlertDefinition));
287
- console.log('flasing alert', flashingAlertDefinition);
288
287
  return this.getFlashingAlertDefinitionById(flashingAlertDefinition.Uuid);
289
288
  }
290
289
  editFlashingAlertDefinition(flashingAlertDefinition) {
@@ -311,9 +310,17 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
311
310
  });
312
311
  return flashingAlertDefinitions === null || flashingAlertDefinitions === void 0 ? void 0 : flashingAlertDefinitions.map((alert) => this.getFlashingAlertDefinitionById(alert === null || alert === void 0 ? void 0 : alert.Uuid));
313
312
  }
314
- getAlertDescription(alert) {
315
- let scopeDescription = this.adaptable.api.scopeApi.getScopeDescription(alert.Scope);
316
- let ruleDescription = this.getAlertRuleDescription(alert);
313
+ getAlertDescription(alertDefinition, dataChangedInfo) {
314
+ if (alertDefinition.MessageText != null) {
315
+ if (typeof alertDefinition.MessageText === 'function') {
316
+ return alertDefinition.MessageText(alertDefinition.Scope, alertDefinition.Rule, dataChangedInfo);
317
+ }
318
+ else {
319
+ return alertDefinition.MessageText;
320
+ }
321
+ }
322
+ let scopeDescription = this.adaptable.api.scopeApi.getScopeDescription(alertDefinition.Scope);
323
+ let ruleDescription = this.getAlertRuleDescription(alertDefinition);
317
324
  return scopeDescription + ' - ' + ruleDescription;
318
325
  }
319
326
  getAlertRuleDescription(alert) {
@@ -2,6 +2,7 @@ import { ApiBase } from './ApiBase';
2
2
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
3
3
  import { DataType } from '../../PredefinedConfig/Common/Enums';
4
4
  import { ColumnApi } from '../ColumnApi';
5
+ import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
5
6
  import { RowNode } from '@ag-grid-community/all-modules';
6
7
  export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
7
8
  getColumns(): AdaptableColumn[];
@@ -49,6 +50,12 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
49
50
  getQueryableColumns(): AdaptableColumn[];
50
51
  private LogMissingColumnWarning;
51
52
  getDistinctDisplayValuesForColumn(columnId: string): any[];
53
+ getDistinctFilterDisplayValuesForColumn(columnId: string, filter: string): Promise<{
54
+ values: any[];
55
+ suppressClientSideFilter: boolean;
56
+ }>;
57
+ getDistinctCustomSortDisplayValuesForColumn(columnId: string): Promise<any[]>;
58
+ getDistinctBulkUpdateDisplayValuesForColumn(columnId: string, selectedGridCells: GridCell[]): Promise<any[]>;
52
59
  getDistinctVisibleDisplayValuesForColumn(columnId: string): any[];
53
60
  getDistinctRawValuesForColumn(columnId: string, skipRowNode?: RowNode): any[];
54
61
  getDistinctVisibleRawValuesForColumn(columnId: string): any[];
@@ -51,7 +51,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
51
51
  // put this here as there might be other indicators we are not aware of
52
52
  // perhaps with non auto groups ?
53
53
  //https://www.ag-grid.com/javascript-grid-grouping/
54
- return columnId.startsWith(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
54
+ return columnId === null || columnId === void 0 ? void 0 : columnId.startsWith(GeneralConstants_1.AG_GRID_GROUPED_COLUMN);
55
55
  }
56
56
  isCalculatedColumn(columnId) {
57
57
  return (this.adaptable.api.calculatedColumnApi
@@ -282,6 +282,42 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
282
282
  return cv.displayValue;
283
283
  });
284
284
  }
285
+ async getDistinctFilterDisplayValuesForColumn(columnId, filter) {
286
+ const abColumn = this.getColumnFromId(columnId);
287
+ if (abColumn == undefined) {
288
+ return {
289
+ values: [],
290
+ suppressClientSideFilter: false,
291
+ };
292
+ }
293
+ const { gridCells, suppressClientSideFilter, } = await this.adaptable.getDistinctFilterValuesForColumn(abColumn, false, filter);
294
+ return {
295
+ values: this.sortDistinctValues(gridCells, abColumn).map((cv) => {
296
+ return cv.displayValue;
297
+ }),
298
+ suppressClientSideFilter,
299
+ };
300
+ }
301
+ async getDistinctCustomSortDisplayValuesForColumn(columnId) {
302
+ const abColumn = this.getColumnFromId(columnId);
303
+ if (abColumn == undefined) {
304
+ return [];
305
+ }
306
+ const gridCells = await this.adaptable.getDistinctCustomSortValuesForColumn(abColumn, false);
307
+ return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
308
+ return cv.displayValue;
309
+ });
310
+ }
311
+ async getDistinctBulkUpdateDisplayValuesForColumn(columnId, selectedGridCells) {
312
+ const abColumn = this.getColumnFromId(columnId);
313
+ if (abColumn == undefined) {
314
+ return [];
315
+ }
316
+ const gridCells = await this.adaptable.getDistinctBulkUpdateValuesForColumn(abColumn, false, selectedGridCells);
317
+ return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
318
+ return cv.displayValue;
319
+ });
320
+ }
285
321
  getDistinctVisibleDisplayValuesForColumn(columnId) {
286
322
  const abColumn = this.getColumnFromId(columnId);
287
323
  if (abColumn == undefined) {
@@ -43,7 +43,7 @@ export declare class ConfigApiImpl extends ApiBase implements ConfigApi {
43
43
  setAdaptableStateKey(adaptableStateKey: string, config?: {
44
44
  predefinedConfig: PredefinedConfig;
45
45
  flushCurrentState?: boolean;
46
- }): PromiseLike<any>;
46
+ }): Promise<any>;
47
47
  getDescriptionForModule(module: AdaptableModule): string;
48
48
  getHelpPageForModule(module: AdaptableModule): string;
49
49
  getUserStateByStateKey(stateKey: AdaptableStateKey, returnJson?: boolean): ConfigState | string;
@@ -132,24 +132,35 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
132
132
  return adaptableSortState;
133
133
  }
134
134
  setAdaptableStateKey(adaptableStateKey, config) {
135
- this.adaptable.adaptableOptions.adaptableStateKey = adaptableStateKey;
136
- const flushCurrentState = !config || config.flushCurrentState !== false;
137
- // make sure we persist any "pending" changes to state - since stateOptions.debounceStateDelay can cause
138
- // the state to be persisted with a delay, which we dont want in this case
139
- const flushStatePromise = flushCurrentState
140
- ? this.adaptable.adaptableStore.saveStateNow(this.adaptable)
141
- : Promise.resolve(true);
142
- return flushStatePromise.then(() => {
143
- let predefinedConfig = config === null || config === void 0 ? void 0 : config.predefinedConfig;
144
- if (predefinedConfig) {
145
- predefinedConfig = AdaptableHelper_1.initPredefinedConfigWithUuids(predefinedConfig);
146
- }
147
- const promise = this.adaptable.adaptableStore.loadStore(this.adaptable, adaptableStateKey, predefinedConfig);
148
- promise.then(() => {
149
- this.adaptable.prepareGrid();
150
- this.adaptable.api.internalApi.hideLoadingScreen();
135
+ return new Promise((resolve, reject) => {
136
+ this.adaptable.api.internalApi.executeWithProgressIndicator(`Initialising...`, () => {
137
+ this.adaptable.adaptableOptions.adaptableStateKey = adaptableStateKey;
138
+ const flushCurrentState = !config || config.flushCurrentState !== false;
139
+ // make sure we persist any "pending" changes to state - since stateOptions.debounceStateDelay can cause
140
+ // the state to be persisted with a delay, which we dont want in this case
141
+ const flushStatePromise = flushCurrentState
142
+ ? this.adaptable.adaptableStore.saveStateNow(this.adaptable)
143
+ : Promise.resolve(true);
144
+ flushStatePromise.then(() => {
145
+ let predefinedConfig = config === null || config === void 0 ? void 0 : config.predefinedConfig;
146
+ if (predefinedConfig) {
147
+ predefinedConfig = AdaptableHelper_1.initPredefinedConfigWithUuids(predefinedConfig);
148
+ }
149
+ const promise = this.adaptable.adaptableStore.loadStore(this.adaptable, adaptableStateKey, predefinedConfig);
150
+ promise
151
+ .then(() => {
152
+ this.adaptable.prepareGrid();
153
+ this.adaptable.api.internalApi.hideLoadingScreen();
154
+ })
155
+ .then(() => {
156
+ // resolve main(result) promise
157
+ resolve();
158
+ }, () => {
159
+ // reject main(result) promise
160
+ reject();
161
+ });
162
+ });
151
163
  });
152
- return promise;
153
164
  });
154
165
  }
155
166
  getDescriptionForModule(module) {
@@ -7,4 +7,5 @@ export declare class DataChangeHistoryApiImpl extends ApiBase implements DataCha
7
7
  deactivateDataChangeHistory(): void;
8
8
  suspendDataChangeHistory(): void;
9
9
  getDataChangeHistoryLog(): DataChangedInfo[];
10
+ undoDataChangeHistoryEntry(dataChangeInfo: DataChangedInfo): void;
10
11
  }
@@ -35,5 +35,8 @@ class DataChangeHistoryApiImpl extends ApiBase_1.ApiBase {
35
35
  const changeLog = (_a = this.getAdaptableState().System.DataChangeHistory.logs) !== null && _a !== void 0 ? _a : {};
36
36
  return Object.values(changeLog);
37
37
  }
38
+ undoDataChangeHistoryEntry(dataChangeInfo) {
39
+ this.dispatchAction(SystemRedux_1.SystemDataChangeHistoryUndo(dataChangeInfo));
40
+ }
38
41
  }
39
42
  exports.DataChangeHistoryApiImpl = DataChangeHistoryApiImpl;
@@ -68,7 +68,8 @@ class FreeTextColumnApiImpl extends ApiBase_1.ApiBase {
68
68
  }
69
69
  }
70
70
  createFreeTextColumn({ columnName, columnId, defaultValue = null, }) {
71
- let freeTextColumn = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn();
71
+ let freeTextColumn = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(this.adaptable.api.internalApi.getAdaptableOptions().filterOptions
72
+ .enableFilterOnSpecialColumns);
72
73
  freeTextColumn.ColumnId = columnId;
73
74
  freeTextColumn.FriendlyName = columnName || columnId;
74
75
  freeTextColumn.DefaultValue = defaultValue;
@@ -13,12 +13,19 @@ import { GridCellRange } from '../../PredefinedConfig/Selection/GridCellRange';
13
13
  export declare class GridApiImpl extends ApiBase implements GridApi {
14
14
  getGridState(): GridState;
15
15
  setGridData(dataSource: any): void;
16
+ getGridData(): any[];
17
+ getFilteredData(): any[];
16
18
  loadGridData(dataSource: any): void;
17
19
  updateGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): void;
18
20
  addGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): void;
19
21
  undoCellEdit(dataChangedInfo: DataChangedInfo): boolean;
20
22
  deleteGridData(dataRows: any[], dataUpdateConfig?: DataUpdateConfig): void;
21
23
  setCellValue(columnId: string, newValue: any, primaryKeyValue: any): void;
24
+ setCellsValue(gridCells: {
25
+ columnId: any;
26
+ newValue: any;
27
+ primaryKeyValue: any;
28
+ }[]): void;
22
29
  getSelectedCellInfo(): SelectedCellInfo;
23
30
  getSelectedRowInfo(): SelectedRowInfo;
24
31
  getCellDisplayValue(primaryKeyValue: any, columnId: string): any | undefined;
@@ -76,6 +83,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
76
83
  unhighlightCell(cellHighlightInfo: CellHighlightInfo): void;
77
84
  unhighlightAllCells(): void;
78
85
  refreshCells(rowNodes: RowNode[], columnIds: string[]): void;
86
+ refreshRow(primaryKey: string): void;
79
87
  areCellsEditable(gridCells: GridCell[]): boolean;
80
88
  getRowCount(): number;
81
89
  getVisibleRowCount(): number;
@@ -85,4 +93,5 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
85
93
  selectAll(): void;
86
94
  deselectAll(): void;
87
95
  destroy(): void;
96
+ getGridContainerElement(): HTMLElement | null;
88
97
  }
@@ -12,6 +12,12 @@ class GridApiImpl extends ApiBase_1.ApiBase {
12
12
  setGridData(dataSource) {
13
13
  this.adaptable.setDataSource(dataSource);
14
14
  }
15
+ getGridData() {
16
+ return this.adaptable.getGridData();
17
+ }
18
+ getFilteredData() {
19
+ return this.adaptable.getFilteredData();
20
+ }
15
21
  loadGridData(dataSource) {
16
22
  this.adaptable.loadDataSource(dataSource);
17
23
  }
@@ -50,6 +56,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
50
56
  }
51
57
  this.adaptable.api.internalApi.setGridCell(gridCell);
52
58
  }
59
+ setCellsValue(gridCells) {
60
+ gridCells === null || gridCells === void 0 ? void 0 : gridCells.forEach((gridCell) => this.setCellValue(gridCell.columnId, gridCell.newValue, gridCell.primaryKeyValue));
61
+ }
53
62
  getSelectedCellInfo() {
54
63
  return this.getGridState().SelectedCellInfo;
55
64
  }
@@ -161,7 +170,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
161
170
  return gridCell ? gridCell.displayValue : undefined;
162
171
  }
163
172
  getFormattedValueFromRawValue(columnId, rawValue) {
164
- return this.adaptable.getDisplayValueFromRawValue(columnId, rawValue, true);
173
+ return this.adaptable.getDisplayValueFromRawValue(columnId, rawValue);
165
174
  }
166
175
  getNormalisedValueFromRowNode(rowNode, columnId) {
167
176
  const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
@@ -273,6 +282,10 @@ class GridApiImpl extends ApiBase_1.ApiBase {
273
282
  refreshCells(rowNodes, columnIds) {
274
283
  this.adaptable.refreshCells(rowNodes, columnIds, true);
275
284
  }
285
+ refreshRow(primaryKey) {
286
+ const rowNode = this.getRowNodeForPrimaryKey(primaryKey);
287
+ this.adaptable.redrawRow(rowNode);
288
+ }
276
289
  areCellsEditable(gridCells) {
277
290
  let returnValue = true;
278
291
  gridCells.forEach((gridCell) => {
@@ -318,5 +331,8 @@ class GridApiImpl extends ApiBase_1.ApiBase {
318
331
  destroy() {
319
332
  this.adaptable.destroy();
320
333
  }
334
+ getGridContainerElement() {
335
+ return this.adaptable.getGridContainerElement();
336
+ }
321
337
  }
322
338
  exports.GridApiImpl = GridApiImpl;
@@ -113,5 +113,7 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
113
113
  destroyFrameworkComponent(containerDomNode: HTMLElement, frameworkComponent: AdaptableFrameworkComponent, componentType: 'toolPanel' | 'toolbar'): void;
114
114
  initializeDataChangeHistory(): void;
115
115
  isTextComparisonCaseSensitive(): boolean;
116
+ executeWithProgressIndicator(label: string, executeFn: () => void): void;
117
+ hideProgressIndicator(): void;
116
118
  dispatchReduxAction(action: Action): void;
117
119
  }
@@ -394,6 +394,22 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
394
394
  isTextComparisonCaseSensitive() {
395
395
  return this.adaptable.adaptableOptions.generalOptions.caseSensitiveTextComparisons;
396
396
  }
397
+ executeWithProgressIndicator(label, executeFn) {
398
+ this.dispatchReduxAction(SystemRedux_1.SystemProgressIndicatorShow(label));
399
+ // setTimeout required to give the ProgressIndicator rendering a head-start (see RAF in ProgressIndicator implementation)
400
+ setTimeout(() => {
401
+ try {
402
+ executeFn();
403
+ }
404
+ catch (error) {
405
+ this.hideProgressIndicator();
406
+ LoggingHelper_1.LogAdaptableError('Unexpected error while executing a function with a progress indicator', error);
407
+ }
408
+ }, 16);
409
+ }
410
+ hideProgressIndicator() {
411
+ this.dispatchReduxAction(SystemRedux_1.SystemProgressIndicatorHide());
412
+ }
397
413
  // General way to get to store from inside Adaptable...
398
414
  dispatchReduxAction(action) {
399
415
  this.dispatchAction(action);
@@ -1,6 +1,7 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
3
3
  import { QueryLanguageApi } from '../QueryLanguageApi';
4
+ import { ExpressionFunctionMap } from '../../types';
4
5
  export declare class QueryLanguageApiImpl extends ApiBase implements QueryLanguageApi {
5
6
  isValidBooleanExpression(query: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
6
7
  isValidObservableExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
@@ -8,4 +9,5 @@ export declare class QueryLanguageApiImpl extends ApiBase implements QueryLangua
8
9
  getASTForExpression(query: string): any;
9
10
  getColumnsFromExpression(expression: string): string[];
10
11
  getQueryableColumnIds(): string[] | undefined;
12
+ getModuleExpressionFunctionMap(): ExpressionFunctionMap;
11
13
  }
@@ -67,5 +67,8 @@ class QueryLanguageApiImpl extends ApiBase_1.ApiBase {
67
67
  }
68
68
  }
69
69
  }
70
+ getModuleExpressionFunctionMap() {
71
+ return this.getQueryLanguageOptions().moduleExpressionFunctions;
72
+ }
70
73
  }
71
74
  exports.QueryLanguageApiImpl = QueryLanguageApiImpl;
@@ -3,19 +3,22 @@ import { UserInterfaceApi } from '../UserInterfaceApi';
3
3
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { AdaptableStyle } from '../../PredefinedConfig/Common/AdaptableStyle';
5
5
  import { UserMenuItem } from '../../PredefinedConfig/Common/Menu';
6
- import { ActionColumn, CellValuesList } from '../../AdaptableOptions/UserInterfaceOptions';
6
+ import { ActionColumn, BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../../AdaptableOptions/UserInterfaceOptions';
7
7
  export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfaceApi {
8
8
  getColorPalette(): string[];
9
9
  getStyleClassNames(): string[] | undefined;
10
- getAllPermittedValuesItems(): CellValuesList[];
11
- private getPermittedValuesItemsWithColumnScope;
12
- private getPermittedValuesItemsWithDataTypeScope;
13
- private getPermittedValuesItemsWithAllScope;
10
+ getAllPermittedValuesItems(): PermittedValues[];
14
11
  private getPermittedValuesForScope;
15
12
  getPermittedValuesForColumn(column: AdaptableColumn): any[] | undefined;
16
- getAllEditLookUpItems(): CellValuesList[];
17
- getEditLookUpItemForColumn(columnId: string): CellValuesList | undefined;
18
- getEditLookUpValuesForEditLookUpItem(editLookUpItem: CellValuesList, columnId: string): any[] | undefined;
13
+ getAllFilterPermittedValuesItems(): FilterPermittedValues[];
14
+ getFilterPermittedValuesForColumn(column: AdaptableColumn): FilterPermittedValues | undefined;
15
+ getAllCustomSortPermittedValuesItems(): CustomSortPermittedValues[];
16
+ getCustomSortPermittedValuesForColumn(column: AdaptableColumn): CustomSortPermittedValues | undefined;
17
+ getAllBulkUpdatePermittedValuesItems(): BulkUpdatePermittedValues[];
18
+ getBulkUpdatePermittedValuesForColumn(column: AdaptableColumn): BulkUpdatePermittedValues | undefined;
19
+ getAllEditLookUpItems(): EditLookUpPermittedValues[];
20
+ getEditLookUpItemForColumn(column: AdaptableColumn): EditLookUpPermittedValues | undefined;
21
+ getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues, columnId: string, data: any): any[] | undefined;
19
22
  addColumnMenuItem(columnMenuItem: UserMenuItem): void;
20
23
  addContextMenuItem(contextMenuItem: UserMenuItem): void;
21
24
  getEditableCellStyle(): AdaptableStyle | undefined;