@adaptabletools/adaptable 20.1.7 → 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.
Files changed (66) hide show
  1. package/base.css +27 -0
  2. package/base.css.map +1 -1
  3. package/index.css +22 -0
  4. package/index.css.map +1 -1
  5. package/package.json +2 -2
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  7. package/src/AdaptableOptions/DefaultAdaptableOptions.js +2 -1
  8. package/src/AdaptableOptions/ExportOptions.d.ts +91 -8
  9. package/src/AdaptableOptions/QuickSearchOptions.d.ts +1 -6
  10. package/src/AdaptableState/FormatColumnState.d.ts +8 -0
  11. package/src/AdaptableState/LayoutState.d.ts +15 -2
  12. package/src/AdaptableState/QuickSearchState.d.ts +8 -0
  13. package/src/Api/ColumnApi.d.ts +5 -0
  14. package/src/Api/ExportApi.d.ts +23 -7
  15. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -2
  16. package/src/Api/Implementation/ColumnApiImpl.js +15 -30
  17. package/src/Api/Implementation/ExportApiImpl.d.ts +11 -4
  18. package/src/Api/Implementation/ExportApiImpl.js +51 -9
  19. package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -0
  20. package/src/Api/Implementation/LayoutApiImpl.js +9 -0
  21. package/src/Api/Implementation/LayoutHelpers.js +44 -0
  22. package/src/Api/Implementation/QuickSearchApiImpl.d.ts +4 -0
  23. package/src/Api/Implementation/QuickSearchApiImpl.js +12 -0
  24. package/src/Api/Internal/AlertInternalApi.js +1 -1
  25. package/src/Api/Internal/ExportInternalApi.d.ts +3 -8
  26. package/src/Api/Internal/ExportInternalApi.js +1 -74
  27. package/src/Api/Internal/ExpressionInternalApi.d.ts +1 -1
  28. package/src/Api/Internal/ExpressionInternalApi.js +1 -32
  29. package/src/Api/Internal/FormatColumnInternalApi.d.ts +2 -1
  30. package/src/Api/Internal/FormatColumnInternalApi.js +62 -0
  31. package/src/Api/LayoutApi.d.ts +6 -2
  32. package/src/Api/QuickSearchApi.d.ts +16 -0
  33. package/src/Redux/Store/AdaptableStore.js +3 -2
  34. package/src/Utilities/Constants/GeneralConstants.js +2 -1
  35. package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -0
  36. package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -0
  37. package/src/View/Dashboard/Dashboard.js +2 -4
  38. package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
  39. package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +2 -2
  40. package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +6 -1
  41. package/src/View/Layout/Wizard/sections/RowGroupingSection.d.ts +4 -0
  42. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +22 -19
  43. package/src/View/QuickSearch/QuickSearchInput.js +6 -1
  44. package/src/View/QuickSearch/QuickSearchPopup.js +2 -3
  45. package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
  46. package/src/agGrid/AdaptableAgGrid.js +123 -44
  47. package/src/agGrid/AgGridAdapter.d.ts +4 -1
  48. package/src/agGrid/AgGridAdapter.js +90 -13
  49. package/src/agGrid/AgGridColumnAdapter.d.ts +4 -0
  50. package/src/agGrid/AgGridColumnAdapter.js +144 -37
  51. package/src/agGrid/AgGridExportAdapter.d.ts +6 -1
  52. package/src/agGrid/AgGridExportAdapter.js +110 -17
  53. package/src/agGrid/FloatingFilterWrapper.js +30 -4
  54. package/src/env.js +2 -2
  55. package/src/layout-manager/src/LayoutManagerModel.d.ts +16 -2
  56. package/src/layout-manager/src/index.d.ts +1 -1
  57. package/src/layout-manager/src/index.js +135 -20
  58. package/src/layout-manager/src/normalizeLayoutModel.d.ts +2 -4
  59. package/src/layout-manager/src/normalizeLayoutModel.js +12 -16
  60. package/src/layout-manager/src/simplifyLayoutModel.js +15 -3
  61. package/src/metamodel/adaptable.metamodel.d.ts +71 -0
  62. package/src/metamodel/adaptable.metamodel.js +1 -1
  63. package/src/types.d.ts +1 -1
  64. package/tsconfig.esm.tsbuildinfo +1 -1
  65. package/src/Utilities/buildSortedColumnStateForLayout.d.ts +0 -7
  66. package/src/Utilities/buildSortedColumnStateForLayout.js +0 -131
@@ -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(): string;
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: string): Report | undefined;
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): Promise<void>;
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
- getReportData(reportName: ReportNameType, format: ReportFormatType): Promise<ExportResultData>;
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,29 +1,11 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import * as GeneralConstants from '../../Utilities/Constants/GeneralConstants';
3
+ import { AG_GRID_SELECTION_COLUMN } from '../../Utilities/Constants/GeneralConstants';
3
4
  import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
4
5
  import { ColumnInternalApi } from '../Internal/ColumnInternalApi';
5
- import { GROUP_COLUMN_ID__MULTI_PREFIX, GROUP_COLUMN_ID__SINGLE, } from '../../layout-manager/src/normalizeLayoutModel';
6
+ import { AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, AUTO_GROUP_COLUMN_ID__SINGLE, } from '../../layout-manager/src/normalizeLayoutModel';
6
7
  import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
7
8
  import { isPivotColumnTotal } from '../../layout-manager/src/isPivotColumnTotal';
8
- import { isPivotAggTotalColumn } from '../../layout-manager/src/isPivotAggTotalColumn';
9
- export function isAutoRowGroupColumn(columnId) {
10
- // put this here as there might be other indicators we are not aware of
11
- // perhaps with non auto groups ?
12
- //https://www.ag-grid.com/javascript-grid-grouping/
13
- return columnId?.startsWith(GeneralConstants.AG_GRID_GROUPED_COLUMN);
14
- }
15
- // TODO AFL: consolidate this logic with LayoutManager
16
- const isPivotAggregationTotalColumn = (colId, agGridApi) => {
17
- if (!isPivotResultColumn(colId) || !agGridApi) {
18
- return false;
19
- }
20
- const allPivotAggTotalColumnIds = agGridApi
21
- .getPivotResultColumns()
22
- .map((agColumn) => agColumn.getColDef())
23
- .filter((colDef) => isPivotAggTotalColumn(colDef))
24
- .map((colDef) => colDef.colId);
25
- return allPivotAggTotalColumnIds.includes(colId);
26
- };
27
9
  const ROW_GROUP_COLUMN_DEFAULTS = {
28
10
  columnId: '',
29
11
  isTreeColumn: false,
@@ -57,14 +39,14 @@ const ROW_GROUP_COLUMN_DEFAULTS = {
57
39
  export function generateAutoRowGroupSingleColumn() {
58
40
  return {
59
41
  ...ROW_GROUP_COLUMN_DEFAULTS,
60
- columnId: GROUP_COLUMN_ID__SINGLE,
42
+ columnId: AUTO_GROUP_COLUMN_ID__SINGLE,
61
43
  };
62
44
  }
63
45
  const TREE_COLUMN_FRIENDLY_NAME = '[Tree Column]';
64
46
  export function generateAutoTreeSingleColumn() {
65
47
  return {
66
48
  ...ROW_GROUP_COLUMN_DEFAULTS,
67
- columnId: GROUP_COLUMN_ID__SINGLE,
49
+ columnId: AUTO_GROUP_COLUMN_ID__SINGLE,
68
50
  isTreeColumn: true,
69
51
  friendlyName: TREE_COLUMN_FRIENDLY_NAME,
70
52
  };
@@ -72,7 +54,7 @@ export function generateAutoTreeSingleColumn() {
72
54
  export function generateAutoRowGroupColumnForColumn(column) {
73
55
  return {
74
56
  ...ROW_GROUP_COLUMN_DEFAULTS,
75
- columnId: GROUP_COLUMN_ID__MULTI_PREFIX + column.columnId,
57
+ columnId: AUTO_GROUP_COLUMN_ID__MULTI_PREFIX + column.columnId,
76
58
  friendlyName: column.friendlyName,
77
59
  dataType: column.dataType,
78
60
  };
@@ -175,17 +157,20 @@ export class ColumnApiImpl extends ApiBase {
175
157
  showColumn(columnId) {
176
158
  this._adaptable.showColumn(columnId);
177
159
  }
178
- isAutoRowGroupColumn(columnId) {
179
- return isAutoRowGroupColumn(columnId);
180
- }
181
160
  isPivotResultColumn(columnId) {
182
161
  return isPivotResultColumn(columnId) || isPivotGrandTotal(columnId);
183
162
  }
163
+ isSelectionColumn(columnId) {
164
+ return columnId === AG_GRID_SELECTION_COLUMN;
165
+ }
166
+ isAutoRowGroupColumn(columnId) {
167
+ return (this.isAutoRowGroupColumnForSingle(columnId) || this.isAutoRowGroupColumnForMulti(columnId));
168
+ }
184
169
  isAutoRowGroupColumnForSingle(columnId) {
185
- return columnId === GROUP_COLUMN_ID__SINGLE;
170
+ return columnId === AUTO_GROUP_COLUMN_ID__SINGLE;
186
171
  }
187
172
  isAutoRowGroupColumnForMulti(columnId) {
188
- return columnId.startsWith(GROUP_COLUMN_ID__MULTI_PREFIX);
173
+ return columnId.startsWith(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX);
189
174
  }
190
175
  isCalculatedColumn(columnId) {
191
176
  return (this.getCalculatedColumnApi()
@@ -263,7 +248,7 @@ export class ColumnApiImpl extends ApiBase {
263
248
  return column?.dataType === 'date' || column?.dataType === 'dateString';
264
249
  }
265
250
  getColumnDataTypeForColumnId(columnId) {
266
- const column = this.getColumnWithColumnId(columnId); // this.getColumns().find(c => c.ColumnId === columnId);
251
+ const column = this.getColumnWithColumnId(columnId);
267
252
  if (!column) {
268
253
  return undefined;
269
254
  }
@@ -293,7 +278,7 @@ export class ColumnApiImpl extends ApiBase {
293
278
  if (currentLayout?.RowGroupedColumns?.length) {
294
279
  const groupedByLabel = this.isAutoRowGroupColumnForSingle(columnId)
295
280
  ? currentLayout.RowGroupedColumns.map((colId) => this.getFriendlyNameForColumnId(colId, layout)).join(', ')
296
- : this.getFriendlyNameForColumnId(columnId.replace(GROUP_COLUMN_ID__MULTI_PREFIX, ''), layout);
281
+ : this.getFriendlyNameForColumnId(columnId.replace(AUTO_GROUP_COLUMN_ID__MULTI_PREFIX, ''), layout);
297
282
  result = `[Grouped Column: ${groupedByLabel}]`;
298
283
  return result;
299
284
  }
@@ -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(): string;
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): Promise<void>;
40
- getReportData(reportName: ReportNameType, format: ReportFormatType): Promise<ExportResultData>;
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
  }
@@ -2,7 +2,7 @@ import * as ExportRedux from '../../Redux/ActionsReducers/ExportRedux';
2
2
  import { ApiBase } from './ApiBase';
3
3
  import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
4
4
  import { ExportInternalApi } from '../Internal/ExportInternalApi';
5
- import { EMPTY_STRING } from '../../Utilities/Constants/GeneralConstants';
5
+ import { ALL_DATA_REPORT, EMPTY_STRING, SYSTEM_EXPORT_DESTINATIONS, SYSTEM_REPORT_FORMATS, SYSTEM_REPORT_NAMES, VISUAL_EXCEL_FORMAT_REPORT, } from '../../Utilities/Constants/GeneralConstants';
6
6
  export class ExportApiImpl extends ApiBase {
7
7
  constructor(_adaptable) {
8
8
  super(_adaptable);
@@ -14,6 +14,9 @@ export class ExportApiImpl extends ApiBase {
14
14
  getCurrentReportName() {
15
15
  return this.getExportState().CurrentReport;
16
16
  }
17
+ getCurrentReportFormat() {
18
+ return this.getExportState().CurrentFormat;
19
+ }
17
20
  getCurrentReport() {
18
21
  const reportName = this.getCurrentReportName();
19
22
  return this.getReportByName(reportName);
@@ -38,20 +41,57 @@ export class ExportApiImpl extends ApiBase {
38
41
  return this.getCustomDestinations().find((destination) => destination.name === destinationName);
39
42
  }
40
43
  getAvailableSystemReports() {
41
- return this.getExportOptions().systemReportNames.filter((s) => this.internalApi.isSystemReportActive(s));
44
+ const systemReportNamesOption = this.getExportOptions().systemReportNames;
45
+ const reportNames = typeof systemReportNamesOption === 'function'
46
+ ? systemReportNamesOption({
47
+ ...this.getAdaptableInternalApi().buildBaseContext(),
48
+ defaultSystemReportNames: SYSTEM_REPORT_NAMES,
49
+ currentLayoutName: this.getLayoutApi().getCurrentLayoutName(),
50
+ })
51
+ : systemReportNamesOption;
52
+ return reportNames.filter((s) => this.internalApi.isSystemReportActive(s));
42
53
  }
43
54
  getAvailableSystemFormats() {
44
- const availableReportFormats = this.getExportOptions().systemReportFormats;
45
- return availableReportFormats.filter((format) => {
55
+ const systemReportFormatsOption = this.getExportOptions().systemReportFormats;
56
+ const reportFormats = typeof systemReportFormatsOption === 'function'
57
+ ? systemReportFormatsOption({
58
+ ...this.getAdaptableInternalApi().buildBaseContext(),
59
+ defaultSystemReportFormats: SYSTEM_REPORT_FORMATS,
60
+ currentLayoutName: this.getLayoutApi().getCurrentLayoutName(),
61
+ currentReportName: this.getExportApi().getCurrentReportName(),
62
+ })
63
+ : systemReportFormatsOption;
64
+ return reportFormats.filter((format) => {
46
65
  // JSON format doesn't support Master Detail Grid
47
66
  if (this.getGridApi().isMasterDetailGrid()) {
48
67
  return format !== 'JSON';
49
68
  }
69
+ // PivotLayout & AllData can't be exported as VisualExcel
70
+ if (this.getExportApi().getCurrentReportName() === ALL_DATA_REPORT &&
71
+ this.getLayoutApi().isCurrentLayoutPivot()) {
72
+ return format !== 'VisualExcel';
73
+ }
50
74
  return true;
51
75
  });
52
76
  }
53
77
  getAvailableSystemDestinations() {
54
- return this.getExportOptions().systemExportDestinations;
78
+ const systemExportDestinationsOption = this.getExportOptions().systemExportDestinations;
79
+ const systemExportDestinations = typeof systemExportDestinationsOption === 'function'
80
+ ? systemExportDestinationsOption({
81
+ ...this.getAdaptableInternalApi().buildBaseContext(),
82
+ defaultSystemExportDestinations: SYSTEM_EXPORT_DESTINATIONS,
83
+ currentLayoutName: this.getLayoutApi().getCurrentLayoutName(),
84
+ currentReportName: this.getExportApi().getCurrentReportName(),
85
+ currentReportFormat: this.getExportApi().getCurrentReportFormat(),
86
+ })
87
+ : systemExportDestinationsOption;
88
+ return systemExportDestinations.filter((destination) => {
89
+ // VisualExcel format can't be exported to custom destinations
90
+ if (this.getExportApi().getCurrentReportFormat() === VISUAL_EXCEL_FORMAT_REPORT) {
91
+ return false;
92
+ }
93
+ return true;
94
+ });
55
95
  }
56
96
  getAllExportDestinations() {
57
97
  const destinationItems = [
@@ -139,7 +179,7 @@ export class ExportApiImpl extends ApiBase {
139
179
  return true;
140
180
  });
141
181
  }
142
- async exportReport(reportName, format, destination = 'Download') {
182
+ async exportReport(reportName, format, destination = 'Download', config) {
143
183
  let report = this.getReportByName(reportName);
144
184
  if (!this.checkItemExists(report, reportName, 'Report')) {
145
185
  return;
@@ -157,7 +197,8 @@ export class ExportApiImpl extends ApiBase {
157
197
  report,
158
198
  format,
159
199
  destination,
160
- showProgressIndicator: true,
200
+ showProgressIndicator: config?.showProgressIndicator === false ? false : true,
201
+ customExportParams: config?.exportParams,
161
202
  });
162
203
  if (!exportedReport) {
163
204
  // for destination 'Download' and format 'Excel', 'VisualExcel' or 'Csv', AG Grid handles the download as well
@@ -176,7 +217,7 @@ export class ExportApiImpl extends ApiBase {
176
217
  }
177
218
  this.logInfo(`Finished Export of ${reportName} in format ${format} to ${destination}`);
178
219
  }
179
- async getReportData(reportName, format) {
220
+ async getReportData(reportName, format, config) {
180
221
  let report = this.getReportByName(reportName);
181
222
  if (!this.checkItemExists(report, reportName, 'Report')) {
182
223
  return;
@@ -193,7 +234,8 @@ export class ExportApiImpl extends ApiBase {
193
234
  report,
194
235
  format,
195
236
  destination: 'Clipboard',
196
- showProgressIndicator: false,
237
+ showProgressIndicator: config?.showProgressIndicator === false ? false : true,
238
+ customExportParams: config?.exportParams,
197
239
  });
198
240
  }
199
241
  this.logInfo(`Finished getting Report Data for ${reportName} in format ${format}`);
@@ -17,6 +17,7 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
17
17
  [key: string]: boolean;
18
18
  };
19
19
  getCurrentVisibleColumnIdsForTableLayout(): string[];
20
+ getCurrentVisibleColumnIdsForPivotLayout(): string[];
20
21
  getCurrentRowGroupsColumnIds(): string[];
21
22
  setLayout(layoutName: string): void;
22
23
  getCurrentLayout(): Layout;
@@ -43,6 +43,15 @@ export class LayoutApiImpl extends ApiBase {
43
43
  }
44
44
  return layout.TableColumns.filter((colId) => !layout.ColumnVisibility || layout.ColumnVisibility?.[colId] !== false);
45
45
  }
46
+ getCurrentVisibleColumnIdsForPivotLayout() {
47
+ const layout = this.getCurrentLayout();
48
+ if (!isPivotLayout(layout)) {
49
+ return [];
50
+ }
51
+ return this.getAgGridApi()
52
+ .getAllDisplayedColumns()
53
+ .map((col) => col.getColId());
54
+ }
46
55
  getCurrentRowGroupsColumnIds() {
47
56
  const layout = this.getCurrentLayout();
48
57
  if (isPivotLayout(layout)) {
@@ -108,6 +108,17 @@ export const tableLayoutToTableLayoutModel = (tableLayout) => {
108
108
  Values: tableLayout.RowGroupValues.ExceptionGroupKeys || [],
109
109
  }
110
110
  : undefined,
111
+ ColumnGroupValues: tableLayout.ColumnGroupValues
112
+ ? tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
113
+ tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
114
+ ? {
115
+ ColumnGroupDisplay: tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
116
+ }
117
+ : {
118
+ ColumnGroupDisplay: tableLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
119
+ Values: tableLayout.ColumnGroupValues.ExceptionGroupKeys || [],
120
+ }
121
+ : undefined,
111
122
  TableAggregationColumns: TableAggregationColumns,
112
123
  GrandTotalRow: tableLayout.GrandTotalRow,
113
124
  });
@@ -180,6 +191,17 @@ export const pivotLayoutToPivotLayoutModel = (pivotLayout) => {
180
191
  Values: pivotLayout.RowGroupValues.ExceptionGroupKeys || [],
181
192
  }
182
193
  : undefined,
194
+ ColumnGroupValues: pivotLayout.ColumnGroupValues
195
+ ? pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-expanded' ||
196
+ pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior === 'always-collapsed'
197
+ ? {
198
+ ColumnGroupDisplay: pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
199
+ }
200
+ : {
201
+ ColumnGroupDisplay: pivotLayout.ColumnGroupValues.ColumnGroupDefaultBehavior,
202
+ Values: pivotLayout.ColumnGroupValues.ExceptionGroupKeys || [],
203
+ }
204
+ : undefined,
183
205
  });
184
206
  if (pivotLayout.ColumnFilters) {
185
207
  result.Ignore_ColumnFilters = pivotLayout.ColumnFilters;
@@ -286,6 +308,17 @@ export const tableLayoutModelToTableLayout = (layoutModel) => {
286
308
  else {
287
309
  delete tableLayout.RowGroupValues;
288
310
  }
311
+ if (layoutModel.ColumnGroupValues) {
312
+ tableLayout.ColumnGroupValues = {
313
+ ColumnGroupDefaultBehavior: layoutModel.ColumnGroupValues.ColumnGroupDisplay,
314
+ };
315
+ if ((layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'collapsed' ||
316
+ layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'expanded') &&
317
+ layoutModel.ColumnGroupValues.Values) {
318
+ // @ts-ignore
319
+ tableLayout.ColumnGroupValues.ExceptionGroupKeys = layoutModel.ColumnGroupValues.Values;
320
+ }
321
+ }
289
322
  if (layoutModel.TableAggregationColumns) {
290
323
  tableLayout.TableAggregationColumns = layoutModel.TableAggregationColumns.map(({ ColumnId, AggFunc }) => {
291
324
  return {
@@ -405,6 +438,17 @@ export const pivotLayoutModelToPivotLayout = (layoutModel) => {
405
438
  else {
406
439
  delete pivotLayout.PivotAggregationColumns;
407
440
  }
441
+ if (layoutModel.ColumnGroupValues) {
442
+ pivotLayout.ColumnGroupValues = {
443
+ ColumnGroupDefaultBehavior: layoutModel.ColumnGroupValues.ColumnGroupDisplay,
444
+ };
445
+ if ((layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'collapsed' ||
446
+ layoutModel.ColumnGroupValues.ColumnGroupDisplay === 'expanded') &&
447
+ layoutModel.ColumnGroupValues.Values) {
448
+ // @ts-ignore
449
+ pivotLayout.ColumnGroupValues.ExceptionGroupKeys = layoutModel.ColumnGroupValues.Values;
450
+ }
451
+ }
408
452
  return pivotLayout;
409
453
  };
410
454
  export const isPivotLayout = (layout) => Array.isArray(layout.PivotColumns);
@@ -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;
@@ -12,12 +12,24 @@ export class QuickSearchApiImpl extends ApiBase {
12
12
  clearQuickSearch() {
13
13
  this.dispatchAction(QuickSearchRedux.QuickSearchRun(''));
14
14
  }
15
+ gotoNextMatch() {
16
+ this.getAdaptableApi().agGridApi.findNext();
17
+ }
18
+ gotoPreviousMatch() {
19
+ this.getAdaptableApi().agGridApi.findPrevious();
20
+ }
15
21
  getQuickSearchValue() {
16
22
  return this.getQuickSearchState().QuickSearchText;
17
23
  }
18
24
  getQuickSearchStyle() {
19
25
  return this.getQuickSearchState().Style;
20
26
  }
27
+ getQuickSearchTextMatchStyle() {
28
+ return this.getQuickSearchState().TextMatchStyle;
29
+ }
30
+ getQuickSearchCurrentTextMatchStyle() {
31
+ return this.getQuickSearchState().CurrentTextMatchStyle;
32
+ }
21
33
  setQuickSearchStyle(style) {
22
34
  this.dispatchAction(QuickSearchRedux.QuickSearchSetStyle(style));
23
35
  }
@@ -606,7 +606,7 @@ export class AlertInternalApi extends ApiBase {
606
606
  const rule = alertDefinition.Rule;
607
607
  if (rule) {
608
608
  if (rule.Predicates) {
609
- return this.getExpressionApi().internalApi.evaluatePredicatesInAdaptableQL('Alert', alertDefinition, alertDefinition.Rule.Predicates);
609
+ return this.getExpressionApi().internalApi.shouldEvaluatePredicatesInAdaptableQL('Alert', alertDefinition, alertDefinition.Rule.Predicates);
610
610
  }
611
611
  else {
612
612
  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, IRowNode } from 'ag-grid-enterprise';
5
- import { AdaptableColumn, AdaptableColumnDataType } from '../../AdaptableState/Common/AdaptableColumn';
6
- import { BaseExportContext, DataFormatType, ExportDestinationType, ExportResultData, ProcessExportContext } from '../../AdaptableOptions/ExportOptions';
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;
@@ -3,7 +3,7 @@ import { createGrid, } from 'ag-grid-enterprise';
3
3
  import { createUuid } from '../../AdaptableState/Uuid';
4
4
  import { ALL_DATA_REPORT, CURRENT_LAYOUT_REPORT, SELECTED_DATA_REPORT, SYSTEM_EXPORT_DESTINATIONS, SYSTEM_REPORT_NAMES, } from '../../Utilities/Constants/GeneralConstants';
5
5
  import StringExtensions from '../../Utilities/Extensions/StringExtensions';
6
- import FormatHelper, { DateFormatter } from '../../Utilities/Helpers/FormatHelper';
6
+ import { DateFormatter } from '../../Utilities/Helpers/FormatHelper';
7
7
  import Helper from '../../Utilities/Helpers/Helper';
8
8
  import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
9
9
  import { SystemExportBegin, SystemExportEnd } from '../../Redux/ActionsReducers/InternalRedux';
@@ -82,43 +82,6 @@ export class ExportInternalApi extends ApiBase {
82
82
  isVisualDataExportInProgress() {
83
83
  return this.getAdaptableState().Internal.Export.inProgress?.reportFormat === 'VisualExcel';
84
84
  }
85
- getCellExportFormatType(column, columnDataType) {
86
- const exportOptions = this.getExportOptions();
87
- const exportDataFormat = exportOptions.exportDataFormat;
88
- // First check if a function was provided and return the result
89
- if (exportDataFormat != null && typeof exportDataFormat === 'function') {
90
- const context = {
91
- ...this.getAdaptableInternalApi().buildBaseContext(),
92
- column: column,
93
- };
94
- return exportDataFormat(context);
95
- }
96
- // Next Check if a "hard-coded" value has been provided and return that
97
- if (exportDataFormat === 'rawValue') {
98
- return 'rawValue';
99
- }
100
- if (exportDataFormat === 'formattedValue') {
101
- return 'formattedValue';
102
- }
103
- // Finally test if a DataType object has been provided and return the relevant property
104
- const dataFormatDataType = exportDataFormat;
105
- if (dataFormatDataType) {
106
- // format is customized based on column data type
107
- switch (columnDataType) {
108
- case 'text':
109
- return dataFormatDataType.text;
110
- case 'number':
111
- return dataFormatDataType.number;
112
- case 'date':
113
- case 'dateString':
114
- return dataFormatDataType.date;
115
- default:
116
- // default to rawValue for all other column types
117
- return 'rawValue';
118
- }
119
- }
120
- return 'rawValue';
121
- }
122
85
  createSystemReport(systemReportName) {
123
86
  switch (systemReportName) {
124
87
  case ALL_DATA_REPORT:
@@ -222,31 +185,6 @@ export class ExportInternalApi extends ApiBase {
222
185
  };
223
186
  this.getAdaptableApi().eventApi.emit('LiveDataChanged', liveDataChangedInfo);
224
187
  }
225
- getCellExportValueFromRowNode(rowNode, columnId, isVisualReport) {
226
- return this.getCellExportValueFromRawValue(rowNode, this.getAdaptableApi().gridApi.getRawValueFromRowNode(rowNode, columnId), columnId, isVisualReport);
227
- }
228
- getCellExportValueFromRawValue(rowNode, cellRawValue, columnId, isVisualReport) {
229
- if (StringExtensions.IsNullOrEmpty(cellRawValue)) {
230
- return cellRawValue;
231
- }
232
- const column = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
233
- const columnDataType = column.dataType;
234
- // 1. if it is a VisualExcel report format, we always ONLY send the formatted value and ignore all other properties
235
- if (isVisualReport) {
236
- return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, 'formattedValue');
237
- }
238
- const isDateColumn = columnDataType === 'date' || columnDataType === 'dateString';
239
- // 2. if this is a date column and there is a custom export date format provided, that will next take precedence
240
- if (isDateColumn && !!this.getCustomExportDateFormat()) {
241
- const exportDateFormat = this.getCustomExportDateFormat();
242
- return FormatHelper.DateFormatter(cellRawValue, {
243
- Pattern: exportDateFormat,
244
- });
245
- }
246
- // 3. in all other cases check the general export format types
247
- const cellExportFormat = this.getAdaptableApi().exportApi.internalApi.getCellExportFormatType(column, columnDataType);
248
- return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, cellExportFormat);
249
- }
250
188
  getReportFileName(reportName, reportFormat, destination) {
251
189
  let fileName = StringExtensions.ReplaceEmptySpacesWithUnderscore(`${reportName}-${reportFormat}`);
252
190
  const reportFilename = this.getAdaptableApi().optionsApi.getExportOptions().reportFilename;
@@ -266,17 +204,6 @@ export class ExportInternalApi extends ApiBase {
266
204
  }
267
205
  return fileName;
268
206
  }
269
- getCustomExportDateFormat() {
270
- return this.getAdaptableApi().optionsApi.getExportOptions().exportDateFormat;
271
- }
272
- getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId,
273
- // default to rawValue if, for some reason, the configs provide invalid values
274
- type = 'rawValue') {
275
- return type === 'rawValue'
276
- ? cellRawValue
277
- : // type === formattedValue
278
- this.getAdaptableApi().gridApi.getDisplayValueFromRawValue(rowNode, columnId, cellRawValue);
279
- }
280
207
  sendReportToDestination(reportResult, report, format, destination) {
281
208
  if (!reportResult?.data) {
282
209
  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
- evaluatePredicatesInAdaptableQL(module: AdaptableQLModule, object?: AdaptableObject, predicates?: AdaptablePredicate[]): boolean;
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'];