@adaptabletools/adaptable-cjs 20.1.8 → 20.2.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +27 -0
- package/base.css.map +1 -1
- package/index.css +22 -0
- package/index.css.map +1 -1
- package/package.json +2 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +2 -1
- package/src/AdaptableOptions/ExportOptions.d.ts +91 -8
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -6
- package/src/AdaptableState/FormatColumnState.d.ts +8 -0
- package/src/AdaptableState/LayoutState.d.ts +15 -2
- package/src/AdaptableState/QuickSearchState.d.ts +8 -0
- package/src/Api/ColumnApi.d.ts +5 -0
- package/src/Api/ExportApi.d.ts +23 -7
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ColumnApiImpl.js +15 -31
- package/src/Api/Implementation/ExportApiImpl.d.ts +11 -4
- package/src/Api/Implementation/ExportApiImpl.js +50 -8
- package/src/Api/Implementation/LayoutHelpers.js +44 -0
- package/src/Api/Implementation/QuickSearchApiImpl.d.ts +4 -0
- package/src/Api/Implementation/QuickSearchApiImpl.js +12 -0
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/ExportInternalApi.d.ts +3 -8
- package/src/Api/Internal/ExportInternalApi.js +1 -74
- package/src/Api/Internal/ExpressionInternalApi.d.ts +1 -1
- package/src/Api/Internal/ExpressionInternalApi.js +1 -32
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +2 -1
- package/src/Api/Internal/FormatColumnInternalApi.js +62 -0
- package/src/Api/QuickSearchApi.d.ts +16 -0
- package/src/Redux/Store/AdaptableStore.js +3 -2
- package/src/Utilities/Constants/GeneralConstants.js +2 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -0
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -0
- package/src/View/Dashboard/Dashboard.js +2 -4
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +6 -1
- package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +4 -0
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +24 -20
- package/src/View/QuickSearch/QuickSearchInput.js +6 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -3
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
- package/src/agGrid/AdaptableAgGrid.js +121 -38
- package/src/agGrid/AgGridAdapter.d.ts +4 -1
- package/src/agGrid/AgGridAdapter.js +89 -12
- package/src/agGrid/AgGridColumnAdapter.d.ts +4 -0
- package/src/agGrid/AgGridColumnAdapter.js +142 -35
- package/src/agGrid/AgGridExportAdapter.d.ts +6 -1
- package/src/agGrid/AgGridExportAdapter.js +103 -14
- package/src/agGrid/FloatingFilterWrapper.js +30 -4
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +16 -2
- package/src/layout-manager/src/index.d.ts +1 -1
- package/src/layout-manager/src/index.js +133 -18
- package/src/layout-manager/src/normalizeLayoutModel.d.ts +2 -4
- package/src/layout-manager/src/normalizeLayoutModel.js +13 -18
- package/src/layout-manager/src/simplifyLayoutModel.js +14 -2
- package/src/metamodel/adaptable.metamodel.d.ts +71 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Utilities/buildSortedColumnStateForLayout.d.ts +0 -7
- package/src/Utilities/buildSortedColumnStateForLayout.js +0 -135
package/src/Api/ExportApi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdaptableForm } from '../AdaptableState/Common/AdaptableForm';
|
|
2
2
|
import { ExportState, Report, ReportFormatType, ReportNameType, SystemReportFormat, SystemReportName } from '../AdaptableState/ExportState';
|
|
3
|
-
import { CustomDestination, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../AdaptableOptions/ExportOptions';
|
|
3
|
+
import { CustomDestination, CustomExportParams, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../AdaptableOptions/ExportOptions';
|
|
4
4
|
import { AdaptableColumn } from '../types';
|
|
5
5
|
/**
|
|
6
6
|
* Provides run-time access to the Export Module and Report state
|
|
@@ -25,18 +25,22 @@ export interface ExportApi {
|
|
|
25
25
|
/**
|
|
26
26
|
* Retrieves name of currently selected Report
|
|
27
27
|
*/
|
|
28
|
-
getCurrentReportName():
|
|
28
|
+
getCurrentReportName(): ReportNameType | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves name of currently selected Report
|
|
31
|
+
*/
|
|
32
|
+
getCurrentReportFormat(): ReportFormatType | undefined;
|
|
29
33
|
/**
|
|
30
34
|
* Retrieves currently selected Report in Adaptable State
|
|
31
35
|
* @returns report that is currently selected
|
|
32
36
|
*/
|
|
33
|
-
getCurrentReport(): Report;
|
|
37
|
+
getCurrentReport(): Report | undefined;
|
|
34
38
|
/**
|
|
35
39
|
* Retrieves Report with the given name
|
|
36
40
|
* @param reportName report to retrieve
|
|
37
41
|
* @returns report
|
|
38
42
|
*/
|
|
39
|
-
getReportByName(reportName:
|
|
43
|
+
getReportByName(reportName: ReportNameType): Report | undefined;
|
|
40
44
|
/**
|
|
41
45
|
* Retrieves Report by Id
|
|
42
46
|
* @param id report id
|
|
@@ -139,12 +143,24 @@ export interface ExportApi {
|
|
|
139
143
|
* @param reportName - name of the report
|
|
140
144
|
* @param format - format of the report
|
|
141
145
|
* @param destination - destination to export to
|
|
146
|
+
* @param config - optional configuration
|
|
147
|
+
* @param config.exportParams - function to modify the default export parameters; it will be called with the default export parameters and should return the modified export parameters
|
|
148
|
+
* @param config.showProgressIndicator - whether to show progress indicator
|
|
142
149
|
*/
|
|
143
|
-
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType
|
|
150
|
+
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, config?: {
|
|
151
|
+
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
152
|
+
showProgressIndicator?: boolean;
|
|
153
|
+
}): Promise<void>;
|
|
144
154
|
/**
|
|
145
155
|
* Gets the data for the Report with the given Name in the given Format
|
|
146
156
|
* @param reportName - name of the report
|
|
147
157
|
* @param format - format of the report
|
|
148
|
-
|
|
149
|
-
|
|
158
|
+
* @param config - optional configuration
|
|
159
|
+
* @param config.exportParams - function to modify the default export parameters; it will be called with the default export parameters and should return the modified export parameters
|
|
160
|
+
* @param config.showProgressIndicator - whether to show progress indicator
|
|
161
|
+
*/
|
|
162
|
+
getReportData(reportName: ReportNameType, format: ReportFormatType, config?: {
|
|
163
|
+
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
164
|
+
showProgressIndicator?: boolean;
|
|
165
|
+
}): Promise<ExportResultData>;
|
|
150
166
|
}
|
|
@@ -5,7 +5,6 @@ import { ColumnApi } from '../ColumnApi';
|
|
|
5
5
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
6
6
|
import { ColumnInternalApi } from '../Internal/ColumnInternalApi';
|
|
7
7
|
import { ColDef, ColGroupDef, Column, GridApi } from 'ag-grid-enterprise';
|
|
8
|
-
export declare function isAutoRowGroupColumn(columnId: string): boolean;
|
|
9
8
|
export declare function generateAutoRowGroupSingleColumn(): AdaptableColumn;
|
|
10
9
|
export declare function generateAutoTreeSingleColumn(): AdaptableColumn;
|
|
11
10
|
export declare function generateAutoRowGroupColumnForColumn(column: AdaptableColumn): AdaptableColumn;
|
|
@@ -30,8 +29,9 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
|
|
|
30
29
|
autosizeAllColumns(): void;
|
|
31
30
|
hideColumn(columnId: string): void;
|
|
32
31
|
showColumn(columnId: string): void;
|
|
33
|
-
isAutoRowGroupColumn(columnId: string): boolean;
|
|
34
32
|
isPivotResultColumn(columnId: string): boolean;
|
|
33
|
+
isSelectionColumn(columnId: string): boolean;
|
|
34
|
+
isAutoRowGroupColumn(columnId: string): boolean;
|
|
35
35
|
isAutoRowGroupColumnForSingle(columnId: string): boolean;
|
|
36
36
|
isAutoRowGroupColumnForMulti(columnId: string): boolean;
|
|
37
37
|
isCalculatedColumn(columnId: string): boolean;
|
|
@@ -1,34 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ColumnApiImpl = exports.isPivotGrandTotal = exports.isPivotResultColumn = exports.getFriendlyNameForPivotResultColumn = exports.generateAutoRowGroupColumnForColumn = exports.generateAutoTreeSingleColumn = exports.generateAutoRowGroupSingleColumn =
|
|
3
|
+
exports.ColumnApiImpl = exports.isPivotGrandTotal = exports.isPivotResultColumn = exports.getFriendlyNameForPivotResultColumn = exports.generateAutoRowGroupColumnForColumn = exports.generateAutoTreeSingleColumn = exports.generateAutoRowGroupSingleColumn = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ApiBase_1 = require("./ApiBase");
|
|
6
6
|
const GeneralConstants = tslib_1.__importStar(require("../../Utilities/Constants/GeneralConstants"));
|
|
7
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
7
8
|
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
8
9
|
const ColumnInternalApi_1 = require("../Internal/ColumnInternalApi");
|
|
9
10
|
const normalizeLayoutModel_1 = require("../../layout-manager/src/normalizeLayoutModel");
|
|
10
11
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
|
|
11
12
|
const isPivotColumnTotal_1 = require("../../layout-manager/src/isPivotColumnTotal");
|
|
12
|
-
const isPivotAggTotalColumn_1 = require("../../layout-manager/src/isPivotAggTotalColumn");
|
|
13
|
-
function isAutoRowGroupColumn(columnId) {
|
|
14
|
-
// put this here as there might be other indicators we are not aware of
|
|
15
|
-
// perhaps with non auto groups ?
|
|
16
|
-
//https://www.ag-grid.com/javascript-grid-grouping/
|
|
17
|
-
return columnId?.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
|
|
18
|
-
}
|
|
19
|
-
exports.isAutoRowGroupColumn = isAutoRowGroupColumn;
|
|
20
|
-
// TODO AFL: consolidate this logic with LayoutManager
|
|
21
|
-
const isPivotAggregationTotalColumn = (colId, agGridApi) => {
|
|
22
|
-
if (!isPivotResultColumn(colId) || !agGridApi) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
const allPivotAggTotalColumnIds = agGridApi
|
|
26
|
-
.getPivotResultColumns()
|
|
27
|
-
.map((agColumn) => agColumn.getColDef())
|
|
28
|
-
.filter((colDef) => (0, isPivotAggTotalColumn_1.isPivotAggTotalColumn)(colDef))
|
|
29
|
-
.map((colDef) => colDef.colId);
|
|
30
|
-
return allPivotAggTotalColumnIds.includes(colId);
|
|
31
|
-
};
|
|
32
13
|
const ROW_GROUP_COLUMN_DEFAULTS = {
|
|
33
14
|
columnId: '',
|
|
34
15
|
isTreeColumn: false,
|
|
@@ -62,7 +43,7 @@ const ROW_GROUP_COLUMN_DEFAULTS = {
|
|
|
62
43
|
function generateAutoRowGroupSingleColumn() {
|
|
63
44
|
return {
|
|
64
45
|
...ROW_GROUP_COLUMN_DEFAULTS,
|
|
65
|
-
columnId: normalizeLayoutModel_1.
|
|
46
|
+
columnId: normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__SINGLE,
|
|
66
47
|
};
|
|
67
48
|
}
|
|
68
49
|
exports.generateAutoRowGroupSingleColumn = generateAutoRowGroupSingleColumn;
|
|
@@ -70,7 +51,7 @@ const TREE_COLUMN_FRIENDLY_NAME = '[Tree Column]';
|
|
|
70
51
|
function generateAutoTreeSingleColumn() {
|
|
71
52
|
return {
|
|
72
53
|
...ROW_GROUP_COLUMN_DEFAULTS,
|
|
73
|
-
columnId: normalizeLayoutModel_1.
|
|
54
|
+
columnId: normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__SINGLE,
|
|
74
55
|
isTreeColumn: true,
|
|
75
56
|
friendlyName: TREE_COLUMN_FRIENDLY_NAME,
|
|
76
57
|
};
|
|
@@ -79,7 +60,7 @@ exports.generateAutoTreeSingleColumn = generateAutoTreeSingleColumn;
|
|
|
79
60
|
function generateAutoRowGroupColumnForColumn(column) {
|
|
80
61
|
return {
|
|
81
62
|
...ROW_GROUP_COLUMN_DEFAULTS,
|
|
82
|
-
columnId: normalizeLayoutModel_1.
|
|
63
|
+
columnId: normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX + column.columnId,
|
|
83
64
|
friendlyName: column.friendlyName,
|
|
84
65
|
dataType: column.dataType,
|
|
85
66
|
};
|
|
@@ -186,17 +167,20 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
186
167
|
showColumn(columnId) {
|
|
187
168
|
this._adaptable.showColumn(columnId);
|
|
188
169
|
}
|
|
189
|
-
isAutoRowGroupColumn(columnId) {
|
|
190
|
-
return isAutoRowGroupColumn(columnId);
|
|
191
|
-
}
|
|
192
170
|
isPivotResultColumn(columnId) {
|
|
193
171
|
return isPivotResultColumn(columnId) || isPivotGrandTotal(columnId);
|
|
194
172
|
}
|
|
173
|
+
isSelectionColumn(columnId) {
|
|
174
|
+
return columnId === GeneralConstants_1.AG_GRID_SELECTION_COLUMN;
|
|
175
|
+
}
|
|
176
|
+
isAutoRowGroupColumn(columnId) {
|
|
177
|
+
return (this.isAutoRowGroupColumnForSingle(columnId) || this.isAutoRowGroupColumnForMulti(columnId));
|
|
178
|
+
}
|
|
195
179
|
isAutoRowGroupColumnForSingle(columnId) {
|
|
196
|
-
return columnId === normalizeLayoutModel_1.
|
|
180
|
+
return columnId === normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__SINGLE;
|
|
197
181
|
}
|
|
198
182
|
isAutoRowGroupColumnForMulti(columnId) {
|
|
199
|
-
return columnId.startsWith(normalizeLayoutModel_1.
|
|
183
|
+
return columnId.startsWith(normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX);
|
|
200
184
|
}
|
|
201
185
|
isCalculatedColumn(columnId) {
|
|
202
186
|
return (this.getCalculatedColumnApi()
|
|
@@ -274,7 +258,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
274
258
|
return column?.dataType === 'date' || column?.dataType === 'dateString';
|
|
275
259
|
}
|
|
276
260
|
getColumnDataTypeForColumnId(columnId) {
|
|
277
|
-
const column = this.getColumnWithColumnId(columnId);
|
|
261
|
+
const column = this.getColumnWithColumnId(columnId);
|
|
278
262
|
if (!column) {
|
|
279
263
|
return undefined;
|
|
280
264
|
}
|
|
@@ -304,7 +288,7 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
|
|
|
304
288
|
if (currentLayout?.RowGroupedColumns?.length) {
|
|
305
289
|
const groupedByLabel = this.isAutoRowGroupColumnForSingle(columnId)
|
|
306
290
|
? currentLayout.RowGroupedColumns.map((colId) => this.getFriendlyNameForColumnId(colId, layout)).join(', ')
|
|
307
|
-
: this.getFriendlyNameForColumnId(columnId.replace(normalizeLayoutModel_1.
|
|
291
|
+
: this.getFriendlyNameForColumnId(columnId.replace(normalizeLayoutModel_1.AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, ''), layout);
|
|
308
292
|
result = `[Grouped Column: ${groupedByLabel}]`;
|
|
309
293
|
return result;
|
|
310
294
|
}
|
|
@@ -2,7 +2,7 @@ import { ExportApi } from '../ExportApi';
|
|
|
2
2
|
import { ExportState, Report, ReportFormatType, ReportNameType, SystemReportFormat, SystemReportName } from '../../AdaptableState/ExportState';
|
|
3
3
|
import { ApiBase } from './ApiBase';
|
|
4
4
|
import { AdaptableForm } from '../../AdaptableState/Common/AdaptableForm';
|
|
5
|
-
import { CustomDestination, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
|
|
5
|
+
import { CustomDestination, CustomExportParams, ExportDestinationType, ExportFormContext, ExportResultData, SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
|
|
6
6
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
7
7
|
import { ExportInternalApi } from '../Internal/ExportInternalApi';
|
|
8
8
|
import { AdaptableColumn } from '../../types';
|
|
@@ -10,7 +10,8 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
|
|
|
10
10
|
internalApi: ExportInternalApi;
|
|
11
11
|
constructor(_adaptable: IAdaptable);
|
|
12
12
|
getExportState(): ExportState;
|
|
13
|
-
getCurrentReportName():
|
|
13
|
+
getCurrentReportName(): ReportNameType;
|
|
14
|
+
getCurrentReportFormat(): ReportFormatType | undefined;
|
|
14
15
|
getCurrentReport(): Report;
|
|
15
16
|
getReportByName(reportName: string): Report | undefined;
|
|
16
17
|
getReportById(id: Report['Uuid']): Report;
|
|
@@ -36,7 +37,13 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
|
|
|
36
37
|
getCustomReports(): Report[];
|
|
37
38
|
isColumnExportable(adaptableColumn: AdaptableColumn): boolean;
|
|
38
39
|
getSupportedExportDestinations(reportFormat: ReportFormatType): ExportDestinationType[];
|
|
39
|
-
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType
|
|
40
|
-
|
|
40
|
+
exportReport(reportName: ReportNameType, format: ReportFormatType, destination?: ExportDestinationType, config?: {
|
|
41
|
+
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
42
|
+
showProgressIndicator?: boolean;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
getReportData(reportName: ReportNameType, format: ReportFormatType, config?: {
|
|
45
|
+
exportParams?: (defaultExportParams: CustomExportParams) => CustomExportParams;
|
|
46
|
+
showProgressIndicator?: boolean;
|
|
47
|
+
}): Promise<ExportResultData>;
|
|
41
48
|
private processExport;
|
|
42
49
|
}
|
|
@@ -18,6 +18,9 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
18
18
|
getCurrentReportName() {
|
|
19
19
|
return this.getExportState().CurrentReport;
|
|
20
20
|
}
|
|
21
|
+
getCurrentReportFormat() {
|
|
22
|
+
return this.getExportState().CurrentFormat;
|
|
23
|
+
}
|
|
21
24
|
getCurrentReport() {
|
|
22
25
|
const reportName = this.getCurrentReportName();
|
|
23
26
|
return this.getReportByName(reportName);
|
|
@@ -42,20 +45,57 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
42
45
|
return this.getCustomDestinations().find((destination) => destination.name === destinationName);
|
|
43
46
|
}
|
|
44
47
|
getAvailableSystemReports() {
|
|
45
|
-
|
|
48
|
+
const systemReportNamesOption = this.getExportOptions().systemReportNames;
|
|
49
|
+
const reportNames = typeof systemReportNamesOption === 'function'
|
|
50
|
+
? systemReportNamesOption({
|
|
51
|
+
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
52
|
+
defaultSystemReportNames: GeneralConstants_1.SYSTEM_REPORT_NAMES,
|
|
53
|
+
currentLayoutName: this.getLayoutApi().getCurrentLayoutName(),
|
|
54
|
+
})
|
|
55
|
+
: systemReportNamesOption;
|
|
56
|
+
return reportNames.filter((s) => this.internalApi.isSystemReportActive(s));
|
|
46
57
|
}
|
|
47
58
|
getAvailableSystemFormats() {
|
|
48
|
-
const
|
|
49
|
-
|
|
59
|
+
const systemReportFormatsOption = this.getExportOptions().systemReportFormats;
|
|
60
|
+
const reportFormats = typeof systemReportFormatsOption === 'function'
|
|
61
|
+
? systemReportFormatsOption({
|
|
62
|
+
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
63
|
+
defaultSystemReportFormats: GeneralConstants_1.SYSTEM_REPORT_FORMATS,
|
|
64
|
+
currentLayoutName: this.getLayoutApi().getCurrentLayoutName(),
|
|
65
|
+
currentReportName: this.getExportApi().getCurrentReportName(),
|
|
66
|
+
})
|
|
67
|
+
: systemReportFormatsOption;
|
|
68
|
+
return reportFormats.filter((format) => {
|
|
50
69
|
// JSON format doesn't support Master Detail Grid
|
|
51
70
|
if (this.getGridApi().isMasterDetailGrid()) {
|
|
52
71
|
return format !== 'JSON';
|
|
53
72
|
}
|
|
73
|
+
// PivotLayout & AllData can't be exported as VisualExcel
|
|
74
|
+
if (this.getExportApi().getCurrentReportName() === GeneralConstants_1.ALL_DATA_REPORT &&
|
|
75
|
+
this.getLayoutApi().isCurrentLayoutPivot()) {
|
|
76
|
+
return format !== 'VisualExcel';
|
|
77
|
+
}
|
|
54
78
|
return true;
|
|
55
79
|
});
|
|
56
80
|
}
|
|
57
81
|
getAvailableSystemDestinations() {
|
|
58
|
-
|
|
82
|
+
const systemExportDestinationsOption = this.getExportOptions().systemExportDestinations;
|
|
83
|
+
const systemExportDestinations = typeof systemExportDestinationsOption === 'function'
|
|
84
|
+
? systemExportDestinationsOption({
|
|
85
|
+
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
86
|
+
defaultSystemExportDestinations: GeneralConstants_1.SYSTEM_EXPORT_DESTINATIONS,
|
|
87
|
+
currentLayoutName: this.getLayoutApi().getCurrentLayoutName(),
|
|
88
|
+
currentReportName: this.getExportApi().getCurrentReportName(),
|
|
89
|
+
currentReportFormat: this.getExportApi().getCurrentReportFormat(),
|
|
90
|
+
})
|
|
91
|
+
: systemExportDestinationsOption;
|
|
92
|
+
return systemExportDestinations.filter((destination) => {
|
|
93
|
+
// VisualExcel format can't be exported to custom destinations
|
|
94
|
+
if (this.getExportApi().getCurrentReportFormat() === GeneralConstants_1.VISUAL_EXCEL_FORMAT_REPORT) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return true;
|
|
98
|
+
});
|
|
59
99
|
}
|
|
60
100
|
getAllExportDestinations() {
|
|
61
101
|
const destinationItems = [
|
|
@@ -143,7 +183,7 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
143
183
|
return true;
|
|
144
184
|
});
|
|
145
185
|
}
|
|
146
|
-
async exportReport(reportName, format, destination = 'Download') {
|
|
186
|
+
async exportReport(reportName, format, destination = 'Download', config) {
|
|
147
187
|
let report = this.getReportByName(reportName);
|
|
148
188
|
if (!this.checkItemExists(report, reportName, 'Report')) {
|
|
149
189
|
return;
|
|
@@ -161,7 +201,8 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
161
201
|
report,
|
|
162
202
|
format,
|
|
163
203
|
destination,
|
|
164
|
-
showProgressIndicator: true,
|
|
204
|
+
showProgressIndicator: config?.showProgressIndicator === false ? false : true,
|
|
205
|
+
customExportParams: config?.exportParams,
|
|
165
206
|
});
|
|
166
207
|
if (!exportedReport) {
|
|
167
208
|
// for destination 'Download' and format 'Excel', 'VisualExcel' or 'Csv', AG Grid handles the download as well
|
|
@@ -180,7 +221,7 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
180
221
|
}
|
|
181
222
|
this.logInfo(`Finished Export of ${reportName} in format ${format} to ${destination}`);
|
|
182
223
|
}
|
|
183
|
-
async getReportData(reportName, format) {
|
|
224
|
+
async getReportData(reportName, format, config) {
|
|
184
225
|
let report = this.getReportByName(reportName);
|
|
185
226
|
if (!this.checkItemExists(report, reportName, 'Report')) {
|
|
186
227
|
return;
|
|
@@ -197,7 +238,8 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
|
|
|
197
238
|
report,
|
|
198
239
|
format,
|
|
199
240
|
destination: 'Clipboard',
|
|
200
|
-
showProgressIndicator: false,
|
|
241
|
+
showProgressIndicator: config?.showProgressIndicator === false ? false : true,
|
|
242
|
+
customExportParams: config?.exportParams,
|
|
201
243
|
});
|
|
202
244
|
}
|
|
203
245
|
this.logInfo(`Finished getting Report Data for ${reportName} in format ${format}`);
|
|
@@ -119,6 +119,17 @@ const tableLayoutToTableLayoutModel = (tableLayout) => {
|
|
|
119
119
|
Values: tableLayout.RowGroupValues.ExceptionGroupKeys || [],
|
|
120
120
|
}
|
|
121
121
|
: undefined,
|
|
122
|
+
ColumnGroupValues: tableLayout.ColumnGroupValues
|
|
123
|
+
? tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
|
|
124
|
+
tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
|
|
125
|
+
? {
|
|
126
|
+
ColumnGroupDisplay: tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
|
|
127
|
+
}
|
|
128
|
+
: {
|
|
129
|
+
ColumnGroupDisplay: tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
|
|
130
|
+
Values: tableLayout.ColumnGroupValues.ExceptionGroupKeys || [],
|
|
131
|
+
}
|
|
132
|
+
: undefined,
|
|
122
133
|
TableAggregationColumns: TableAggregationColumns,
|
|
123
134
|
GrandTotalRow: tableLayout.GrandTotalRow,
|
|
124
135
|
});
|
|
@@ -192,6 +203,17 @@ const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
|
|
|
192
203
|
Values: pivotLayout.RowGroupValues.ExceptionGroupKeys || [],
|
|
193
204
|
}
|
|
194
205
|
: undefined,
|
|
206
|
+
ColumnGroupValues: pivotLayout.ColumnGroupValues
|
|
207
|
+
? pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
|
|
208
|
+
pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
|
|
209
|
+
? {
|
|
210
|
+
ColumnGroupDisplay: pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
|
|
211
|
+
}
|
|
212
|
+
: {
|
|
213
|
+
ColumnGroupDisplay: pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
|
|
214
|
+
Values: pivotLayout.ColumnGroupValues.ExceptionGroupKeys || [],
|
|
215
|
+
}
|
|
216
|
+
: undefined,
|
|
195
217
|
});
|
|
196
218
|
if (pivotLayout.ColumnFilters) {
|
|
197
219
|
result.Ignore_ColumnFilters = pivotLayout.ColumnFilters;
|
|
@@ -299,6 +321,17 @@ const tableLayoutModelToTableLayout = (layoutModel) => {
|
|
|
299
321
|
else {
|
|
300
322
|
delete tableLayout.RowGroupValues;
|
|
301
323
|
}
|
|
324
|
+
if (layoutModel.ColumnGroupValues) {
|
|
325
|
+
tableLayout.ColumnGroupValues = {
|
|
326
|
+
ColumnGroupDefaultBehavior: layoutModel.ColumnGroupValues.ColumnGroupDisplay,
|
|
327
|
+
};
|
|
328
|
+
if ((layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'collapsed' ||
|
|
329
|
+
layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'expanded') &&
|
|
330
|
+
layoutModel.ColumnGroupValues.Values) {
|
|
331
|
+
// @ts-ignore
|
|
332
|
+
tableLayout.ColumnGroupValues.ExceptionGroupKeys = layoutModel.ColumnGroupValues.Values;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
302
335
|
if (layoutModel.TableAggregationColumns) {
|
|
303
336
|
tableLayout.TableAggregationColumns = layoutModel.TableAggregationColumns.map(({ ColumnId, AggFunc }) => {
|
|
304
337
|
return {
|
|
@@ -419,6 +452,17 @@ const pivotLayoutModelToPivotLayout = (layoutModel) => {
|
|
|
419
452
|
else {
|
|
420
453
|
delete pivotLayout.PivotAggregationColumns;
|
|
421
454
|
}
|
|
455
|
+
if (layoutModel.ColumnGroupValues) {
|
|
456
|
+
pivotLayout.ColumnGroupValues = {
|
|
457
|
+
ColumnGroupDefaultBehavior: layoutModel.ColumnGroupValues.ColumnGroupDisplay,
|
|
458
|
+
};
|
|
459
|
+
if ((layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'collapsed' ||
|
|
460
|
+
layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'expanded') &&
|
|
461
|
+
layoutModel.ColumnGroupValues.Values) {
|
|
462
|
+
// @ts-ignore
|
|
463
|
+
pivotLayout.ColumnGroupValues.ExceptionGroupKeys = layoutModel.ColumnGroupValues.Values;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
422
466
|
return pivotLayout;
|
|
423
467
|
};
|
|
424
468
|
exports.pivotLayoutModelToPivotLayout = pivotLayoutModelToPivotLayout;
|
|
@@ -6,8 +6,12 @@ export declare class QuickSearchApiImpl extends ApiBase implements QuickSearchAp
|
|
|
6
6
|
getQuickSearchState(): QuickSearchState;
|
|
7
7
|
runQuickSearch(quickSearchText: string): void;
|
|
8
8
|
clearQuickSearch(): void;
|
|
9
|
+
gotoNextMatch(): void;
|
|
10
|
+
gotoPreviousMatch(): void;
|
|
9
11
|
getQuickSearchValue(): string;
|
|
10
12
|
getQuickSearchStyle(): AdaptableStyle;
|
|
13
|
+
getQuickSearchTextMatchStyle(): AdaptableStyle | undefined;
|
|
14
|
+
getQuickSearchCurrentTextMatchStyle(): AdaptableStyle | undefined;
|
|
11
15
|
setQuickSearchStyle(style: AdaptableStyle): void;
|
|
12
16
|
openQuickSearchSettingsPanel(): void;
|
|
13
17
|
showFloatingQuickSearch(): void;
|
|
@@ -16,12 +16,24 @@ class QuickSearchApiImpl extends ApiBase_1.ApiBase {
|
|
|
16
16
|
clearQuickSearch() {
|
|
17
17
|
this.dispatchAction(QuickSearchRedux.QuickSearchRun(''));
|
|
18
18
|
}
|
|
19
|
+
gotoNextMatch() {
|
|
20
|
+
this.getAdaptableApi().agGridApi.findNext();
|
|
21
|
+
}
|
|
22
|
+
gotoPreviousMatch() {
|
|
23
|
+
this.getAdaptableApi().agGridApi.findPrevious();
|
|
24
|
+
}
|
|
19
25
|
getQuickSearchValue() {
|
|
20
26
|
return this.getQuickSearchState().QuickSearchText;
|
|
21
27
|
}
|
|
22
28
|
getQuickSearchStyle() {
|
|
23
29
|
return this.getQuickSearchState().Style;
|
|
24
30
|
}
|
|
31
|
+
getQuickSearchTextMatchStyle() {
|
|
32
|
+
return this.getQuickSearchState().TextMatchStyle;
|
|
33
|
+
}
|
|
34
|
+
getQuickSearchCurrentTextMatchStyle() {
|
|
35
|
+
return this.getQuickSearchState().CurrentTextMatchStyle;
|
|
36
|
+
}
|
|
25
37
|
setQuickSearchStyle(style) {
|
|
26
38
|
this.dispatchAction(QuickSearchRedux.QuickSearchSetStyle(style));
|
|
27
39
|
}
|
|
@@ -610,7 +610,7 @@ class AlertInternalApi extends ApiBase_1.ApiBase {
|
|
|
610
610
|
const rule = alertDefinition.Rule;
|
|
611
611
|
if (rule) {
|
|
612
612
|
if (rule.Predicates) {
|
|
613
|
-
return this.getExpressionApi().internalApi.
|
|
613
|
+
return this.getExpressionApi().internalApi.shouldEvaluatePredicatesInAdaptableQL('Alert', alertDefinition, alertDefinition.Rule.Predicates);
|
|
614
614
|
}
|
|
615
615
|
else {
|
|
616
616
|
var expression = this.getExpressionForAlertRule(rule);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ApiBase } from '../Implementation/ApiBase';
|
|
2
2
|
import { CellDataChangedInfo } from '../../AdaptableState/Common/CellDataChangedInfo';
|
|
3
3
|
import { Report, ReportData, ReportFormatType, ReportNameType, SystemReportName } from '../../AdaptableState/ExportState';
|
|
4
|
-
import { CsvCell, ExcelCell, ExcelDataType
|
|
5
|
-
import { AdaptableColumn
|
|
6
|
-
import { BaseExportContext,
|
|
4
|
+
import { CsvCell, ExcelCell, ExcelDataType } from 'ag-grid-enterprise';
|
|
5
|
+
import { AdaptableColumn } from '../../AdaptableState/Common/AdaptableColumn';
|
|
6
|
+
import { BaseExportContext, ExportDestinationType, ExportResultData, ProcessExportContext } from '../../AdaptableOptions/ExportOptions';
|
|
7
7
|
import { ExportProcessData } from '../../agGrid/AgGridExportAdapter';
|
|
8
8
|
export declare class ExportInternalApi extends ApiBase {
|
|
9
9
|
/**
|
|
@@ -14,7 +14,6 @@ export declare class ExportInternalApi extends ApiBase {
|
|
|
14
14
|
setExportInProgress(reportName: ReportNameType, reportFormat: ReportFormatType, exportDestination: ExportDestinationType): void;
|
|
15
15
|
setExportComplete(): void;
|
|
16
16
|
isVisualDataExportInProgress(): boolean;
|
|
17
|
-
getCellExportFormatType(column: AdaptableColumn, columnDataType: AdaptableColumnDataType): DataFormatType;
|
|
18
17
|
createSystemReport(systemReportName: SystemReportName): Report;
|
|
19
18
|
isSystemReport(reportName: ReportNameType): boolean;
|
|
20
19
|
isSystemDestination(destination: ExportDestinationType): boolean;
|
|
@@ -24,11 +23,7 @@ export declare class ExportInternalApi extends ApiBase {
|
|
|
24
23
|
getReportExpressionDescription(report: Report, cols: AdaptableColumn[]): string;
|
|
25
24
|
convertReportDataToArray(reportData: ReportData): any[][];
|
|
26
25
|
publishLiveLiveDataChangedEvent(reportDestination: 'ipushpull' | 'OpenFin', liveDataTrigger: 'Connected' | 'Disconnected' | 'SnapshotSent' | 'LiveDataStarted' | 'LiveDataStopped' | 'LiveDataUpdated', liveReport?: any): void;
|
|
27
|
-
getCellExportValueFromRowNode(rowNode: IRowNode, columnId: string, isVisualReport?: boolean): any;
|
|
28
|
-
getCellExportValueFromRawValue(rowNode: IRowNode, cellRawValue: any, columnId: string, isVisualReport?: boolean): any;
|
|
29
26
|
getReportFileName(reportName: string, reportFormat: ReportFormatType, destination: ExportDestinationType): string;
|
|
30
|
-
private getCustomExportDateFormat;
|
|
31
|
-
private getCellExportValueFromRawValueByType;
|
|
32
27
|
sendReportToDestination(reportResult: ExportResultData, report: Report, format: ReportFormatType, destination: ExportDestinationType): void;
|
|
33
28
|
private sendReportToCustomDestination;
|
|
34
29
|
buildBaseExportContext(reportName: ReportNameType, reportFormat: ReportFormatType, exportDestination?: ExportDestinationType): BaseExportContext;
|
|
@@ -7,7 +7,7 @@ const ag_grid_enterprise_1 = require("ag-grid-enterprise");
|
|
|
7
7
|
const Uuid_1 = require("../../AdaptableState/Uuid");
|
|
8
8
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
9
9
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
|
|
10
|
-
const FormatHelper_1 =
|
|
10
|
+
const FormatHelper_1 = require("../../Utilities/Helpers/FormatHelper");
|
|
11
11
|
const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
|
|
12
12
|
const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
|
|
13
13
|
const InternalRedux_1 = require("../../Redux/ActionsReducers/InternalRedux");
|
|
@@ -86,43 +86,6 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
|
|
|
86
86
|
isVisualDataExportInProgress() {
|
|
87
87
|
return this.getAdaptableState().Internal.Export.inProgress?.reportFormat === 'VisualExcel';
|
|
88
88
|
}
|
|
89
|
-
getCellExportFormatType(column, columnDataType) {
|
|
90
|
-
const exportOptions = this.getExportOptions();
|
|
91
|
-
const exportDataFormat = exportOptions.exportDataFormat;
|
|
92
|
-
// First check if a function was provided and return the result
|
|
93
|
-
if (exportDataFormat != null && typeof exportDataFormat === 'function') {
|
|
94
|
-
const context = {
|
|
95
|
-
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
96
|
-
column: column,
|
|
97
|
-
};
|
|
98
|
-
return exportDataFormat(context);
|
|
99
|
-
}
|
|
100
|
-
// Next Check if a "hard-coded" value has been provided and return that
|
|
101
|
-
if (exportDataFormat === 'rawValue') {
|
|
102
|
-
return 'rawValue';
|
|
103
|
-
}
|
|
104
|
-
if (exportDataFormat === 'formattedValue') {
|
|
105
|
-
return 'formattedValue';
|
|
106
|
-
}
|
|
107
|
-
// Finally test if a DataType object has been provided and return the relevant property
|
|
108
|
-
const dataFormatDataType = exportDataFormat;
|
|
109
|
-
if (dataFormatDataType) {
|
|
110
|
-
// format is customized based on column data type
|
|
111
|
-
switch (columnDataType) {
|
|
112
|
-
case 'text':
|
|
113
|
-
return dataFormatDataType.text;
|
|
114
|
-
case 'number':
|
|
115
|
-
return dataFormatDataType.number;
|
|
116
|
-
case 'date':
|
|
117
|
-
case 'dateString':
|
|
118
|
-
return dataFormatDataType.date;
|
|
119
|
-
default:
|
|
120
|
-
// default to rawValue for all other column types
|
|
121
|
-
return 'rawValue';
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return 'rawValue';
|
|
125
|
-
}
|
|
126
89
|
createSystemReport(systemReportName) {
|
|
127
90
|
switch (systemReportName) {
|
|
128
91
|
case GeneralConstants_1.ALL_DATA_REPORT:
|
|
@@ -226,31 +189,6 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
|
|
|
226
189
|
};
|
|
227
190
|
this.getAdaptableApi().eventApi.emit('LiveDataChanged', liveDataChangedInfo);
|
|
228
191
|
}
|
|
229
|
-
getCellExportValueFromRowNode(rowNode, columnId, isVisualReport) {
|
|
230
|
-
return this.getCellExportValueFromRawValue(rowNode, this.getAdaptableApi().gridApi.getRawValueFromRowNode(rowNode, columnId), columnId, isVisualReport);
|
|
231
|
-
}
|
|
232
|
-
getCellExportValueFromRawValue(rowNode, cellRawValue, columnId, isVisualReport) {
|
|
233
|
-
if (StringExtensions_1.default.IsNullOrEmpty(cellRawValue)) {
|
|
234
|
-
return cellRawValue;
|
|
235
|
-
}
|
|
236
|
-
const column = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
|
|
237
|
-
const columnDataType = column.dataType;
|
|
238
|
-
// 1. if it is a VisualExcel report format, we always ONLY send the formatted value and ignore all other properties
|
|
239
|
-
if (isVisualReport) {
|
|
240
|
-
return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, 'formattedValue');
|
|
241
|
-
}
|
|
242
|
-
const isDateColumn = columnDataType === 'date' || columnDataType === 'dateString';
|
|
243
|
-
// 2. if this is a date column and there is a custom export date format provided, that will next take precedence
|
|
244
|
-
if (isDateColumn && !!this.getCustomExportDateFormat()) {
|
|
245
|
-
const exportDateFormat = this.getCustomExportDateFormat();
|
|
246
|
-
return FormatHelper_1.default.DateFormatter(cellRawValue, {
|
|
247
|
-
Pattern: exportDateFormat,
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
// 3. in all other cases check the general export format types
|
|
251
|
-
const cellExportFormat = this.getAdaptableApi().exportApi.internalApi.getCellExportFormatType(column, columnDataType);
|
|
252
|
-
return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, cellExportFormat);
|
|
253
|
-
}
|
|
254
192
|
getReportFileName(reportName, reportFormat, destination) {
|
|
255
193
|
let fileName = StringExtensions_1.default.ReplaceEmptySpacesWithUnderscore(`${reportName}-${reportFormat}`);
|
|
256
194
|
const reportFilename = this.getAdaptableApi().optionsApi.getExportOptions().reportFilename;
|
|
@@ -270,17 +208,6 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
|
|
|
270
208
|
}
|
|
271
209
|
return fileName;
|
|
272
210
|
}
|
|
273
|
-
getCustomExportDateFormat() {
|
|
274
|
-
return this.getAdaptableApi().optionsApi.getExportOptions().exportDateFormat;
|
|
275
|
-
}
|
|
276
|
-
getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId,
|
|
277
|
-
// default to rawValue if, for some reason, the configs provide invalid values
|
|
278
|
-
type = 'rawValue') {
|
|
279
|
-
return type === 'rawValue'
|
|
280
|
-
? cellRawValue
|
|
281
|
-
: // type === formattedValue
|
|
282
|
-
this.getAdaptableApi().gridApi.getDisplayValueFromRawValue(rowNode, columnId, cellRawValue);
|
|
283
|
-
}
|
|
284
211
|
sendReportToDestination(reportResult, report, format, destination) {
|
|
285
212
|
if (!reportResult?.data) {
|
|
286
213
|
this.logWarn(`No report result to send to destination for report '${report.Name}, format '${format}' and destination '${destination}'`);
|
|
@@ -9,7 +9,7 @@ export declare class ExpressionInternalApi extends ApiBase {
|
|
|
9
9
|
*/
|
|
10
10
|
isColumnReferencedInExpression(columnId: string, expression: string): boolean;
|
|
11
11
|
evaluateExpressionInAdaptableQL(module: AdaptableQLModule, object?: AdaptableObject, expression?: string): boolean;
|
|
12
|
-
|
|
12
|
+
shouldEvaluatePredicatesInAdaptableQL(module: AdaptableQLModule, object?: AdaptableObject, predicates?: AdaptablePredicate[]): boolean;
|
|
13
13
|
private getFieldsFromOptions;
|
|
14
14
|
getAvailableFields(data?: Record<string, any>): AdaptableField[];
|
|
15
15
|
getFieldType(field: string): AdaptableField['dataType'];
|
|
@@ -34,7 +34,7 @@ class ExpressionInternalApi extends ApiBase_1.ApiBase {
|
|
|
34
34
|
}
|
|
35
35
|
return !evaluateExpressionExternallyFn(context);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
shouldEvaluatePredicatesInAdaptableQL(module, object, predicates) {
|
|
38
38
|
const evaluateExpressionExternallyFn = this.getExpressionOptions()?.evaluateAdaptableQLExternally;
|
|
39
39
|
if (typeof evaluateExpressionExternallyFn !== 'function') {
|
|
40
40
|
return true;
|
|
@@ -54,37 +54,6 @@ class ExpressionInternalApi extends ApiBase_1.ApiBase {
|
|
|
54
54
|
}
|
|
55
55
|
return !evaluateExpressionExternallyFn(context);
|
|
56
56
|
}
|
|
57
|
-
// Used later, when we extend to support inferring fields from data
|
|
58
|
-
// private getFieldsFromData<T extends Record<string, any>>(data: T): string[] {
|
|
59
|
-
// if (!data) {
|
|
60
|
-
// return [];
|
|
61
|
-
// }
|
|
62
|
-
// if (typeof data !== 'object' || Number.isNaN(data)) {
|
|
63
|
-
// return [];
|
|
64
|
-
// }
|
|
65
|
-
// const keys: string[] = [];
|
|
66
|
-
// for (const key in Object.keys(data)) {
|
|
67
|
-
// const candidate = data[key];
|
|
68
|
-
// if (
|
|
69
|
-
// typeof candidate === 'number' ||
|
|
70
|
-
// typeof candidate === 'string' ||
|
|
71
|
-
// typeof candidate === 'boolean' ||
|
|
72
|
-
// candidate instanceof Date
|
|
73
|
-
// ) {
|
|
74
|
-
// keys.push(key);
|
|
75
|
-
// continue;
|
|
76
|
-
// }
|
|
77
|
-
// // no support for arrays
|
|
78
|
-
// // for objects we go one level deep
|
|
79
|
-
// if (typeof candidate === 'object' && candidate !== null && !Array.isArray(candidate)) {
|
|
80
|
-
// const childKeys = this.getFieldsFromData(candidate);
|
|
81
|
-
// for (const childKey of childKeys) {
|
|
82
|
-
// keys.push(`${key}.${childKey}`);
|
|
83
|
-
// }
|
|
84
|
-
// }
|
|
85
|
-
// }
|
|
86
|
-
// return keys;
|
|
87
|
-
// }
|
|
88
57
|
getFieldsFromOptions() {
|
|
89
58
|
const fields = this.getExpressionOptions().fields;
|
|
90
59
|
if (fields != null && typeof fields === 'function') {
|