@adaptabletools/adaptable 10.0.0 → 10.0.4-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.
- package/base.css +77 -29
- package/index.css +89 -31
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +88 -4
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +39 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +16 -9
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +8 -0
- package/src/Api/Implementation/ColumnApiImpl.js +69 -36
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +1 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +25 -10
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +20 -4
- package/src/Api/Implementation/LayoutApiImpl.js +3 -3
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +3 -0
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +59 -86
- package/src/Api/InternalApi.d.ts +3 -1
- package/src/Api/QueryLanguageApi.d.ts +5 -0
- package/src/Api/UserInterfaceApi.d.ts +16 -6
- package/src/PredefinedConfig/AlertState.d.ts +10 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/{Utilities/Interface/ProgressIndicator.js → PredefinedConfig/Common/SpecialColumnSettings.js} +0 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +7 -1
- package/src/Redux/Store/AdaptableStore.js +7 -3
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.js +12 -11
- package/src/Strategy/BulkUpdateModule.js +5 -5
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +5 -5
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.js +6 -6
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/DateHelper.d.ts +8 -2
- package/src/Utilities/Helpers/DateHelper.js +42 -20
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +14 -2
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/MetamodelService.js +1 -0
- package/src/Utilities/Services/ModuleService.js +31 -24
- package/src/Utilities/Services/ReportService.js +12 -12
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +53 -32
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +72 -31
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +6 -6
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +3 -3
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +3 -3
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.d.ts +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +6 -8
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +20 -3
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +234 -102
- package/src/agGrid/agGridHelper.js +32 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +8 -7
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/metamodel/adaptable.metamodel.d.ts +125 -7
- package/src/metamodel/adaptable.metamodel.js +416 -101
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
package/src/Api/ColumnApi.d.ts
CHANGED
|
@@ -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,20 @@ 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;
|
|
272
|
+
/**
|
|
273
|
+
* Checks if a column is referenced in a given Expression
|
|
274
|
+
* @param columnId Column to Check
|
|
275
|
+
* @param expression Expression to Lookup
|
|
276
|
+
*/
|
|
277
|
+
isColumnReferencedInExpression(columnId: string, expression: string): boolean;
|
|
239
278
|
}
|
package/src/Api/ConfigApi.d.ts
CHANGED
|
@@ -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
|
}
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -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
|
|
205
|
+
* @param rowNode Row to use
|
|
189
206
|
* @param columnId ColumnId to lookup
|
|
190
207
|
*/
|
|
191
|
-
getGridCellFromRowNode(
|
|
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
|
|
229
|
+
* @param rowNode Row to use
|
|
213
230
|
* @param columnId ColumnId to lookup
|
|
214
231
|
*/
|
|
215
|
-
getRawValueFromRowNode(
|
|
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
|
|
241
|
+
* @param rowNode Row to use
|
|
225
242
|
* @param columnId ColumnId to lookup
|
|
226
243
|
*/
|
|
227
|
-
getDisplayValueFromRowNode(
|
|
244
|
+
getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
|
|
228
245
|
/**
|
|
229
246
|
* Retrieves Normalised Value for Cell in given Row and Column
|
|
230
|
-
* @param
|
|
247
|
+
* @param rowNode Row to use
|
|
231
248
|
* @param columnId ColumnId to lookup
|
|
232
249
|
*/
|
|
233
|
-
getNormalisedValueFromRowNode(
|
|
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(
|
|
57
|
+
getAlertDescription(alertDefinition: AlertDefinition, dataChangedInfo?: DataChangedInfo): string;
|
|
58
58
|
getAlertRuleDescription(alert: BaseAlertDefinition): string;
|
|
59
59
|
}
|
|
@@ -117,7 +117,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
117
117
|
}
|
|
118
118
|
if (actionName === 'highlight-cell') {
|
|
119
119
|
this.adaptable.api.gridApi.highlightCell({
|
|
120
|
-
columnId: dataChangedInfo.columnId,
|
|
120
|
+
columnId: dataChangedInfo.column.columnId,
|
|
121
121
|
primaryKeyValue: dataChangedInfo.primaryKeyValue,
|
|
122
122
|
highlightType: alertDefinition.MessageType,
|
|
123
123
|
timeout: this.getNotificationsOptions().cellHighlightDuration,
|
|
@@ -125,11 +125,11 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
if (actionName === 'jump-to-cell') {
|
|
128
|
-
this.adaptable.api.gridApi.jumpToCell(dataChangedInfo.primaryKeyValue, dataChangedInfo.columnId);
|
|
128
|
+
this.adaptable.api.gridApi.jumpToCell(dataChangedInfo.primaryKeyValue, dataChangedInfo.column.columnId);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
if (actionName === 'jump-to-column') {
|
|
132
|
-
this.adaptable.api.gridApi.jumpToColumn(dataChangedInfo.columnId);
|
|
132
|
+
this.adaptable.api.gridApi.jumpToColumn(dataChangedInfo.column.columnId);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
if (actionName === 'suspend') {
|
|
@@ -212,7 +212,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
212
212
|
}
|
|
213
213
|
// 4: Jump to the Cell
|
|
214
214
|
if (alertProperties.JumpToCell && dataChangedInfo) {
|
|
215
|
-
this.adaptable.jumpToCell(dataChangedInfo.columnId, dataChangedInfo.rowNode);
|
|
215
|
+
this.adaptable.jumpToCell(dataChangedInfo.column.columnId, dataChangedInfo.rowNode);
|
|
216
216
|
}
|
|
217
217
|
// 5: Hight the cell - though that is taken care of in the Style Service
|
|
218
218
|
if (alertProperties.HighlightCell && dataChangedInfo) {
|
|
@@ -221,7 +221,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
|
|
|
221
221
|
alertNode = this.adaptable.getRowNodeForPrimaryKey(dataChangedInfo.primaryKeyValue);
|
|
222
222
|
}
|
|
223
223
|
if (alertNode) {
|
|
224
|
-
this.adaptable.api.gridApi.refreshCells([alertNode], [dataChangedInfo.columnId]);
|
|
224
|
+
this.adaptable.api.gridApi.refreshCells([alertNode], [dataChangedInfo.column.columnId]);
|
|
225
225
|
setTimeout(() => {
|
|
226
226
|
this.dispatchAction(SystemRedux.SystemAlertRemoveHighlight(alertToShow));
|
|
227
227
|
}, this.adaptable.adaptableOptions.notificationsOptions.cellHighlightDuration);
|
|
@@ -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(
|
|
315
|
-
|
|
316
|
-
|
|
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) {
|
|
@@ -13,4 +13,7 @@ export declare class CalculatedColumnApiImpl extends ApiBase implements Calculat
|
|
|
13
13
|
deleteCalculatedColumn(column: string): void;
|
|
14
14
|
showCalculatedColumnPopup(): void;
|
|
15
15
|
getCalculatedColumnModuleReferences(calculatedColumn: CalculatedColumn): string[];
|
|
16
|
+
getCalculatedColumnsReferencingColumnId(columnId: string): CalculatedColumn[];
|
|
17
|
+
getReferencedColumnIdsForCalculatedColumn(calculatedColumn: CalculatedColumn): string[];
|
|
18
|
+
getReferencedColumnIdsForCalculatedColumnId(calculatedColumnId: string): string[];
|
|
16
19
|
}
|
|
@@ -60,5 +60,28 @@ class CalculatedColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
60
60
|
});
|
|
61
61
|
return references;
|
|
62
62
|
}
|
|
63
|
+
getCalculatedColumnsReferencingColumnId(columnId) {
|
|
64
|
+
var calcColumns = [];
|
|
65
|
+
this.getAllCalculatedColumn().forEach((calculatedColumn) => {
|
|
66
|
+
var _a;
|
|
67
|
+
if (this.adaptable.api.columnApi.isColumnReferencedInExpression(columnId, (_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression)) {
|
|
68
|
+
calcColumns.push(calculatedColumn);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return calcColumns;
|
|
72
|
+
}
|
|
73
|
+
getReferencedColumnIdsForCalculatedColumn(calculatedColumn) {
|
|
74
|
+
var _a;
|
|
75
|
+
const columnIds = this.adaptable.api.queryLanguageApi.getColumnsFromExpression((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
76
|
+
return columnIds;
|
|
77
|
+
}
|
|
78
|
+
getReferencedColumnIdsForCalculatedColumnId(calculatedColumnId) {
|
|
79
|
+
const calculatedColumn = this.adaptable.api.calculatedColumnApi
|
|
80
|
+
.getAllCalculatedColumn()
|
|
81
|
+
.find((cc) => cc.ColumnId == calculatedColumnId);
|
|
82
|
+
if (calculatedColumn) {
|
|
83
|
+
return this.getReferencedColumnIdsForCalculatedColumn(calculatedColumn);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
63
86
|
}
|
|
64
87
|
exports.CalculatedColumnApiImpl = CalculatedColumnApiImpl;
|
|
@@ -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[];
|
|
@@ -57,4 +64,5 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
|
|
|
57
64
|
getAllColumnFriendlyNames(): string[];
|
|
58
65
|
usesAdaptableFilterForm(columnId: string): boolean;
|
|
59
66
|
usesAdaptableQuickFilter(columnId: string): boolean;
|
|
67
|
+
isColumnReferencedInExpression(columnId: string, expression: string): boolean;
|
|
60
68
|
}
|
|
@@ -18,7 +18,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
18
18
|
acc[colId] = true;
|
|
19
19
|
return acc;
|
|
20
20
|
}, {});
|
|
21
|
-
return this.getColumns().filter((c) => visibleCols[c.
|
|
21
|
+
return this.getColumns().filter((c) => visibleCols[c.columnId]);
|
|
22
22
|
}
|
|
23
23
|
selectColumn(columnId) {
|
|
24
24
|
this.adaptable.selectColumn(columnId);
|
|
@@ -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
|
|
@@ -78,33 +78,33 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
isNumericColumn(column) {
|
|
81
|
-
return column.
|
|
81
|
+
return column.dataType == Enums_1.DataType.Number;
|
|
82
82
|
}
|
|
83
83
|
isBooleanColumn(column) {
|
|
84
|
-
return column.
|
|
84
|
+
return column.dataType == Enums_1.DataType.Boolean;
|
|
85
85
|
}
|
|
86
86
|
isDateColumn(column) {
|
|
87
|
-
return column.
|
|
87
|
+
return column.dataType == Enums_1.DataType.Date;
|
|
88
88
|
}
|
|
89
89
|
getColumnDataTypeFromColumnId(columnId) {
|
|
90
90
|
const column = this.getColumnFromId(columnId); // this.getColumns().find(c => c.ColumnId == columnId);
|
|
91
91
|
if (!column) {
|
|
92
92
|
return undefined;
|
|
93
93
|
}
|
|
94
|
-
return column.
|
|
94
|
+
return column.dataType;
|
|
95
95
|
}
|
|
96
96
|
getFriendlyNameFromColumn(columnId, column) {
|
|
97
97
|
if (columnId.includes(GeneralConstants.MISSING_COLUMN)) {
|
|
98
98
|
return columnId;
|
|
99
99
|
}
|
|
100
100
|
if (column) {
|
|
101
|
-
return column.
|
|
101
|
+
return column.friendlyName;
|
|
102
102
|
}
|
|
103
103
|
this.LogMissingColumnWarning(columnId);
|
|
104
104
|
return columnId + GeneralConstants.MISSING_COLUMN;
|
|
105
105
|
}
|
|
106
106
|
getFriendlyNameFromColumnId(columnId) {
|
|
107
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
107
|
+
const foundColumn = this.getColumns().find((c) => c.columnId == columnId);
|
|
108
108
|
if (foundColumn) {
|
|
109
109
|
return this.getFriendlyNameFromColumn(columnId, foundColumn);
|
|
110
110
|
}
|
|
@@ -130,9 +130,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
130
130
|
if (friendlyName.includes(GeneralConstants.MISSING_COLUMN)) {
|
|
131
131
|
return friendlyName.replace(GeneralConstants.MISSING_COLUMN, ''); // Ids should stay "pure"
|
|
132
132
|
}
|
|
133
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
133
|
+
const foundColumn = this.getColumns().find((c) => c.friendlyName == friendlyName);
|
|
134
134
|
if (foundColumn) {
|
|
135
|
-
return foundColumn.
|
|
135
|
+
return foundColumn.columnId;
|
|
136
136
|
}
|
|
137
137
|
this.LogMissingColumnWarning(friendlyName);
|
|
138
138
|
return friendlyName + GeneralConstants.MISSING_COLUMN;
|
|
@@ -149,7 +149,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
149
149
|
}
|
|
150
150
|
getColumnsFromFriendlyNames(friendlyNames) {
|
|
151
151
|
// not sure if this is right as might ignore bad cols
|
|
152
|
-
return friendlyNames.map((friendlyName) => this.getColumns().find((x) => x.
|
|
152
|
+
return friendlyNames.map((friendlyName) => this.getColumns().find((x) => x.friendlyName == friendlyName));
|
|
153
153
|
}
|
|
154
154
|
getColumnsFromIds(columnIds, logWarning = true) {
|
|
155
155
|
let returnCols = [];
|
|
@@ -166,7 +166,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
166
166
|
if (ArrayExtensions_1.default.IsNullOrEmpty(this.getColumns())) {
|
|
167
167
|
return null;
|
|
168
168
|
}
|
|
169
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
169
|
+
const foundColumn = this.getColumns().find((c) => c.columnId == columnId);
|
|
170
170
|
if (foundColumn) {
|
|
171
171
|
return foundColumn;
|
|
172
172
|
}
|
|
@@ -176,20 +176,13 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
176
176
|
return undefined;
|
|
177
177
|
}
|
|
178
178
|
getColumnIdsFromId(columnId, logWarning = false) {
|
|
179
|
-
var _a;
|
|
180
179
|
const col = this.getColumnFromId(columnId, logWarning);
|
|
181
180
|
if (col) {
|
|
182
|
-
if (this.isCalculatedColumn(col.
|
|
183
|
-
|
|
184
|
-
.getAllCalculatedColumn()
|
|
185
|
-
.find((cc) => cc.ColumnId == col.ColumnId);
|
|
186
|
-
if (calculatedColumn) {
|
|
187
|
-
const columnIds = this.adaptable.api.queryLanguageApi.getColumnsFromExpression((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
188
|
-
return columnIds;
|
|
189
|
-
}
|
|
181
|
+
if (this.isCalculatedColumn(col.columnId)) {
|
|
182
|
+
return this.adaptable.api.calculatedColumnApi.getReferencedColumnIdsForCalculatedColumnId(col.columnId);
|
|
190
183
|
}
|
|
191
184
|
else {
|
|
192
|
-
return [col.
|
|
185
|
+
return [col.columnId];
|
|
193
186
|
}
|
|
194
187
|
}
|
|
195
188
|
return undefined;
|
|
@@ -202,7 +195,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
202
195
|
if (ArrayExtensions_1.default.IsNullOrEmpty(this.getColumns())) {
|
|
203
196
|
return null;
|
|
204
197
|
}
|
|
205
|
-
const foundColumn = this.getColumns().find((c) => c.
|
|
198
|
+
const foundColumn = this.getColumns().find((c) => c.friendlyName == columnName);
|
|
206
199
|
if (foundColumn) {
|
|
207
200
|
return foundColumn;
|
|
208
201
|
}
|
|
@@ -230,36 +223,36 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
230
223
|
}
|
|
231
224
|
}
|
|
232
225
|
getNumericColumns() {
|
|
233
|
-
return this.getColumns().filter((c) => c.
|
|
226
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Number);
|
|
234
227
|
}
|
|
235
228
|
getNumericArrayColumns() {
|
|
236
|
-
return this.getColumns().filter((c) => c.
|
|
229
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.NumberArray);
|
|
237
230
|
}
|
|
238
231
|
getStringColumns() {
|
|
239
|
-
return this.getColumns().filter((c) => c.
|
|
232
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.String);
|
|
240
233
|
}
|
|
241
234
|
getDateColumns() {
|
|
242
|
-
return this.getColumns().filter((c) => c.
|
|
235
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Date);
|
|
243
236
|
}
|
|
244
237
|
getBooleanColumns() {
|
|
245
|
-
return this.getColumns().filter((c) => c.
|
|
238
|
+
return this.getColumns().filter((c) => c.dataType == Enums_1.DataType.Boolean);
|
|
246
239
|
}
|
|
247
240
|
getSortableColumns() {
|
|
248
|
-
return this.getColumns().filter((c) => c.
|
|
241
|
+
return this.getColumns().filter((c) => c.sortable);
|
|
249
242
|
}
|
|
250
243
|
getGroupableColumns() {
|
|
251
|
-
return this.getColumns().filter((c) => c.
|
|
244
|
+
return this.getColumns().filter((c) => c.groupable);
|
|
252
245
|
}
|
|
253
246
|
getPivotableColumns() {
|
|
254
|
-
return this.getColumns().filter((c) => c.
|
|
247
|
+
return this.getColumns().filter((c) => c.pivotable);
|
|
255
248
|
}
|
|
256
249
|
getAggregetableColumns() {
|
|
257
250
|
return this.getColumns()
|
|
258
|
-
.filter((c) => c.
|
|
259
|
-
.filter((c) => c.
|
|
251
|
+
.filter((c) => c.aggregatable)
|
|
252
|
+
.filter((c) => c.dataType == Enums_1.DataType.Number);
|
|
260
253
|
}
|
|
261
254
|
getQueryableColumns() {
|
|
262
|
-
return this.getColumns().filter((c) => c.
|
|
255
|
+
return this.getColumns().filter((c) => c.queryable);
|
|
263
256
|
}
|
|
264
257
|
LogMissingColumnWarning(columnId) {
|
|
265
258
|
if (this.adaptable.adaptableOptions.generalOptions.showMissingColumnsWarning &&
|
|
@@ -282,6 +275,42 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
282
275
|
return cv.displayValue;
|
|
283
276
|
});
|
|
284
277
|
}
|
|
278
|
+
async getDistinctFilterDisplayValuesForColumn(columnId, filter) {
|
|
279
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
280
|
+
if (abColumn == undefined) {
|
|
281
|
+
return {
|
|
282
|
+
values: [],
|
|
283
|
+
suppressClientSideFilter: false,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const { gridCells, suppressClientSideFilter, } = await this.adaptable.getDistinctFilterValuesForColumn(abColumn, false, filter);
|
|
287
|
+
return {
|
|
288
|
+
values: this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
289
|
+
return cv.displayValue;
|
|
290
|
+
}),
|
|
291
|
+
suppressClientSideFilter,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
async getDistinctCustomSortDisplayValuesForColumn(columnId) {
|
|
295
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
296
|
+
if (abColumn == undefined) {
|
|
297
|
+
return [];
|
|
298
|
+
}
|
|
299
|
+
const gridCells = await this.adaptable.getDistinctCustomSortValuesForColumn(abColumn, false);
|
|
300
|
+
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
301
|
+
return cv.displayValue;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
async getDistinctBulkUpdateDisplayValuesForColumn(columnId, selectedGridCells) {
|
|
305
|
+
const abColumn = this.getColumnFromId(columnId);
|
|
306
|
+
if (abColumn == undefined) {
|
|
307
|
+
return [];
|
|
308
|
+
}
|
|
309
|
+
const gridCells = await this.adaptable.getDistinctBulkUpdateValuesForColumn(abColumn, false, selectedGridCells);
|
|
310
|
+
return this.sortDistinctValues(gridCells, abColumn).map((cv) => {
|
|
311
|
+
return cv.displayValue;
|
|
312
|
+
});
|
|
313
|
+
}
|
|
285
314
|
getDistinctVisibleDisplayValuesForColumn(columnId) {
|
|
286
315
|
const abColumn = this.getColumnFromId(columnId);
|
|
287
316
|
if (abColumn == undefined) {
|
|
@@ -316,7 +345,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
316
345
|
// this does NOT into account Custom Sort - far too hard for now...
|
|
317
346
|
let sortOrder = Enums_1.SortOrder.Asc;
|
|
318
347
|
if (this.getFilterOptions().sortColumnValuesInFilter) {
|
|
319
|
-
let columnSort = this.adaptable.api.gridApi.getColumnSortForColumn(column.
|
|
348
|
+
let columnSort = this.adaptable.api.gridApi.getColumnSortForColumn(column.columnId);
|
|
320
349
|
if (columnSort && columnSort.SortOrder == 'Desc') {
|
|
321
350
|
sortOrder = Enums_1.SortOrder.Desc;
|
|
322
351
|
}
|
|
@@ -337,7 +366,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
337
366
|
}
|
|
338
367
|
getAllColumnFriendlyNames() {
|
|
339
368
|
return this.getColumns().map((c) => {
|
|
340
|
-
return c.
|
|
369
|
+
return c.friendlyName;
|
|
341
370
|
});
|
|
342
371
|
}
|
|
343
372
|
usesAdaptableFilterForm(columnId) {
|
|
@@ -362,5 +391,9 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
362
391
|
}
|
|
363
392
|
return true;
|
|
364
393
|
}
|
|
394
|
+
isColumnReferencedInExpression(columnId, expression) {
|
|
395
|
+
const colIds = this.adaptable.api.queryLanguageApi.getColumnsFromExpression(expression);
|
|
396
|
+
return colIds.some((c) => c === columnId);
|
|
397
|
+
}
|
|
365
398
|
}
|
|
366
399
|
exports.ColumnApiImpl = ColumnApiImpl;
|
|
@@ -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
|
-
}):
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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) {
|