@adaptabletools/adaptable 19.1.2 → 19.2.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/package.json +1 -1
- package/src/AdaptableOptions/CommentOptions.d.ts +1 -1
- package/src/{agGrid/defaultAdaptableOptions.d.ts → AdaptableOptions/DefaultAdaptableOptions.d.ts} +1 -1
- package/src/{agGrid/defaultAdaptableOptions.js → AdaptableOptions/DefaultAdaptableOptions.js} +3 -3
- package/src/AdaptableOptions/EditOptions.d.ts +4 -0
- package/src/AdaptableOptions/NoteOptions.d.ts +1 -1
- package/src/Api/GridApi.d.ts +3 -3
- package/src/Api/Implementation/ActionRowApiImpl.js +2 -2
- package/src/Api/Implementation/AlertApiImpl.js +6 -6
- package/src/Api/Implementation/ChartingApiImpl.js +4 -4
- package/src/Api/Implementation/ColumnApiImpl.js +5 -5
- package/src/Api/Implementation/ColumnFilterApiImpl.js +9 -9
- package/src/Api/Implementation/ColumnScopeApiImpl.js +8 -8
- package/src/Api/Implementation/ConfigApiImpl.js +2 -2
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +2 -2
- package/src/Api/Implementation/FormatColumnApiImpl.js +4 -4
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.js +16 -19
- package/src/Api/Implementation/LayoutApiImpl.js +4 -4
- package/src/Api/Implementation/PredicateApiImpl.js +2 -2
- package/src/Api/Implementation/ScheduleApiImpl.js +2 -2
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -1
- package/src/Api/Implementation/ThemeApiImpl.js +2 -2
- package/src/Api/Implementation/UserInterfaceApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.js +9 -10
- package/src/Api/Internal/AdaptableInternalApi.js +2 -2
- package/src/Api/Internal/AlertInternalApi.js +3 -3
- package/src/Api/Internal/CalculatedColumnInternalApi.js +1 -1
- package/src/Api/Internal/ChartingInternalApi.js +7 -7
- package/src/Api/Internal/ColumnFilterInternalApi.js +8 -8
- package/src/Api/Internal/CustomSortInternalApi.js +1 -1
- package/src/Api/Internal/DashboardInternalApi.js +1 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.js +37 -37
- package/src/Api/Internal/ExpressionInternalApi.js +1 -1
- package/src/Api/Internal/FlashingCellInternalApi.js +1 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +8 -8
- package/src/Api/Internal/GridInternalApi.d.ts +7 -0
- package/src/Api/Internal/GridInternalApi.js +20 -3
- package/src/Api/Internal/LayoutInternalApi.js +3 -3
- package/src/Api/Internal/StyledColumnInternalApi.js +6 -6
- package/src/Api/Internal/SystemStatusInternalApi.js +1 -1
- package/src/Api/Internal/TeamSharingInternalApi.js +2 -2
- package/src/Api/Internal/UserInterfaceInternalApi.js +1 -1
- package/src/Api/StatusBarApi.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableSearchState.d.ts +22 -0
- package/src/PredefinedConfig/Common/AdaptableSearchState.js +1 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +4 -4
- package/src/Strategy/BulkUpdateModule.js +0 -12
- package/src/Strategy/PlusMinusModule.js +24 -24
- package/src/Strategy/SmartEditModule.js +0 -11
- package/src/Utilities/Services/MetamodelService.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +1 -1
- package/src/agGrid/Adaptable.js +1 -1
- package/src/agGrid/AdaptableAgGrid.js +1 -1
- package/src/agGrid/AgGridAdapter.js +4 -1
- package/src/agGrid/AgGridColumnAdapter.js +15 -12
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +18 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -17,7 +17,7 @@ export interface CommentOptions<TData = any> {
|
|
|
17
17
|
*/
|
|
18
18
|
persistCommentThreads?(commentThreads: CommentThread[]): Promise<void>;
|
|
19
19
|
/**
|
|
20
|
-
* Format string for
|
|
20
|
+
* Date Format string for Comments timestamp
|
|
21
21
|
*
|
|
22
22
|
* @defaultValue 'dd-MM-yyyy HH:mm:ss'
|
|
23
23
|
*/
|
package/src/{agGrid/defaultAdaptableOptions.d.ts → AdaptableOptions/DefaultAdaptableOptions.d.ts}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AdaptableOptions } from '
|
|
1
|
+
import { AdaptableOptions } from './AdaptableOptions';
|
|
2
2
|
export declare function applyDefaultAdaptableOptions(adaptableOptions: AdaptableOptions): AdaptableOptions;
|
|
3
3
|
export declare const getDefaultAdaptableOptions: () => AdaptableOptions<any>;
|
package/src/{agGrid/defaultAdaptableOptions.js → AdaptableOptions/DefaultAdaptableOptions.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as GeneralConstants from '../Utilities/Constants/GeneralConstants';
|
|
2
2
|
import * as FilterConstants from '../Utilities/Constants/FilterConstants';
|
|
3
3
|
import UIHelper, { getHexForName, GRAY, GREEN, RED } from '../View/UIHelper';
|
|
4
|
-
import { EMPTY_ARRAY } from '../Utilities/Constants/GeneralConstants';
|
|
4
|
+
import { DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME, EMPTY_ARRAY, } from '../Utilities/Constants/GeneralConstants';
|
|
5
5
|
import { ExportDestination } from '../PredefinedConfig/Common/Enums';
|
|
6
6
|
import { SystemAlertPredicateIds, SystemBadgeStylePredicateIds, SystemFilterPredicateIds, SystemFlashingCellPredicateIds, SystemFormatColumnPredicateIds, } from '../PredefinedConfig/Common/AdaptablePredicate';
|
|
7
7
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
@@ -122,7 +122,7 @@ const DefaultAdaptableOptions = {
|
|
|
122
122
|
},
|
|
123
123
|
commentOptions: {
|
|
124
124
|
showPopupCloseButton: true,
|
|
125
|
-
dateFormat:
|
|
125
|
+
dateFormat: DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME,
|
|
126
126
|
},
|
|
127
127
|
customSortOptions: { customSortComparers: undefined },
|
|
128
128
|
notificationsOptions: {
|
|
@@ -336,7 +336,7 @@ const DefaultAdaptableOptions = {
|
|
|
336
336
|
},
|
|
337
337
|
noteOptions: {
|
|
338
338
|
showPopupCloseButton: true,
|
|
339
|
-
dateFormat:
|
|
339
|
+
dateFormat: DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME,
|
|
340
340
|
},
|
|
341
341
|
};
|
|
342
342
|
export function applyDefaultAdaptableOptions(adaptableOptions) {
|
|
@@ -97,4 +97,8 @@ export interface CellEditableContext<TData = any> extends BaseContext {
|
|
|
97
97
|
* Cell being edited
|
|
98
98
|
*/
|
|
99
99
|
gridCell: GridCell<TData>;
|
|
100
|
+
/**
|
|
101
|
+
* Default editability according to the AG Grid Column Definition (`ColDef.editable`)
|
|
102
|
+
*/
|
|
103
|
+
defaultColDefEditableValue?: boolean;
|
|
100
104
|
}
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -209,7 +209,7 @@ export interface GridApi {
|
|
|
209
209
|
*/
|
|
210
210
|
getVisibleRowNodes(config?: {
|
|
211
211
|
includeGroupRows?: boolean;
|
|
212
|
-
filterFn
|
|
212
|
+
filterFn?(rowNode: IRowNode): boolean;
|
|
213
213
|
}): IRowNode[];
|
|
214
214
|
/**
|
|
215
215
|
* Retrieves all Row Nodes currently in the Grid (by default excluding the group rows)
|
|
@@ -217,14 +217,14 @@ export interface GridApi {
|
|
|
217
217
|
*/
|
|
218
218
|
getAllRowNodes(config?: {
|
|
219
219
|
includeGroupRows?: boolean;
|
|
220
|
-
filterFn
|
|
220
|
+
filterFn?(rowNode: IRowNode): boolean;
|
|
221
221
|
}): IRowNode[];
|
|
222
222
|
/**
|
|
223
223
|
* Retrieves all Grouped Row Nodes currently in the Grid
|
|
224
224
|
* @param config - configuration
|
|
225
225
|
*/
|
|
226
226
|
getGroupRowNodes(config?: {
|
|
227
|
-
filterFn
|
|
227
|
+
filterFn?(rowNode: IRowNode): boolean;
|
|
228
228
|
}): IRowNode[];
|
|
229
229
|
/**
|
|
230
230
|
* Retrieves Row Nodes that contain given Primary Keys
|
|
@@ -15,7 +15,7 @@ export class ActionRowApiImpl extends ApiBase {
|
|
|
15
15
|
return actionRowButtons !== null && actionRowButtons !== void 0 ? actionRowButtons : [];
|
|
16
16
|
}
|
|
17
17
|
displayEditActionRow(primaryKey) {
|
|
18
|
-
const rowNode = this.
|
|
18
|
+
const rowNode = this.getGridApi().getRowNodeForPrimaryKey(primaryKey);
|
|
19
19
|
if (!rowNode) {
|
|
20
20
|
this.logWarn(`Can NOT edit row: rowNode not found for primaryKey ${primaryKey}`);
|
|
21
21
|
}
|
|
@@ -37,7 +37,7 @@ export class ActionRowApiImpl extends ApiBase {
|
|
|
37
37
|
}));
|
|
38
38
|
}
|
|
39
39
|
displayCloneActionRow(primaryKey) {
|
|
40
|
-
const rowNode = this.
|
|
40
|
+
const rowNode = this.getGridApi().getRowNodeForPrimaryKey(primaryKey);
|
|
41
41
|
if (!rowNode) {
|
|
42
42
|
this.logWarn(`Can NOT clone row: rowNode not found for primaryKey ${primaryKey}`);
|
|
43
43
|
}
|
|
@@ -44,7 +44,7 @@ export class AlertApiImpl extends ApiBase {
|
|
|
44
44
|
this.dispatchAction(SystemRedux.SystemAlertAdd(alertToShow, this.getAlertOptions().maxAlertsInStore));
|
|
45
45
|
// 2. Publish the Alert Fired Event
|
|
46
46
|
const alertFiredInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { alert: alertToShow });
|
|
47
|
-
const results = await this.
|
|
47
|
+
const results = await this.getEventApi().emit('AlertFired', alertFiredInfo);
|
|
48
48
|
const showPopup = results.reduce((endResult, aResult) => {
|
|
49
49
|
return endResult && aResult !== false;
|
|
50
50
|
}, true);
|
|
@@ -101,13 +101,13 @@ export class AlertApiImpl extends ApiBase {
|
|
|
101
101
|
}
|
|
102
102
|
if (alertNode) {
|
|
103
103
|
if (alertProperties.HighlightRow) {
|
|
104
|
-
this.
|
|
104
|
+
this.getGridApi().refreshRowNodes([alertNode]);
|
|
105
105
|
setTimeout(() => {
|
|
106
106
|
this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
|
|
107
107
|
}, this.getAlertOptions().rowHighlightDuration);
|
|
108
108
|
}
|
|
109
109
|
if (alertProperties.HighlightCell) {
|
|
110
|
-
this.
|
|
110
|
+
this.getGridApi().refreshCells([alertNode], [alertToShow.cellDataChangedInfo.column.columnId]);
|
|
111
111
|
setTimeout(() => {
|
|
112
112
|
this.dispatchAction(SystemRedux.SystemAlertRemoveCellHighlight(alertToShow));
|
|
113
113
|
}, this.getAlertOptions().cellHighlightDuration);
|
|
@@ -118,7 +118,7 @@ export class AlertApiImpl extends ApiBase {
|
|
|
118
118
|
else if (alertProperties.HighlightRow &&
|
|
119
119
|
isAdaptableRowChangedAlert(alertToShow) &&
|
|
120
120
|
((_b = alertToShow.gridDataChangedInfo) === null || _b === void 0 ? void 0 : _b.rowTrigger) === 'Add') {
|
|
121
|
-
this.
|
|
121
|
+
this.getGridApi().refreshRowNodes(alertToShow.gridDataChangedInfo.rowNodes);
|
|
122
122
|
setTimeout(() => {
|
|
123
123
|
this.dispatchAction(SystemRedux.SystemAlertRemoveRowHighlight(alertToShow));
|
|
124
124
|
}, this.getAlertOptions().rowHighlightDuration);
|
|
@@ -168,7 +168,7 @@ export class AlertApiImpl extends ApiBase {
|
|
|
168
168
|
}
|
|
169
169
|
evaluateAlertDefinitions(alertDefinitions) {
|
|
170
170
|
const filterScopeAllDefinitions = (alertDefinition) => {
|
|
171
|
-
if (this.
|
|
171
|
+
if (this.getColumnScopeApi().scopeIsAll(alertDefinition.Scope) &&
|
|
172
172
|
!this.getAdaptableApi().expressionApi.getAdaptableQueryExpression(alertDefinition.Rule)) {
|
|
173
173
|
// we don't support scope ALL without an expression
|
|
174
174
|
// the predicates for scope ALL do NOT make any sense for a programmatic evaluation
|
|
@@ -203,7 +203,7 @@ export class AlertApiImpl extends ApiBase {
|
|
|
203
203
|
// if there is an Expression defined, extract only the columns from there (in that case the Scope would be 'All' anyway)
|
|
204
204
|
// columns referenced in rule expression
|
|
205
205
|
const ruleExpression = this.getAdaptableApi().expressionApi.getAdaptableQueryExpression(alertDefinition.Rule);
|
|
206
|
-
if (this.
|
|
206
|
+
if (this.getColumnScopeApi().scopeIsAll(alertDefinition.Scope) &&
|
|
207
207
|
StringExtensions.IsNotNullOrEmpty(ruleExpression)) {
|
|
208
208
|
// return only first referenced column (otherwise we would generate multiple alerts for the same row)
|
|
209
209
|
const queryColumns = this.getAdaptableApi()
|
|
@@ -91,19 +91,19 @@ export class ChartingApiImpl extends ApiBase {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
getOpenChartContainer(chartDefinition) {
|
|
94
|
-
var _a
|
|
95
|
-
const containerOptions =
|
|
94
|
+
var _a;
|
|
95
|
+
const containerOptions = this.getChartingOptions().chartContainers;
|
|
96
96
|
if (!containerOptions || !containerOptions.length) {
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
|
-
return ((
|
|
99
|
+
return ((_a = containerOptions.find((container) => {
|
|
100
100
|
const chartRef = this.getChartRef(chartDefinition.Model.chartId);
|
|
101
101
|
const containerElement = this.internalApi.getContainerElement(container);
|
|
102
102
|
if (!(chartRef === null || chartRef === void 0 ? void 0 : chartRef.chartElement) || !containerElement) {
|
|
103
103
|
return false;
|
|
104
104
|
}
|
|
105
105
|
return containerElement.contains(chartRef.chartElement);
|
|
106
|
-
})) !== null &&
|
|
106
|
+
})) !== null && _a !== void 0 ? _a : null);
|
|
107
107
|
}
|
|
108
108
|
setChartReadOnly(chartDefinition) {
|
|
109
109
|
this.dispatchAction(ChartingRedux.ChartingEditChart(Object.assign(Object.assign({}, chartDefinition), { IsReadOnly: true })));
|
|
@@ -23,7 +23,7 @@ export class ColumnApiImpl extends ApiBase {
|
|
|
23
23
|
}
|
|
24
24
|
getColumns() {
|
|
25
25
|
var _a;
|
|
26
|
-
return (_a = this.
|
|
26
|
+
return (_a = this.getGridApi().getGridState().Columns) !== null && _a !== void 0 ? _a : [];
|
|
27
27
|
}
|
|
28
28
|
getStandardColumns() {
|
|
29
29
|
var _a;
|
|
@@ -36,7 +36,7 @@ export class ColumnApiImpl extends ApiBase {
|
|
|
36
36
|
return cols !== null && cols !== void 0 ? cols : [];
|
|
37
37
|
}
|
|
38
38
|
getVisibleColumns() {
|
|
39
|
-
const layout = this.
|
|
39
|
+
const layout = this.getLayoutApi().getCurrentLayout();
|
|
40
40
|
const visibleCols = layout.Columns.reduce((acc, colId) => {
|
|
41
41
|
acc[colId] = true;
|
|
42
42
|
return acc;
|
|
@@ -174,7 +174,7 @@ export class ColumnApiImpl extends ApiBase {
|
|
|
174
174
|
}
|
|
175
175
|
let result = columnId + GeneralConstants.MISSING_COLUMN;
|
|
176
176
|
if (this.isAutoRowGroupColumn(columnId)) {
|
|
177
|
-
const currentLayout = this.
|
|
177
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
178
178
|
if (currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.RowGroupedColumns) {
|
|
179
179
|
result = `[Grouped column: ${currentLayout.RowGroupedColumns.join(', ')}]`;
|
|
180
180
|
}
|
|
@@ -379,10 +379,10 @@ export class ColumnApiImpl extends ApiBase {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
getDistinctDisplayValuesForColumn(columnId) {
|
|
382
|
-
return this.
|
|
382
|
+
return this.getGridApi().internalApi.getDistinctDisplayValuesForColumn(columnId);
|
|
383
383
|
}
|
|
384
384
|
setColumnCaption(columnId, caption) {
|
|
385
|
-
return this.
|
|
385
|
+
return this.getLayoutApi().setColumnCaption(columnId, caption);
|
|
386
386
|
}
|
|
387
387
|
updateColumnConfiguration(columnConfig) {
|
|
388
388
|
logDeprecationExternal(this.getAdatableLogger(), 'ColumnApi', 'updateColumnConfiguration', 'GridApi', 'updateAgGridColumnState');
|
|
@@ -14,10 +14,10 @@ export class ColumnFilterApiImpl extends ApiBase {
|
|
|
14
14
|
};
|
|
15
15
|
return this.getAdaptableApi()
|
|
16
16
|
.predicateApi.internalApi.getFilterPredicateDefs(scope)
|
|
17
|
-
.filter((predicate) => this.
|
|
17
|
+
.filter((predicate) => this.getColumnScopeApi().isColumnInScope(column, predicate.columnScope));
|
|
18
18
|
}
|
|
19
19
|
getFilterPredicateDefsForColumnId(columnId) {
|
|
20
|
-
const column = this.
|
|
20
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
21
21
|
return column ? this.getFilterPredicateDefsForColumn(column) : undefined;
|
|
22
22
|
}
|
|
23
23
|
showQuickFilterBar() {
|
|
@@ -35,7 +35,7 @@ export class ColumnFilterApiImpl extends ApiBase {
|
|
|
35
35
|
}
|
|
36
36
|
getColumnFilters() {
|
|
37
37
|
var _a;
|
|
38
|
-
const currentLayout = this.
|
|
38
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
39
39
|
return (_a = currentLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
|
|
40
40
|
}
|
|
41
41
|
getActiveColumnFilters() {
|
|
@@ -44,8 +44,8 @@ export class ColumnFilterApiImpl extends ApiBase {
|
|
|
44
44
|
getColumnFilterDefs() {
|
|
45
45
|
const filters = this.getColumnFilters();
|
|
46
46
|
return filters.map((columnFilter) => {
|
|
47
|
-
const column = this.
|
|
48
|
-
const predicate = this.
|
|
47
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnFilter.ColumnId);
|
|
48
|
+
const predicate = this.getPredicateApi().getPredicateDefById(columnFilter.Predicate.PredicateId);
|
|
49
49
|
return {
|
|
50
50
|
predicate,
|
|
51
51
|
dataType: column === null || column === void 0 ? void 0 : column.dataType,
|
|
@@ -55,7 +55,7 @@ export class ColumnFilterApiImpl extends ApiBase {
|
|
|
55
55
|
}
|
|
56
56
|
getColumnFiltersForLayout(layoutName) {
|
|
57
57
|
var _a;
|
|
58
|
-
const layout = this.
|
|
58
|
+
const layout = this.getLayoutApi().getLayoutByName(layoutName);
|
|
59
59
|
return (_a = layout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
|
|
60
60
|
}
|
|
61
61
|
setColumnFilters(columnFilters) {
|
|
@@ -64,7 +64,7 @@ export class ColumnFilterApiImpl extends ApiBase {
|
|
|
64
64
|
this.logWarn('Column Filter has no Predicate', columnFilter);
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
|
-
const isValidPredicate = this.
|
|
67
|
+
const isValidPredicate = this.getPredicateApi().isValidPredicate(columnFilter.Predicate);
|
|
68
68
|
if (!isValidPredicate) {
|
|
69
69
|
this.logWarn('Column Filter Predicate is not valid', columnFilter);
|
|
70
70
|
}
|
|
@@ -118,10 +118,10 @@ export class ColumnFilterApiImpl extends ApiBase {
|
|
|
118
118
|
if (!filter || !filter.Predicate || !filter.Predicate.PredicateId) {
|
|
119
119
|
return false;
|
|
120
120
|
}
|
|
121
|
-
const predicateDef = this.
|
|
121
|
+
const predicateDef = this.getPredicateApi().getPredicateDefById(filter === null || filter === void 0 ? void 0 : filter.Predicate.PredicateId);
|
|
122
122
|
if (ArrayExtensions.IsNull(predicateDef.inputs) &&
|
|
123
123
|
// values predicates have no inputs in the definition
|
|
124
|
-
!this.
|
|
124
|
+
!this.getPredicateApi().internalApi.hasPredicateValues(filter.Predicate)) {
|
|
125
125
|
return true;
|
|
126
126
|
}
|
|
127
127
|
const inputs = filter.Predicate.Inputs;
|
|
@@ -26,7 +26,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
26
26
|
if (scope == undefined) {
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
29
|
-
const columns = this.
|
|
29
|
+
const columns = this.getColumnApi().getColumns();
|
|
30
30
|
if ('All' in scope) {
|
|
31
31
|
return columns;
|
|
32
32
|
}
|
|
@@ -96,7 +96,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
96
96
|
!this.scopeIsAll(scope) &&
|
|
97
97
|
'ColumnIds' in scope &&
|
|
98
98
|
scope.ColumnIds.length == 1 &&
|
|
99
|
-
this.
|
|
99
|
+
this.getColumnApi().hasNumberDataType(scope.ColumnIds[0]));
|
|
100
100
|
}
|
|
101
101
|
isSingleBooleanColumnScope(scope) {
|
|
102
102
|
return (this.scopeHasColumns(scope) &&
|
|
@@ -104,7 +104,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
104
104
|
!this.scopeIsAll(scope) &&
|
|
105
105
|
'ColumnIds' in scope &&
|
|
106
106
|
scope.ColumnIds.length == 1 &&
|
|
107
|
-
this.
|
|
107
|
+
this.getColumnApi().hasBooleanDataType(scope.ColumnIds[0]));
|
|
108
108
|
}
|
|
109
109
|
areAllBooleanColumnsInScope(scope) {
|
|
110
110
|
return (this.scopeHasColumns(scope) &&
|
|
@@ -112,7 +112,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
112
112
|
!this.scopeIsAll(scope) &&
|
|
113
113
|
'ColumnIds' in scope &&
|
|
114
114
|
scope.ColumnIds.length &&
|
|
115
|
-
scope.ColumnIds.every((columnId) => this.
|
|
115
|
+
scope.ColumnIds.every((columnId) => this.getColumnApi().hasBooleanDataType(columnId)));
|
|
116
116
|
}
|
|
117
117
|
isColumnInScopeColumns(column, scope) {
|
|
118
118
|
return this.scopeHasColumns(scope) && this.isColumnInScope(column, scope);
|
|
@@ -120,7 +120,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
120
120
|
isPrimaryKeyColumnInScopeColumns(scope) {
|
|
121
121
|
return ('ColumnIds' in scope &&
|
|
122
122
|
scope.ColumnIds.length == 1 &&
|
|
123
|
-
scope.ColumnIds.find((c) => c == this.
|
|
123
|
+
scope.ColumnIds.find((c) => c == this.getOptions().primaryKey) != null);
|
|
124
124
|
}
|
|
125
125
|
getScopeToString(scope) {
|
|
126
126
|
if ('All' in scope) {
|
|
@@ -253,7 +253,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
253
253
|
'DataTypes' in b &&
|
|
254
254
|
a.ColumnIds.every((columnId) => {
|
|
255
255
|
var _a;
|
|
256
|
-
return b.DataTypes.includes((_a = this.
|
|
256
|
+
return b.DataTypes.includes((_a = this.getColumnApi().getColumnWithColumnId(columnId)) === null || _a === void 0 ? void 0 : _a.dataType);
|
|
257
257
|
})) {
|
|
258
258
|
return true;
|
|
259
259
|
}
|
|
@@ -265,7 +265,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
265
265
|
// check if each colum in a has column types in b
|
|
266
266
|
if ('ColumnIds' in a && 'ColumnTypes' in b) {
|
|
267
267
|
const inScope = a.ColumnIds.every((columnId) => {
|
|
268
|
-
const column = this.
|
|
268
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
269
269
|
// check if at least one column-type is in scope
|
|
270
270
|
return column.columnTypes.some((columnColumnType) => b.ColumnTypes.includes(columnColumnType));
|
|
271
271
|
});
|
|
@@ -276,7 +276,7 @@ export class ColumnScopeApiImpl extends ApiBase {
|
|
|
276
276
|
return false;
|
|
277
277
|
}
|
|
278
278
|
createCellColorRangesForScope(scope) {
|
|
279
|
-
let distinctColumnsValues = this.
|
|
279
|
+
let distinctColumnsValues = this.getGridApi().internalApi.getDistinctRawValuesForColumn(this.getSingleColumnInScope(scope));
|
|
280
280
|
let minValue = Math.min(...distinctColumnsValues);
|
|
281
281
|
let maxValue = Math.max(...distinctColumnsValues);
|
|
282
282
|
const ranges = [];
|
|
@@ -67,7 +67,7 @@ export class ConfigApiImpl extends ApiBase {
|
|
|
67
67
|
const newState = this.getPersistedState();
|
|
68
68
|
const stateReloadedInfo = Object.assign({ oldState,
|
|
69
69
|
newState, adaptableStateKey: adaptableOptions.adaptableStateKey }, this.getAdaptableInternalApi().buildBaseContext());
|
|
70
|
-
this.
|
|
70
|
+
this.getEventApi().emit('AdaptableStateReloaded', stateReloadedInfo);
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
});
|
|
@@ -102,7 +102,7 @@ export class ConfigApiImpl extends ApiBase {
|
|
|
102
102
|
}
|
|
103
103
|
getAdaptableSortState() {
|
|
104
104
|
const adaptableSortState = {
|
|
105
|
-
columnSorts: this.
|
|
105
|
+
columnSorts: this.getGridApi().getColumnSorts(),
|
|
106
106
|
customSorts: this.getAdaptableApi().customSortApi.getCustomSorts(),
|
|
107
107
|
};
|
|
108
108
|
return adaptableSortState;
|
|
@@ -8,7 +8,7 @@ export class DataChangeHistoryApiImpl extends ApiBase {
|
|
|
8
8
|
const columnId = dataChangeInfo.column.columnId;
|
|
9
9
|
const primaryKeyValue = dataChangeInfo.primaryKeyValue;
|
|
10
10
|
const changedAt = dataChangeInfo.changedAt;
|
|
11
|
-
const showLastDataChangeOnly = this.
|
|
11
|
+
const showLastDataChangeOnly = this.getDataChangeHistoryOptions().showLastDataChangeOnly;
|
|
12
12
|
if (showLastDataChangeOnly) {
|
|
13
13
|
return JSON.stringify({ columnId, primaryKeyValue });
|
|
14
14
|
}
|
|
@@ -33,7 +33,7 @@ export class FlashingCellApiImpl extends ApiBase {
|
|
|
33
33
|
showFlashingCell(flashingCellToShow) {
|
|
34
34
|
this.addUidToAdaptableObject(flashingCellToShow);
|
|
35
35
|
const flashingCellFiredInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { flashingCell: flashingCellToShow });
|
|
36
|
-
const results = this.
|
|
36
|
+
const results = this.getEventApi().emitSync('FlashingCellDisplayed', flashingCellFiredInfo);
|
|
37
37
|
const shouldShow = results.reduce((endResult, aResult) => {
|
|
38
38
|
return endResult && aResult !== false;
|
|
39
39
|
}, true);
|
|
@@ -91,7 +91,7 @@ export class FlashingCellApiImpl extends ApiBase {
|
|
|
91
91
|
getFlashingCellPredicateDefsForScope(scope) {
|
|
92
92
|
return this.getAdaptableApi()
|
|
93
93
|
.predicateApi.internalApi.getFlashingCellPredicateDefs(scope)
|
|
94
|
-
.filter((predicateDef) => this.
|
|
94
|
+
.filter((predicateDef) => this.getColumnScopeApi().isScopeInScope(scope, predicateDef.columnScope));
|
|
95
95
|
}
|
|
96
96
|
clearAllFlashingCells() {
|
|
97
97
|
this.getAdaptableInternalApi().getFlashingCellService().clearAllGridCellFlashes();
|
|
@@ -71,7 +71,7 @@ export class FormatColumnApiImpl extends ApiBase {
|
|
|
71
71
|
return this.internalApi.getFormatColumnWithColumnInScope(formatColumns, column);
|
|
72
72
|
}
|
|
73
73
|
getFormatColumnsForColumnId(columnId, config) {
|
|
74
|
-
const abColumn = this.
|
|
74
|
+
const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
75
75
|
if (!abColumn) {
|
|
76
76
|
return [];
|
|
77
77
|
}
|
|
@@ -81,13 +81,13 @@ export class FormatColumnApiImpl extends ApiBase {
|
|
|
81
81
|
this.showModulePopup(ModuleConstants.FormatColumnModuleId);
|
|
82
82
|
}
|
|
83
83
|
getFormatColumnsWithAllScope(formatColumns) {
|
|
84
|
-
return formatColumns.filter((fc) => this.
|
|
84
|
+
return formatColumns.filter((fc) => this.getColumnScopeApi().scopeIsAll(fc.Scope));
|
|
85
85
|
}
|
|
86
86
|
getFormatColumnsWithDataTypeScope(formatColumns) {
|
|
87
|
-
return formatColumns.filter((fc) => this.
|
|
87
|
+
return formatColumns.filter((fc) => this.getColumnScopeApi().scopeHasDataType(fc.Scope));
|
|
88
88
|
}
|
|
89
89
|
getFormatColumnsWithColumnScope(formatColumns) {
|
|
90
|
-
return formatColumns.filter((fc) => this.
|
|
90
|
+
return formatColumns.filter((fc) => this.getColumnScopeApi().scopeHasColumns(fc.Scope));
|
|
91
91
|
}
|
|
92
92
|
hasCustomDisplayFormatter(formatColumn) {
|
|
93
93
|
var _a;
|
|
@@ -85,7 +85,7 @@ export class FreeTextColumnApiImpl extends ApiBase {
|
|
|
85
85
|
}
|
|
86
86
|
getFreeTextColumnValueForRowNode(freeTextColumn, rowNode) {
|
|
87
87
|
try {
|
|
88
|
-
if (this.
|
|
88
|
+
if (this.getGridApi().isGroupRowNode(rowNode)) {
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
91
|
if (ArrayExtensions.IsNotNullOrEmpty(freeTextColumn.FreeTextStoredValues)) {
|
|
@@ -88,7 +88,7 @@ export class GridApiImpl extends ApiBase {
|
|
|
88
88
|
}
|
|
89
89
|
setCellValue(cellUpdateRequest) {
|
|
90
90
|
var _a;
|
|
91
|
-
const abColumn = this.
|
|
91
|
+
const abColumn = this.getColumnApi().getColumnWithColumnId(cellUpdateRequest.columnId);
|
|
92
92
|
if (!abColumn) {
|
|
93
93
|
this.logWarn(`setCellValue() - column not found for columnId: ${cellUpdateRequest.columnId}`);
|
|
94
94
|
return;
|
|
@@ -241,7 +241,7 @@ export class GridApiImpl extends ApiBase {
|
|
|
241
241
|
/**
|
|
242
242
|
* Select all rows and all columns
|
|
243
243
|
*/
|
|
244
|
-
const currentLayout = this.
|
|
244
|
+
const currentLayout = this.getLayoutApi().getCurrentLayout();
|
|
245
245
|
preapredGridCellRange = {
|
|
246
246
|
columnIds: currentLayout.Columns,
|
|
247
247
|
};
|
|
@@ -277,7 +277,7 @@ export class GridApiImpl extends ApiBase {
|
|
|
277
277
|
this.selectColumns([columnId]);
|
|
278
278
|
}
|
|
279
279
|
selectColumns(columnIds) {
|
|
280
|
-
this.
|
|
280
|
+
this.getColumnApi().selectColumns(columnIds);
|
|
281
281
|
}
|
|
282
282
|
getFirstRowNode() {
|
|
283
283
|
return this._adaptable.getFirstRowNode();
|
|
@@ -310,7 +310,7 @@ export class GridApiImpl extends ApiBase {
|
|
|
310
310
|
}
|
|
311
311
|
getNormalisedValueFromRowNode(rowNode, columnId) {
|
|
312
312
|
const rawValue = this._adaptable.getRawValueFromRowNode(rowNode, columnId);
|
|
313
|
-
const abColumn = this.
|
|
313
|
+
const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
314
314
|
return this._adaptable.getNormalisedValueFromRawValue(rawValue, abColumn);
|
|
315
315
|
}
|
|
316
316
|
getRowNodesForPrimaryKeys(primaryKeyValues) {
|
|
@@ -494,25 +494,20 @@ export class GridApiImpl extends ApiBase {
|
|
|
494
494
|
this._adaptable.updateRowGroupsExpandedState();
|
|
495
495
|
}
|
|
496
496
|
isCellEditable(gridCell) {
|
|
497
|
-
if (
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
if (!gridCell.column) {
|
|
501
|
-
// GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
|
|
502
|
-
return false;
|
|
503
|
-
}
|
|
504
|
-
if (gridCell.column.readOnly) {
|
|
497
|
+
// Note if cell.editable in AG Grid is a function (and nothing is provided in Adaptble) this will return true.
|
|
498
|
+
// If not Grid Cell or Column then return false - GridCell.column may be undefined for cells from synthetic columns created by AG Grid (ex. autoGroup columns)
|
|
499
|
+
if (!gridCell || !gridCell.column || !gridCell.rowNode) {
|
|
505
500
|
return false;
|
|
506
501
|
}
|
|
507
502
|
if (gridCell.rowNode && this.isSummaryNode(gridCell.rowNode)) {
|
|
508
503
|
return false;
|
|
509
504
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
return
|
|
505
|
+
// checking `gridCell.column.readOnly` might return misleading results
|
|
506
|
+
// because cell editability is defined by EditOptions.isCellEditable() as well
|
|
507
|
+
const agGridColumn = this.getColumnApi().internalApi.getAgGridColumnForAdaptableColumn(gridCell.column.columnId);
|
|
508
|
+
// this will invoke the colDef.editable callback
|
|
509
|
+
// there we check both Adaptable and AG Grid editability
|
|
510
|
+
return agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.isCellEditable(gridCell.rowNode);
|
|
516
511
|
}
|
|
517
512
|
isCellEdited(gridCell) {
|
|
518
513
|
if (!gridCell) {
|
|
@@ -645,7 +640,9 @@ export class GridApiImpl extends ApiBase {
|
|
|
645
640
|
});
|
|
646
641
|
const newColumnDefinitions = columnDefinitionsToBeUpdated.filter((c) => !currentColIds.includes(c.colId));
|
|
647
642
|
if (newColumnDefinitions.length) {
|
|
648
|
-
this.logWarn(`Columns with ids ${newColumnDefinitions
|
|
643
|
+
this.logWarn(`Columns with ids ${newColumnDefinitions
|
|
644
|
+
.map((c) => c.colId)
|
|
645
|
+
.join(', ')} do not exist, will add them instead!`);
|
|
649
646
|
}
|
|
650
647
|
this.setAgGridColumnDefinitions([...updatedColDefs, ...newColumnDefinitions]);
|
|
651
648
|
}
|
|
@@ -281,25 +281,25 @@ export class LayoutApiImpl extends ApiBase {
|
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
removeColumnFromLayout(columnId, layoutName) {
|
|
284
|
-
const column = this.
|
|
284
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
285
285
|
if (column) {
|
|
286
286
|
const layout = this.getLayoutByName(layoutName);
|
|
287
287
|
if (layout) {
|
|
288
288
|
if (layout.Columns.includes(columnId)) {
|
|
289
289
|
this.dispatchAction(LayoutRedux.LayoutRemoveColumn(layoutName, columnId));
|
|
290
|
-
this.
|
|
290
|
+
this.getColumnApi().hideColumn(columnId);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
addColumnToLayout(columnId, layoutName) {
|
|
296
|
-
const column = this.
|
|
296
|
+
const column = this.getColumnApi().getColumnWithColumnId(columnId);
|
|
297
297
|
if (column) {
|
|
298
298
|
const layout = this.getLayoutByName(layoutName);
|
|
299
299
|
if (layout) {
|
|
300
300
|
if (!layout.Columns.includes(columnId)) {
|
|
301
301
|
this.dispatchAction(LayoutRedux.LayoutAddColumn(layoutName, columnId));
|
|
302
|
-
this.
|
|
302
|
+
this.getColumnApi().showColumn(columnId);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
}
|
|
@@ -71,9 +71,9 @@ export class PredicateApiImpl extends ApiBase {
|
|
|
71
71
|
if (!predicate.ColumnId) {
|
|
72
72
|
return this.handlePredicate(predicate, context, defaultReturn);
|
|
73
73
|
}
|
|
74
|
-
const paramsForColumn = Object.assign(Object.assign({}, context), { column: this.
|
|
74
|
+
const paramsForColumn = Object.assign(Object.assign({}, context), { column: this.getColumnApi().getColumnWithColumnId(predicate.ColumnId),
|
|
75
75
|
// value: params?.node?.data?.[predicate.ColumnId],
|
|
76
|
-
value: this.
|
|
76
|
+
value: this.getGridApi().getRawValueFromRowNode(context.node, predicate.ColumnId) });
|
|
77
77
|
if ('oldValue' in paramsForColumn) {
|
|
78
78
|
delete paramsForColumn.oldValue;
|
|
79
79
|
}
|
|
@@ -52,7 +52,7 @@ export class ScheduleApiImpl extends ApiBase {
|
|
|
52
52
|
}
|
|
53
53
|
getReportSchedules(config) {
|
|
54
54
|
var _a;
|
|
55
|
-
return ((_a = this.handleLayoutAssociatedObjects(this.
|
|
55
|
+
return ((_a = this.handleLayoutAssociatedObjects(this.getExportApi().getReportSchedules(), 'Schedule', config)) !== null && _a !== void 0 ? _a : []);
|
|
56
56
|
}
|
|
57
57
|
getActiveReportSchedules() {
|
|
58
58
|
return this.getReportSchedules().filter((schedule) => !schedule.IsSuspended);
|
|
@@ -163,7 +163,7 @@ export class ScheduleApiImpl extends ApiBase {
|
|
|
163
163
|
}
|
|
164
164
|
else if (scheduleType == 'Report') {
|
|
165
165
|
const reportSchedule = schedule;
|
|
166
|
-
this.
|
|
166
|
+
this.getExportApi().runReport(reportSchedule.ReportName, reportSchedule.ExportDestination);
|
|
167
167
|
}
|
|
168
168
|
else if (scheduleType == 'ipushpull') {
|
|
169
169
|
const ippApi = this.getAdaptableApi().pluginsApi.getipushpullPluginApi();
|
|
@@ -83,7 +83,7 @@ export class TeamSharingApiImpl extends ApiBase {
|
|
|
83
83
|
this.dispatchAction(TeamSharingRedux.TeamSharingImportItem(sharedEntity));
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
|
-
const customSharedEntityImportHandler = this.
|
|
86
|
+
const customSharedEntityImportHandler = this.getTeamSharingOptions().handleCustomSharedEntityImport;
|
|
87
87
|
if (!customSharedEntityImportHandler) {
|
|
88
88
|
this.logError(`Could NOT import custom shared entity because 'TeamSharingOptions.handleCustomSharedEntityImport(...)' is NOT defined!`, sharedEntity);
|
|
89
89
|
return;
|
|
@@ -58,7 +58,7 @@ export class ThemeApiImpl extends ApiBase {
|
|
|
58
58
|
}
|
|
59
59
|
this._adaptable.applyAdaptableTheme(currentTheme);
|
|
60
60
|
let themeChangedInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { trigger: 'ThemeSelected', theme: currentTheme });
|
|
61
|
-
this.
|
|
61
|
+
this.getEventApi().emit('ThemeChanged', themeChangedInfo);
|
|
62
62
|
}
|
|
63
63
|
getUserThemes() {
|
|
64
64
|
var _a;
|
|
@@ -79,7 +79,7 @@ export class ThemeApiImpl extends ApiBase {
|
|
|
79
79
|
editTheme(theme) {
|
|
80
80
|
this.dispatchAction(ThemeRedux.ThemeEdit(theme));
|
|
81
81
|
let themeChangedInfo = Object.assign(Object.assign({}, this.getAdaptableInternalApi().buildBaseContext()), { trigger: 'ThemeEdited', theme: theme });
|
|
82
|
-
this.
|
|
82
|
+
this.getEventApi().emit('ThemeChanged', themeChangedInfo);
|
|
83
83
|
const currentTheme = this.getCurrentTheme();
|
|
84
84
|
if (currentTheme === theme.Name) {
|
|
85
85
|
this._adaptable.applyAdaptableTheme(theme);
|