@adaptabletools/adaptable-cjs 18.0.0-canary.25 → 18.0.0-canary.26
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/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
- package/src/AdaptableOptions/CommentOptions.d.ts +2 -2
- package/src/AdaptableOptions/MenuOptions.d.ts +4 -4
- package/src/Api/GridApi.d.ts +2 -1
- package/src/Api/Implementation/ActionRowApiImpl.js +3 -7
- package/src/Api/Implementation/AlertApiImpl.js +5 -10
- package/src/Api/Implementation/CalendarApiImpl.js +1 -6
- package/src/Api/Implementation/ChartingApiImpl.js +3 -3
- package/src/Api/Implementation/ColumnApiImpl.js +6 -6
- package/src/Api/Implementation/ColumnFilterApiImpl.js +7 -7
- package/src/Api/Implementation/CommentsApiImpl.js +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +11 -17
- package/src/Api/Implementation/DashboardApiImpl.js +1 -6
- package/src/Api/Implementation/ExportApiImpl.js +5 -10
- package/src/Api/Implementation/ExpressionApiImpl.js +8 -13
- package/src/Api/Implementation/Fdc3ApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +3 -8
- package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
- package/src/Api/Implementation/GridApiImpl.js +11 -8
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +2 -13
- package/src/Api/Implementation/PredicateApiImpl.js +2 -2
- package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
- package/src/Api/Implementation/ScopeApiImpl.js +10 -10
- package/src/Api/Implementation/TeamSharingApiImpl.js +3 -15
- package/src/Api/Implementation/ThemeApiImpl.js +2 -7
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -13
- package/src/Api/Internal/ActionRowInternalApi.js +7 -45
- package/src/Api/Internal/AdaptableInternalApi.js +2 -12
- package/src/Api/Internal/AlertInternalApi.js +4 -17
- package/src/Api/Internal/CalculatedColumnInternalApi.js +7 -14
- package/src/Api/Internal/ChartingInternalApi.js +13 -13
- package/src/Api/Internal/ColumnFilterInternalApi.js +18 -36
- package/src/Api/Internal/CustomSortInternalApi.js +1 -1
- package/src/Api/Internal/DashboardInternalApi.js +4 -10
- package/src/Api/Internal/DataImportInternalApi.js +3 -9
- package/src/Api/Internal/DataSetInternalApi.js +2 -7
- package/src/Api/Internal/ExportInternalApi.js +4 -4
- package/src/Api/Internal/ExpressionInternalApi.js +2 -12
- package/src/Api/Internal/Fdc3InternalApi.js +1 -10
- package/src/Api/Internal/FormatColumnInternalApi.js +11 -20
- package/src/Api/Internal/FreeTextColumnInternalApi.js +1 -1
- package/src/Api/Internal/GridFilterInternalApi.js +2 -8
- package/src/Api/Internal/GridInternalApi.js +13 -40
- package/src/Api/Internal/LayoutInternalApi.d.ts +1 -0
- package/src/Api/Internal/LayoutInternalApi.js +10 -19
- package/src/Api/Internal/PredicateInternalApi.js +5 -40
- package/src/Api/Internal/ScheduleInternalApi.js +1 -6
- package/src/Api/Internal/StyledColumnInternalApi.js +5 -5
- package/src/Api/Internal/SystemStatusInternalApi.js +1 -7
- package/src/Api/Internal/TeamSharingInternalApi.js +2 -7
- package/src/Api/Internal/ThemeInternalApi.js +1 -1
- package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
- package/src/Api/LayoutApi.d.ts +1 -0
- package/src/PredefinedConfig/Common/CellSummary.d.ts +5 -14
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -0
- package/src/PredefinedConfig/Common/Enums.js +2 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +1 -1
- package/src/PredefinedConfig/Common/RowSummary.js +4 -4
- package/src/Strategy/CellSummaryModule.js +54 -94
- package/src/Strategy/LayoutModule.js +5 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +19 -19
- package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
- package/src/Utilities/ObjectFactory.js +2 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +17 -1
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +5 -5
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
- package/src/agGrid/AdaptableAgGrid.js +1 -1
- package/src/agGrid/AgGridAdapter.d.ts +1 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +8 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
|
@@ -71,7 +71,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
71
71
|
}
|
|
72
72
|
undoCellEdit(cellDataChangedInfo) {
|
|
73
73
|
// for the reason of this hacky solution see the comments in DataService
|
|
74
|
-
this.
|
|
74
|
+
this.getAdaptableApi().internalApi.getDataService().logUndoChange(cellDataChangedInfo);
|
|
75
75
|
const cellUpdateRequest = {
|
|
76
76
|
columnId: cellDataChangedInfo.column.columnId,
|
|
77
77
|
newValue: cellDataChangedInfo.oldValue,
|
|
@@ -91,7 +91,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
91
91
|
}
|
|
92
92
|
setCellValue(cellUpdateRequest) {
|
|
93
93
|
var _a;
|
|
94
|
-
const abColumn = this.
|
|
94
|
+
const abColumn = this.getAdaptableApi().columnApi.getColumnWithColumnId(cellUpdateRequest.columnId);
|
|
95
95
|
if (!abColumn) {
|
|
96
96
|
this.logWarn(`setCellValue() - column not found for columnId: ${cellUpdateRequest.columnId}`);
|
|
97
97
|
return;
|
|
@@ -132,7 +132,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
132
132
|
}
|
|
133
133
|
clearGridFiltering() {
|
|
134
134
|
// slightly round the houses but we have to call ColumnFilterAPI as it does it properly
|
|
135
|
-
this.
|
|
135
|
+
this.getAdaptableApi().columnFilterApi.clearColumnFilters();
|
|
136
136
|
}
|
|
137
137
|
getColumnSorts() {
|
|
138
138
|
return this.getAdaptableState().Grid.ColumnSorts;
|
|
@@ -219,7 +219,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
219
219
|
}
|
|
220
220
|
selectCellRangeByQuery(query, gridCellRange, clearSelection) {
|
|
221
221
|
const filteredRowNodes = [];
|
|
222
|
-
const isRowNodeInQuery = (rowNode) => this.
|
|
222
|
+
const isRowNodeInQuery = (rowNode) => this.getAdaptableApi().internalApi
|
|
223
223
|
.getQueryLanguageService()
|
|
224
224
|
.evaluateBooleanExpression(query, 'GridInfo', rowNode);
|
|
225
225
|
if (gridCellRange) {
|
|
@@ -243,7 +243,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
243
243
|
/**
|
|
244
244
|
* Select all rows and all columns
|
|
245
245
|
*/
|
|
246
|
-
const currentLayout = this.
|
|
246
|
+
const currentLayout = this.getAdaptableApi().layoutApi.getCurrentLayout();
|
|
247
247
|
preapredGridCellRange = {
|
|
248
248
|
columnIds: currentLayout.Columns,
|
|
249
249
|
};
|
|
@@ -279,7 +279,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
279
279
|
this.selectColumns([columnId]);
|
|
280
280
|
}
|
|
281
281
|
selectColumns(columnIds) {
|
|
282
|
-
this.
|
|
282
|
+
this.getAdaptableApi().columnApi.selectColumns(columnIds);
|
|
283
283
|
}
|
|
284
284
|
getFirstRowNode() {
|
|
285
285
|
return this.adaptable.getFirstRowNode();
|
|
@@ -312,7 +312,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
312
312
|
}
|
|
313
313
|
getNormalisedValueFromRowNode(rowNode, columnId) {
|
|
314
314
|
const rawValue = this.adaptable.getRawValueFromRowNode(rowNode, columnId);
|
|
315
|
-
const abColumn = this.
|
|
315
|
+
const abColumn = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
|
|
316
316
|
return this.adaptable.getNormalisedValueFromRawValue(rawValue, abColumn);
|
|
317
317
|
}
|
|
318
318
|
getRowNodesForPrimaryKeys(primaryKeyValues) {
|
|
@@ -539,7 +539,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
539
539
|
const visibleColumns = (_c = transposeConfig.visibleColumns) !== null && _c !== void 0 ? _c : false;
|
|
540
540
|
const visibleRows = (_d = transposeConfig.visibleRows) !== null && _d !== void 0 ? _d : false;
|
|
541
541
|
const autosize = (_e = transposeConfig.autosize) !== null && _e !== void 0 ? _e : true;
|
|
542
|
-
this.
|
|
542
|
+
this.getAdaptableApi().internalApi.showPopupWindow({
|
|
543
543
|
id: windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW,
|
|
544
544
|
factoryId: windowFactory_1.WINDOW_SHOW_TRANSPOSED_VIEW,
|
|
545
545
|
title: 'Transposed View',
|
|
@@ -553,5 +553,8 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
553
553
|
},
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
|
+
getAllGridColumns() {
|
|
557
|
+
return this.adaptable.getAllGridColumns();
|
|
558
|
+
}
|
|
556
559
|
}
|
|
557
560
|
exports.GridApiImpl = GridApiImpl;
|
|
@@ -247,19 +247,8 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
247
247
|
this.addColumnToLayout(columnId, this.getCurrentLayoutName());
|
|
248
248
|
}
|
|
249
249
|
getLayoutSupportedFeatures() {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
AggregationColumns: true,
|
|
253
|
-
PivotColumns: true,
|
|
254
|
-
ColumnFilters: true,
|
|
255
|
-
ColumnSorts: true,
|
|
256
|
-
};
|
|
257
|
-
if (this.getGridApi().getAgGridRowModelType() === 'viewport') {
|
|
258
|
-
layoutSupportedFeatures.RowGroupedColumns = false;
|
|
259
|
-
layoutSupportedFeatures.AggregationColumns = false;
|
|
260
|
-
layoutSupportedFeatures.PivotColumns = false;
|
|
261
|
-
}
|
|
262
|
-
return layoutSupportedFeatures;
|
|
250
|
+
// TODO: is this deprecated?
|
|
251
|
+
return this.internalApi.getLayoutSupportedFeatures();
|
|
263
252
|
}
|
|
264
253
|
}
|
|
265
254
|
exports.LayoutApiImpl = LayoutApiImpl;
|
|
@@ -75,9 +75,9 @@ class PredicateApiImpl extends ApiBase_1.ApiBase {
|
|
|
75
75
|
if (!predicate.ColumnId) {
|
|
76
76
|
return this.handlePredicate(predicate, context, defaultReturn);
|
|
77
77
|
}
|
|
78
|
-
const paramsForColumn = Object.assign(Object.assign({}, context), { column: this.
|
|
78
|
+
const paramsForColumn = Object.assign(Object.assign({}, context), { column: this.getAdaptableApi().columnApi.getColumnWithColumnId(predicate.ColumnId),
|
|
79
79
|
// value: params?.node?.data?.[predicate.ColumnId],
|
|
80
|
-
value: this.
|
|
80
|
+
value: this.getAdaptableApi().gridApi.getRawValueFromRowNode(context.node, predicate.ColumnId) });
|
|
81
81
|
if ('oldValue' in paramsForColumn) {
|
|
82
82
|
delete paramsForColumn.oldValue;
|
|
83
83
|
}
|
|
@@ -56,7 +56,7 @@ class ScheduleApiImpl extends ApiBase_1.ApiBase {
|
|
|
56
56
|
}
|
|
57
57
|
getReportSchedules(config) {
|
|
58
58
|
var _a;
|
|
59
|
-
return ((_a = this.handleLayoutAssociatedObjects(this.
|
|
59
|
+
return ((_a = this.handleLayoutAssociatedObjects(this.getAdaptableApi().exportApi.getReportSchedules(), 'Schedule', config)) !== null && _a !== void 0 ? _a : []);
|
|
60
60
|
}
|
|
61
61
|
getActiveReportSchedules() {
|
|
62
62
|
return this.getReportSchedules().filter((schedule) => !schedule.IsSuspended);
|
|
@@ -85,7 +85,7 @@ class ScheduleApiImpl extends ApiBase_1.ApiBase {
|
|
|
85
85
|
}
|
|
86
86
|
getIPushPullSchedules(config) {
|
|
87
87
|
var _a;
|
|
88
|
-
const ippApi = this.
|
|
88
|
+
const ippApi = this.getAdaptableApi().pluginsApi.getipushpullPluginApi();
|
|
89
89
|
return ((_a = this.handleLayoutAssociatedObjects(ippApi === null || ippApi === void 0 ? void 0 : ippApi.getIPushPullSchedules(), 'Schedule', config)) !== null && _a !== void 0 ? _a : []);
|
|
90
90
|
}
|
|
91
91
|
getActiveIPushPullSchedules() {
|
|
@@ -115,7 +115,7 @@ class ScheduleApiImpl extends ApiBase_1.ApiBase {
|
|
|
115
115
|
}
|
|
116
116
|
getOpenFinSchedules(config) {
|
|
117
117
|
var _a;
|
|
118
|
-
const openFinApi = this.
|
|
118
|
+
const openFinApi = this.getAdaptableApi().pluginsApi.getOpenFinPluginApi();
|
|
119
119
|
return ((_a = this.handleLayoutAssociatedObjects(openFinApi === null || openFinApi === void 0 ? void 0 : openFinApi.getOpenFinSchedules(), 'Schedule', config)) !== null && _a !== void 0 ? _a : []);
|
|
120
120
|
}
|
|
121
121
|
getActiveOpenFinSchedules() {
|
|
@@ -167,10 +167,10 @@ class ScheduleApiImpl extends ApiBase_1.ApiBase {
|
|
|
167
167
|
}
|
|
168
168
|
else if (scheduleType == 'Report') {
|
|
169
169
|
const reportSchedule = schedule;
|
|
170
|
-
this.
|
|
170
|
+
this.getAdaptableApi().exportApi.runReport(reportSchedule.ReportName, reportSchedule.ExportDestination);
|
|
171
171
|
}
|
|
172
172
|
else if (scheduleType == 'ipushpull') {
|
|
173
|
-
const ippApi = this.
|
|
173
|
+
const ippApi = this.getAdaptableApi().pluginsApi.getipushpullPluginApi();
|
|
174
174
|
const iPushPullSchedule = schedule;
|
|
175
175
|
if (iPushPullSchedule.Transmission == 'Snapshot') {
|
|
176
176
|
ippApi.sendSnapshot(iPushPullSchedule.IPushPullReport);
|
|
@@ -180,7 +180,7 @@ class ScheduleApiImpl extends ApiBase_1.ApiBase {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
else if (scheduleType == 'OpenFin') {
|
|
183
|
-
const openFinApi = this.
|
|
183
|
+
const openFinApi = this.getAdaptableApi().pluginsApi.getOpenFinPluginApi();
|
|
184
184
|
const openFinSchedule = schedule;
|
|
185
185
|
openFinApi.startLiveData(openFinSchedule.OpenFinReport);
|
|
186
186
|
}
|
|
@@ -30,7 +30,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
30
30
|
if (scope == undefined) {
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
33
|
-
const columns = this.
|
|
33
|
+
const columns = this.getAdaptableApi().columnApi.getColumns();
|
|
34
34
|
if ('All' in scope) {
|
|
35
35
|
return columns;
|
|
36
36
|
}
|
|
@@ -57,7 +57,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
57
57
|
if ('ColumnIds' in scope) {
|
|
58
58
|
return ((scope.ColumnIds.length > 1 ? 'Columns' : 'Column') +
|
|
59
59
|
': ' +
|
|
60
|
-
this.
|
|
60
|
+
this.getAdaptableApi().columnApi
|
|
61
61
|
.getFriendlyNamesForColumnIds(scope.ColumnIds)
|
|
62
62
|
.map((c) => {
|
|
63
63
|
return '"' + c + '"';
|
|
@@ -100,7 +100,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
100
100
|
!this.scopeIsAll(scope) &&
|
|
101
101
|
'ColumnIds' in scope &&
|
|
102
102
|
scope.ColumnIds.length == 1 &&
|
|
103
|
-
this.
|
|
103
|
+
this.getAdaptableApi().columnApi.hasNumberDataType(scope.ColumnIds[0]));
|
|
104
104
|
}
|
|
105
105
|
isSingleBooleanColumnScope(scope) {
|
|
106
106
|
return (this.scopeHasColumns(scope) &&
|
|
@@ -108,7 +108,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
108
108
|
!this.scopeIsAll(scope) &&
|
|
109
109
|
'ColumnIds' in scope &&
|
|
110
110
|
scope.ColumnIds.length == 1 &&
|
|
111
|
-
this.
|
|
111
|
+
this.getAdaptableApi().columnApi.hasBooleanDataType(scope.ColumnIds[0]));
|
|
112
112
|
}
|
|
113
113
|
areAllBooleanColumnsInScope(scope) {
|
|
114
114
|
return (this.scopeHasColumns(scope) &&
|
|
@@ -116,7 +116,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
116
116
|
!this.scopeIsAll(scope) &&
|
|
117
117
|
'ColumnIds' in scope &&
|
|
118
118
|
scope.ColumnIds.length &&
|
|
119
|
-
scope.ColumnIds.every((columnId) => this.
|
|
119
|
+
scope.ColumnIds.every((columnId) => this.getAdaptableApi().columnApi.hasBooleanDataType(columnId)));
|
|
120
120
|
}
|
|
121
121
|
isColumnInScopeColumns(column, scope) {
|
|
122
122
|
return this.scopeHasColumns(scope) && this.isColumnInScope(column, scope);
|
|
@@ -124,7 +124,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
124
124
|
isPrimaryKeyColumnInScopeColumns(scope) {
|
|
125
125
|
return ('ColumnIds' in scope &&
|
|
126
126
|
scope.ColumnIds.length == 1 &&
|
|
127
|
-
scope.ColumnIds.find((c) => c == this.
|
|
127
|
+
scope.ColumnIds.find((c) => c == this.getAdaptableApi().optionsApi.getPrimaryKey()) != null);
|
|
128
128
|
}
|
|
129
129
|
getScopeToString(scope) {
|
|
130
130
|
if ('All' in scope) {
|
|
@@ -139,7 +139,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
139
139
|
if ('ColumnIds' in scope) {
|
|
140
140
|
let text = scope.ColumnIds.length == 1 ? 'Column: ' : 'Columns: ';
|
|
141
141
|
return (text +
|
|
142
|
-
this.
|
|
142
|
+
this.getAdaptableApi().columnApi
|
|
143
143
|
.getFriendlyNamesForColumnIds(scope.ColumnIds)
|
|
144
144
|
.map((c) => {
|
|
145
145
|
return '"' + c + '"';
|
|
@@ -257,7 +257,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
257
257
|
'DataTypes' in b &&
|
|
258
258
|
a.ColumnIds.every((columnId) => {
|
|
259
259
|
var _a;
|
|
260
|
-
return b.DataTypes.includes((_a = this.
|
|
260
|
+
return b.DataTypes.includes((_a = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId)) === null || _a === void 0 ? void 0 : _a.dataType);
|
|
261
261
|
})) {
|
|
262
262
|
return true;
|
|
263
263
|
}
|
|
@@ -269,7 +269,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
269
269
|
// check if each colum in a has column types in b
|
|
270
270
|
if ('ColumnIds' in a && 'ColumnTypes' in b) {
|
|
271
271
|
const inScope = a.ColumnIds.every((columnId) => {
|
|
272
|
-
const column = this.
|
|
272
|
+
const column = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
|
|
273
273
|
// check if at least one column-type is in scope
|
|
274
274
|
return column.columnTypes.some((columnColumnType) => b.ColumnTypes.includes(columnColumnType));
|
|
275
275
|
});
|
|
@@ -280,7 +280,7 @@ class ScopeApiImpl extends ApiBase_1.ApiBase {
|
|
|
280
280
|
return false;
|
|
281
281
|
}
|
|
282
282
|
createCellColorRangesForScope(scope) {
|
|
283
|
-
let distinctColumnsValues = this.
|
|
283
|
+
let distinctColumnsValues = this.getAdaptableApi().gridApi.internalApi.getDistinctRawValuesForColumn(this.getAdaptableApi().scopeApi.getSingleColumnInScope(scope));
|
|
284
284
|
let minValue = Math.min(...distinctColumnsValues);
|
|
285
285
|
let maxValue = Math.max(...distinctColumnsValues);
|
|
286
286
|
const ranges = [];
|
|
@@ -19,11 +19,7 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
|
|
|
19
19
|
return [];
|
|
20
20
|
}
|
|
21
21
|
const teamSharingOptions = this.adaptable.adaptableOptions.teamSharingOptions;
|
|
22
|
-
const sharedEntitiesContext =
|
|
23
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
24
|
-
userName: this.adaptable.adaptableOptions.userName,
|
|
25
|
-
adaptableApi: this.getAdaptableApi(),
|
|
26
|
-
};
|
|
22
|
+
const sharedEntitiesContext = this.getAdaptableApi().internalApi.buildBaseContext();
|
|
27
23
|
let loadedSharedEntities = await teamSharingOptions.loadSharedEntities(sharedEntitiesContext);
|
|
28
24
|
// with v15 we introduced 2 types of SharedEntity: AdaptableSharedEntity (basically the old one) and the new CustomSharedEntity
|
|
29
25
|
// for backwards compatibility, we add default the 'EntityType' property to 'adaptableEntity'
|
|
@@ -44,11 +40,7 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
|
|
|
44
40
|
return false;
|
|
45
41
|
}
|
|
46
42
|
const teamSharingOptions = this.adaptable.adaptableOptions.teamSharingOptions;
|
|
47
|
-
const sharedEntitiesContext =
|
|
48
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
49
|
-
userName: this.adaptable.adaptableOptions.userName,
|
|
50
|
-
adaptableApi: this.getAdaptableApi(),
|
|
51
|
-
};
|
|
43
|
+
const sharedEntitiesContext = this.getAdaptableApi().internalApi.buildBaseContext();
|
|
52
44
|
const sharedEntitiesAfterCustomisation = teamSharingOptions.saveSharedEntities(sharedEntities, sharedEntitiesContext);
|
|
53
45
|
await teamSharingOptions.persistSharedEntities(sharedEntitiesAfterCustomisation, sharedEntitiesContext);
|
|
54
46
|
return true;
|
|
@@ -104,11 +96,7 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
|
|
|
104
96
|
this.logError(`Could NOT import custom shared entity because 'TeamSharingOptions.handleCustomSharedEntityImport(...)' is NOT defined!`, sharedEntity);
|
|
105
97
|
return;
|
|
106
98
|
}
|
|
107
|
-
customSharedEntityImportHandler(sharedEntity,
|
|
108
|
-
adaptableApi: this.getAdaptableApi(),
|
|
109
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
110
|
-
userName: this.adaptable.adaptableOptions.userName,
|
|
111
|
-
});
|
|
99
|
+
customSharedEntityImportHandler(sharedEntity, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
112
100
|
}
|
|
113
101
|
}
|
|
114
102
|
getTeamSharingState() {
|
|
@@ -61,13 +61,8 @@ class ThemeApiImpl extends ApiBase_1.ApiBase {
|
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
this.adaptable.applyAdaptableTheme(currentTheme);
|
|
64
|
-
let themeChangedInfo = {
|
|
65
|
-
|
|
66
|
-
theme: currentTheme,
|
|
67
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
68
|
-
adaptableId: this.adaptable.api.optionsApi.getAdaptableId(),
|
|
69
|
-
};
|
|
70
|
-
this.adaptable.api.eventApi.emit('ThemeChanged', themeChangedInfo);
|
|
64
|
+
let themeChangedInfo = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { theme: currentTheme });
|
|
65
|
+
this.getAdaptableApi().eventApi.emit('ThemeChanged', themeChangedInfo);
|
|
71
66
|
}
|
|
72
67
|
getUserThemes() {
|
|
73
68
|
var _a;
|
|
@@ -57,7 +57,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
57
57
|
}
|
|
58
58
|
permittedValuesItem = permittedValues.find((permittedValue) => {
|
|
59
59
|
return ('All' in permittedValue.scope &&
|
|
60
|
-
this.
|
|
60
|
+
this.getAdaptableApi().scopeApi.isColumnInScope(column, permittedValue.scope));
|
|
61
61
|
});
|
|
62
62
|
if (permittedValuesItem) {
|
|
63
63
|
return permittedValuesItem;
|
|
@@ -77,12 +77,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
77
77
|
// first do the function then get hardcoded items
|
|
78
78
|
if (permittedValues != null && typeof permittedValues === 'function') {
|
|
79
79
|
if (column) {
|
|
80
|
-
const permittedValuesParams = {
|
|
81
|
-
adaptableApi: this.getAdaptableApi(),
|
|
82
|
-
userName: this.getOptions().userName,
|
|
83
|
-
adaptableId: this.getOptions().adaptableId,
|
|
84
|
-
column: column,
|
|
85
|
-
};
|
|
80
|
+
const permittedValuesParams = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { column: column });
|
|
86
81
|
return permittedValues(permittedValuesParams);
|
|
87
82
|
}
|
|
88
83
|
}
|
|
@@ -144,7 +139,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
144
139
|
if (!editLookUpItem || !gridCell || !gridCell.column) {
|
|
145
140
|
return undefined;
|
|
146
141
|
}
|
|
147
|
-
return this.
|
|
142
|
+
return this.getAdaptableApi().gridApi.internalApi.getEditLookUpValuesForColumn(editLookUpItem, gridCell.column, gridCell);
|
|
148
143
|
}
|
|
149
144
|
getEditableCellStyle() {
|
|
150
145
|
return this.getUserInterfaceOptions().editableCellStyle;
|
|
@@ -155,11 +150,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
155
150
|
getAdaptableObjectTags() {
|
|
156
151
|
const objectTags = this.getUserInterfaceOptions().objectTags;
|
|
157
152
|
if (objectTags != null && typeof objectTags === 'function') {
|
|
158
|
-
return objectTags(
|
|
159
|
-
adaptableApi: this.adaptable.api,
|
|
160
|
-
userName: this.getOptions().userName,
|
|
161
|
-
adaptableId: this.getOptions().adaptableId,
|
|
162
|
-
});
|
|
153
|
+
return objectTags(this.getAdaptableApi().internalApi.buildBaseContext());
|
|
163
154
|
}
|
|
164
155
|
else {
|
|
165
156
|
let arr = objectTags;
|
|
@@ -46,13 +46,7 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
|
|
|
46
46
|
: this.actionRowFormOptions.formDescription;
|
|
47
47
|
}
|
|
48
48
|
buildFormParamContext(type, rowNode) {
|
|
49
|
-
return {
|
|
50
|
-
rowNode,
|
|
51
|
-
adaptableApi: this.getAdaptableApi(),
|
|
52
|
-
userName: this.getOptions().userName,
|
|
53
|
-
adaptableId: this.getOptions().adaptableId,
|
|
54
|
-
type: type,
|
|
55
|
-
};
|
|
49
|
+
return Object.assign(Object.assign({ rowNode }, this.getAdaptableApi().internalApi.buildBaseContext()), { type: type });
|
|
56
50
|
}
|
|
57
51
|
buildActionRowFields(actionRowType, rowNode) {
|
|
58
52
|
const relevantColumns = this.getAdaptableApi()
|
|
@@ -68,13 +62,8 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
|
|
|
68
62
|
showColumnInActionRowForm(adaptableColumn, actionRowType) {
|
|
69
63
|
const showColumnFn = this.getActionRowOptions().actionRowFormOptions.showColumninActionRowForm;
|
|
70
64
|
if (typeof showColumnFn === 'function') {
|
|
71
|
-
return showColumnFn({
|
|
72
|
-
|
|
73
|
-
userName: this.getOptions().userName,
|
|
74
|
-
adaptableId: this.getOptions().adaptableId,
|
|
75
|
-
adaptableColumn,
|
|
76
|
-
actionRowType,
|
|
77
|
-
});
|
|
65
|
+
return showColumnFn(Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { adaptableColumn,
|
|
66
|
+
actionRowType }));
|
|
78
67
|
}
|
|
79
68
|
return true;
|
|
80
69
|
}
|
|
@@ -102,22 +91,7 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
|
|
|
102
91
|
// textOutput should not be saved, their values are set to display values
|
|
103
92
|
// we need to filter out the textOutput fields and add the primaryKey
|
|
104
93
|
const eventInfo = type === 'rowCreated'
|
|
105
|
-
? {
|
|
106
|
-
type: 'rowCreated',
|
|
107
|
-
formData: this.prepareCreateData(formFields, context),
|
|
108
|
-
adaptableApi: context.adaptableApi,
|
|
109
|
-
userName: this.getOptions().userName,
|
|
110
|
-
adaptableId: this.getOptions().adaptableId,
|
|
111
|
-
clonedRowNode: rowNode,
|
|
112
|
-
}
|
|
113
|
-
: {
|
|
114
|
-
type: 'rowEdited',
|
|
115
|
-
formData: this.prepareEditData(formFields, context),
|
|
116
|
-
rowNode: rowNode,
|
|
117
|
-
adaptableApi: context.adaptableApi,
|
|
118
|
-
userName: this.getOptions().userName,
|
|
119
|
-
adaptableId: this.getOptions().adaptableId,
|
|
120
|
-
};
|
|
94
|
+
? Object.assign(Object.assign({ type: 'rowCreated', formData: this.prepareCreateData(formFields, context) }, this.getAdaptableApi().internalApi.buildBaseContext()), { clonedRowNode: rowNode }) : Object.assign({ type: 'rowEdited', formData: this.prepareEditData(formFields, context), rowNode: rowNode }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
121
95
|
this.getAdaptableApi().eventApi.emit('ActionRowSubmitted', eventInfo);
|
|
122
96
|
(_b = (_a = this.actionRowFormOptions) === null || _a === void 0 ? void 0 : _a.onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
|
|
123
97
|
},
|
|
@@ -179,14 +153,8 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
|
|
|
179
153
|
return customFieldLabel !== null && customFieldLabel !== void 0 ? customFieldLabel : column.friendlyName;
|
|
180
154
|
}
|
|
181
155
|
buildFormFieldLabelContext(type, column, rowNode) {
|
|
182
|
-
return {
|
|
183
|
-
|
|
184
|
-
column,
|
|
185
|
-
adaptableApi: this.getAdaptableApi(),
|
|
186
|
-
userName: this.getOptions().userName,
|
|
187
|
-
adaptableId: this.getOptions().adaptableId,
|
|
188
|
-
type: type,
|
|
189
|
-
};
|
|
156
|
+
return Object.assign(Object.assign({ rowNode,
|
|
157
|
+
column }, this.getAdaptableApi().internalApi.buildBaseContext()), { type: type });
|
|
190
158
|
}
|
|
191
159
|
getFieldTypeFromColumnType(column) {
|
|
192
160
|
switch (column.dataType) {
|
|
@@ -289,13 +257,7 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
|
|
|
289
257
|
tooltip: 'Delete',
|
|
290
258
|
onClick: (button, context) => {
|
|
291
259
|
var _a, _b;
|
|
292
|
-
const eventInfo = {
|
|
293
|
-
type: 'rowDeleted',
|
|
294
|
-
rowNode: context.rowNode,
|
|
295
|
-
adaptableApi: context.adaptableApi,
|
|
296
|
-
userName: context.userName,
|
|
297
|
-
adaptableId: context.adaptableId,
|
|
298
|
-
};
|
|
260
|
+
const eventInfo = Object.assign({ type: 'rowDeleted', rowNode: context.rowNode }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
299
261
|
this.getEventApi().emit('ActionRowSubmitted', eventInfo);
|
|
300
262
|
(_b = (_a = this.getActionRowOptions().actionRowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
|
|
301
263
|
},
|
|
@@ -298,11 +298,7 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
|
|
|
298
298
|
if (typeof this.adaptable.adaptableOptions.userInterfaceOptions.objectTags === 'function') {
|
|
299
299
|
// sanitize the provided tags, just to be sure that the user does NOT break the UI
|
|
300
300
|
return this.adaptable.adaptableOptions.userInterfaceOptions
|
|
301
|
-
.objectTags(
|
|
302
|
-
adaptableApi: this.adaptable.api,
|
|
303
|
-
userName: this.getOptions().userName,
|
|
304
|
-
adaptableId: this.getOptions().adaptableId,
|
|
305
|
-
})
|
|
301
|
+
.objectTags(this.buildBaseContext())
|
|
306
302
|
.filter((tag) => typeof tag === 'string');
|
|
307
303
|
}
|
|
308
304
|
}
|
|
@@ -319,13 +315,7 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
|
|
|
319
315
|
}
|
|
320
316
|
if (typeof this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions
|
|
321
317
|
.autoGenerateTagsForLayouts === 'function') {
|
|
322
|
-
const autoGenerateTagsForLayoutsContext = {
|
|
323
|
-
layouts: this.adaptable.api.layoutApi.getLayouts(),
|
|
324
|
-
objectTags: this.getAdaptableApi().userInterfaceApi.getAdaptableObjectTags(),
|
|
325
|
-
adaptableApi: this.adaptable.api,
|
|
326
|
-
userName: this.getOptions().userName,
|
|
327
|
-
adaptableId: this.getOptions().adaptableId,
|
|
328
|
-
};
|
|
318
|
+
const autoGenerateTagsForLayoutsContext = Object.assign({ layouts: this.adaptable.api.layoutApi.getLayouts(), objectTags: this.getAdaptableApi().userInterfaceApi.getAdaptableObjectTags() }, this.buildBaseContext());
|
|
329
319
|
const customGeneratedTags = this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions.autoGenerateTagsForLayouts(autoGenerateTagsForLayoutsContext);
|
|
330
320
|
// sanitize the provided tags, just to be sure that the user does NOT break the UI
|
|
331
321
|
return customGeneratedTags.filter((tag) => typeof tag === 'string');
|
|
@@ -84,12 +84,7 @@ class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
|
84
84
|
*/
|
|
85
85
|
publishAlertFiredEvent(alertToFire) {
|
|
86
86
|
const adaptableApi = this.getAdaptableApi();
|
|
87
|
-
const alertFiredInfo = {
|
|
88
|
-
adaptableApi: adaptableApi,
|
|
89
|
-
alert: alertToFire,
|
|
90
|
-
userName: adaptableApi.optionsApi.getUserName(),
|
|
91
|
-
adaptableId: adaptableApi.optionsApi.getAdaptableId(),
|
|
92
|
-
};
|
|
87
|
+
const alertFiredInfo = Object.assign({ alert: alertToFire }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
93
88
|
this.getEventApi().emit('AlertFired', alertFiredInfo);
|
|
94
89
|
}
|
|
95
90
|
/**
|
|
@@ -299,7 +294,7 @@ class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
|
299
294
|
var _a, _b, _c, _d;
|
|
300
295
|
let ruleDescription = ((_b = (_a = alertDefinition.Rule) === null || _a === void 0 ? void 0 : _a.Predicates) === null || _b === void 0 ? void 0 : _b.length)
|
|
301
296
|
? (_d = (_c = alertDefinition.Rule) === null || _c === void 0 ? void 0 : _c.Predicates) === null || _d === void 0 ? void 0 : _d.map((predicate) => this.getPredicateApi().predicateToString(predicate)).join(' AND ')
|
|
302
|
-
: this.
|
|
297
|
+
: this.getAdaptableApi().internalApi.getAdaptableQueryExpressionText(alertDefinition.Rule);
|
|
303
298
|
return ruleDescription;
|
|
304
299
|
}
|
|
305
300
|
/**
|
|
@@ -476,17 +471,9 @@ class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
|
476
471
|
isAlertPredicateTriggered(alert, dataChangedEvent, defaultNoPredicateReturn = false) {
|
|
477
472
|
var _a;
|
|
478
473
|
const adapatableApi = this.getAdaptableApi();
|
|
479
|
-
const predicateDefHandlerContext = {
|
|
480
|
-
value: dataChangedEvent.newValue,
|
|
481
|
-
oldValue: dataChangedEvent.oldValue,
|
|
474
|
+
const predicateDefHandlerContext = Object.assign({ value: dataChangedEvent.newValue, oldValue: dataChangedEvent.oldValue,
|
|
482
475
|
// TODO send real display value
|
|
483
|
-
displayValue: null,
|
|
484
|
-
node: dataChangedEvent.rowNode,
|
|
485
|
-
column: dataChangedEvent.column,
|
|
486
|
-
adaptableApi: adapatableApi,
|
|
487
|
-
userName: adapatableApi.optionsApi.getUserName(),
|
|
488
|
-
adaptableId: adapatableApi.optionsApi.getAdaptableId(),
|
|
489
|
-
};
|
|
476
|
+
displayValue: null, node: dataChangedEvent.rowNode, column: dataChangedEvent.column }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
490
477
|
return this.getAdaptableApi().predicateApi.handleColumnPredicates((_a = alert.Rule) === null || _a === void 0 ? void 0 : _a.Predicates, predicateDefHandlerContext, defaultNoPredicateReturn);
|
|
491
478
|
}
|
|
492
479
|
isAlertDefinitionForRowChangeEvent(alertDefinition) {
|
|
@@ -32,7 +32,7 @@ class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
32
32
|
this.getCalculatedColumnApi()
|
|
33
33
|
.getCalculatedColumns()
|
|
34
34
|
.forEach((calculatedColumn) => {
|
|
35
|
-
if (this.getExpressionApi().internalApi.isColumnReferencedInExpression(columnId, this.
|
|
35
|
+
if (this.getExpressionApi().internalApi.isColumnReferencedInExpression(columnId, this.getAdaptableApi().expressionApi.getAdaptableQueryExpression(calculatedColumn.Query))) {
|
|
36
36
|
calcColumns.push(calculatedColumn);
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -43,7 +43,7 @@ class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
43
43
|
* @param calculatedColumn Calculated Column to check
|
|
44
44
|
*/
|
|
45
45
|
getReferencedColumnIdsForCalculatedColumn(calculatedColumn) {
|
|
46
|
-
const columnIds = this.
|
|
46
|
+
const columnIds = this.getAdaptableApi().expressionApi.getColumnsFromExpression(this.getAdaptableApi().expressionApi.getAdaptableQueryExpression(calculatedColumn.Query));
|
|
47
47
|
return columnIds;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
@@ -51,15 +51,15 @@ class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
51
51
|
* @param calculatedColumnId CalculatedColumnId to check
|
|
52
52
|
*/
|
|
53
53
|
getReferencedColumnIdsForCalculatedColumnId(calculatedColumnId) {
|
|
54
|
-
const calculatedColumn = this.
|
|
55
|
-
.getCalculatedColumns()
|
|
54
|
+
const calculatedColumn = this.getAdaptableApi()
|
|
55
|
+
.calculatedColumnApi.getCalculatedColumns()
|
|
56
56
|
.find((cc) => cc.ColumnId == calculatedColumnId);
|
|
57
57
|
if (calculatedColumn) {
|
|
58
58
|
return this.getReferencedColumnIdsForCalculatedColumn(calculatedColumn);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
getCalculatedColumnsDependentOnColumn(column) {
|
|
62
|
-
const calculatedColumns = this.
|
|
62
|
+
const calculatedColumns = this.getAdaptableApi().calculatedColumnApi.getCalculatedColumns();
|
|
63
63
|
return calculatedColumns
|
|
64
64
|
.filter((calculatedColumn) => {
|
|
65
65
|
const dependentColumns = this.getReferencedColumnIdsForCalculatedColumnId(calculatedColumn.ColumnId);
|
|
@@ -85,15 +85,8 @@ class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
|
|
|
85
85
|
}
|
|
86
86
|
fireCalculatedColumnChangedEvent(trigger, calculatedColumn) {
|
|
87
87
|
const adaptableApi = this.getAdaptableApi();
|
|
88
|
-
const calculatedColumnChangedInfo = {
|
|
89
|
-
|
|
90
|
-
actionName: trigger,
|
|
91
|
-
calculatedColumn: calculatedColumn,
|
|
92
|
-
calculatedColumnExpressionAST: adaptableApi.expressionApi.getASTForExpression(this.getExpressionFromCalculatedColumn(calculatedColumn)),
|
|
93
|
-
userName: adaptableApi.optionsApi.getUserName(),
|
|
94
|
-
adaptableId: adaptableApi.optionsApi.getAdaptableId(),
|
|
95
|
-
};
|
|
96
|
-
this.adaptable.api.eventApi.emit('CalculatedColumnChanged', calculatedColumnChangedInfo);
|
|
88
|
+
const calculatedColumnChangedInfo = Object.assign({ actionName: trigger, calculatedColumn: calculatedColumn, calculatedColumnExpressionAST: adaptableApi.expressionApi.getASTForExpression(this.getExpressionFromCalculatedColumn(calculatedColumn)) }, this.getAdaptableApi().internalApi.buildBaseContext());
|
|
89
|
+
this.getAdaptableApi().eventApi.emit('CalculatedColumnChanged', calculatedColumnChangedInfo);
|
|
97
90
|
}
|
|
98
91
|
getColDefsForCalculatedColumns() {
|
|
99
92
|
const defaultSpecialColumnSettings = this.getGridApi().internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef();
|