@adaptabletools/adaptable 10.0.2 → 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.
- package/base.css +68 -26
- package/index.css +80 -28
- package/package.json +1 -1
- 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 +89 -4
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/ColumnApi.d.ts +33 -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 +11 -4
- package/src/Api/Implementation/ColumnApiImpl.d.ts +7 -0
- package/src/Api/Implementation/ColumnApiImpl.js +37 -1
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +2 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +17 -1
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
- package/src/Api/Implementation/InternalApiImpl.js +16 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +11 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +57 -80
- package/src/Api/InternalApi.d.ts +2 -0
- package/src/Api/UserInterfaceApi.d.ts +14 -5
- package/src/PredefinedConfig/AlertState.d.ts +5 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -15
- 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/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/Store/AdaptableStore.js +4 -0
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +58 -61
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +13 -1
- package/src/Utilities/Services/MetamodelService.js +1 -0
- package/src/Utilities/Services/ReportService.js +1 -1
- 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/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +4 -2
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +44 -23
- 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 +64 -23
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +45 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +3 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +3 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- 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 +166 -50
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- 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 +72 -2
- package/src/metamodel/adaptable.metamodel.js +304 -69
- 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/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
|
}
|
|
@@ -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) {
|
|
@@ -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
|
-
}):
|
|
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) {
|
|
@@ -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
|
|
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);
|
|
@@ -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,
|
|
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():
|
|
11
|
-
private getPermittedValuesItemsWithColumnScope;
|
|
12
|
-
private getPermittedValuesItemsWithDataTypeScope;
|
|
13
|
-
private getPermittedValuesItemsWithAllScope;
|
|
10
|
+
getAllPermittedValuesItems(): PermittedValues[];
|
|
14
11
|
private getPermittedValuesForScope;
|
|
15
12
|
getPermittedValuesForColumn(column: AdaptableColumn): any[] | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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;
|
|
@@ -22,51 +22,32 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
22
22
|
return this.getUserInterfaceOptions().styleClassNames;
|
|
23
23
|
}
|
|
24
24
|
getAllPermittedValuesItems() {
|
|
25
|
-
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.permittedValues) !== null && _b !== void 0 ? _b : [];
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
return this.getAllPermittedValuesItems().filter((pv) => {
|
|
29
|
-
return 'ColumnIds' in pv.scope == true;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
getPermittedValuesItemsWithDataTypeScope() {
|
|
33
|
-
return this.getAllPermittedValuesItems().filter((pv) => {
|
|
34
|
-
return 'DataTypes' in pv.scope == true;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
getPermittedValuesItemsWithAllScope() {
|
|
38
|
-
return this.getAllPermittedValuesItems().filter((pv) => {
|
|
39
|
-
return 'All' in pv.scope == true;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
getPermittedValuesForScope(column) {
|
|
28
|
+
getPermittedValuesForScope(column, permittedValues) {
|
|
43
29
|
let permittedValuesItem;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The previous implementation prioritized column-id, data-types and all
|
|
32
|
+
*/
|
|
33
|
+
// columns id
|
|
34
|
+
permittedValuesItem = permittedValues.find((permittedValue) => {
|
|
35
|
+
return ('ColumnIds' in permittedValue.scope &&
|
|
36
|
+
this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
|
|
50
37
|
});
|
|
51
38
|
if (permittedValuesItem) {
|
|
52
39
|
return permittedValuesItem;
|
|
53
40
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
permittedValuesItem = pv;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
41
|
+
permittedValuesItem = permittedValues.find((permittedValue) => {
|
|
42
|
+
return ('DataTypes' in permittedValue.scope &&
|
|
43
|
+
this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
|
|
60
44
|
});
|
|
61
45
|
if (permittedValuesItem) {
|
|
62
46
|
return permittedValuesItem;
|
|
63
47
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
permittedValuesItem = pv;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
48
|
+
permittedValuesItem = permittedValues.find((permittedValue) => {
|
|
49
|
+
return ('All' in permittedValue.scope &&
|
|
50
|
+
this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
|
|
70
51
|
});
|
|
71
52
|
if (permittedValuesItem) {
|
|
72
53
|
return permittedValuesItem;
|
|
@@ -77,7 +58,8 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
77
58
|
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(this.getAllPermittedValuesItems())) {
|
|
78
59
|
return undefined;
|
|
79
60
|
}
|
|
80
|
-
|
|
61
|
+
const allPermittedValues = this.getAllPermittedValuesItems();
|
|
62
|
+
let permittedValuesColumn = this.getPermittedValuesForScope(column, allPermittedValues);
|
|
81
63
|
if (!permittedValuesColumn) {
|
|
82
64
|
return undefined;
|
|
83
65
|
}
|
|
@@ -96,58 +78,53 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
96
78
|
}
|
|
97
79
|
return undefined;
|
|
98
80
|
}
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
getAllFilterPermittedValuesItems() {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.filterPermittedValues) !== null && _b !== void 0 ? _b : [];
|
|
101
84
|
}
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
85
|
+
getFilterPermittedValuesForColumn(column) {
|
|
86
|
+
const allFilterPermittedValuesItems = this.getAllFilterPermittedValuesItems();
|
|
87
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(allFilterPermittedValuesItems)) {
|
|
105
88
|
return undefined;
|
|
106
89
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
return this.getPermittedValuesForScope(column, allFilterPermittedValuesItems);
|
|
91
|
+
}
|
|
92
|
+
getAllCustomSortPermittedValuesItems() {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.customSortPermittedValues) !== null && _b !== void 0 ? _b : [];
|
|
95
|
+
}
|
|
96
|
+
getCustomSortPermittedValuesForColumn(column) {
|
|
97
|
+
const allFilterPermittedValuesItems = this.getAllCustomSortPermittedValuesItems();
|
|
98
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(allFilterPermittedValuesItems)) {
|
|
110
99
|
return undefined;
|
|
111
100
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return editLookUpItem;
|
|
101
|
+
return this.getPermittedValuesForScope(column, allFilterPermittedValuesItems);
|
|
102
|
+
}
|
|
103
|
+
getAllBulkUpdatePermittedValuesItems() {
|
|
104
|
+
var _a, _b;
|
|
105
|
+
return (_b = (_a = this.getUserInterfaceOptions()) === null || _a === void 0 ? void 0 : _a.bulkUpdatePermittedValues) !== null && _b !== void 0 ? _b : [];
|
|
106
|
+
}
|
|
107
|
+
getBulkUpdatePermittedValuesForColumn(column) {
|
|
108
|
+
const allFilterPermittedValuesItems = this.getAllBulkUpdatePermittedValuesItems();
|
|
109
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(allFilterPermittedValuesItems)) {
|
|
110
|
+
return undefined;
|
|
123
111
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
133
|
-
if (editLookUpItem) {
|
|
134
|
-
return editLookUpItem;
|
|
112
|
+
return this.getPermittedValuesForScope(column, allFilterPermittedValuesItems);
|
|
113
|
+
}
|
|
114
|
+
getAllEditLookUpItems() {
|
|
115
|
+
return this.getUserInterfaceOptions().editLookUpItems || [];
|
|
116
|
+
}
|
|
117
|
+
getEditLookUpItemForColumn(column) {
|
|
118
|
+
if (!column) {
|
|
119
|
+
return undefined;
|
|
135
120
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return
|
|
139
|
-
});
|
|
140
|
-
allTypeEditLookItems.forEach((eli) => {
|
|
141
|
-
if (this.adaptable.api.scopeApi.isColumnInScope(abColumn, eli.scope)) {
|
|
142
|
-
editLookUpItem = eli;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
if (editLookUpItem) {
|
|
146
|
-
return editLookUpItem;
|
|
121
|
+
let editLookUpItems = this.getAllEditLookUpItems();
|
|
122
|
+
if (!editLookUpItems) {
|
|
123
|
+
return undefined;
|
|
147
124
|
}
|
|
148
|
-
return
|
|
125
|
+
return this.getPermittedValuesForScope(column, editLookUpItems);
|
|
149
126
|
}
|
|
150
|
-
getEditLookUpValuesForEditLookUpItem(editLookUpItem, columnId) {
|
|
127
|
+
getEditLookUpValuesForEditLookUpItem(editLookUpItem, columnId, data) {
|
|
151
128
|
if (!editLookUpItem) {
|
|
152
129
|
return undefined;
|
|
153
130
|
}
|
|
@@ -158,7 +135,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
158
135
|
let editLookUpValues = editLookUpItem.values;
|
|
159
136
|
// first do the function then get hardcoded items
|
|
160
137
|
if (editLookUpValues != null && typeof editLookUpValues === 'function') {
|
|
161
|
-
return editLookUpValues(column);
|
|
138
|
+
return editLookUpValues(column, data);
|
|
162
139
|
}
|
|
163
140
|
else {
|
|
164
141
|
let arr = editLookUpValues;
|
package/src/Api/InternalApi.d.ts
CHANGED
|
@@ -116,4 +116,6 @@ export interface InternalApi {
|
|
|
116
116
|
destroyFrameworkComponent(containerDomNode: HTMLElement, frameworkComponent: AdaptableFrameworkComponent, componentType: 'toolPanel' | 'toolbar'): void;
|
|
117
117
|
initializeDataChangeHistory(): void;
|
|
118
118
|
isTextComparisonCaseSensitive(): boolean;
|
|
119
|
+
executeWithProgressIndicator(label: string, executeFn: () => unknown): void;
|
|
120
|
+
hideProgressIndicator(): void;
|
|
119
121
|
}
|