@adaptabletools/adaptable-cjs 20.0.0-canary.2 → 20.0.0-canary.21

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 (117) hide show
  1. package/base.css +1288 -898
  2. package/base.css.map +1 -1
  3. package/index.css +428 -898
  4. package/index.css.map +1 -1
  5. package/package.json +4 -4
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -1
  7. package/src/AdaptableOptions/CellSummaryOptions.d.ts +1 -1
  8. package/src/AdaptableOptions/ContainerOptions.d.ts +0 -7
  9. package/src/AdaptableOptions/DashboardOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/DefaultAdaptableOptions.js +2 -2
  11. package/src/AdaptableOptions/EditOptions.d.ts +14 -3
  12. package/src/AdaptableOptions/ExportOptions.d.ts +11 -20
  13. package/src/AdaptableOptions/PredicateOptions.d.ts +4 -4
  14. package/src/AdaptableOptions/QuickSearchOptions.d.ts +2 -2
  15. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +7 -0
  16. package/src/Api/ExportApi.d.ts +1 -6
  17. package/src/Api/Fdc3Api.d.ts +5 -3
  18. package/src/Api/Implementation/AdaptableApiImpl.js +1 -0
  19. package/src/Api/Implementation/ColumnFilterApiImpl.js +3 -3
  20. package/src/Api/Implementation/ExportApiImpl.d.ts +1 -2
  21. package/src/Api/Implementation/ExportApiImpl.js +17 -10
  22. package/src/Api/Implementation/Fdc3ApiImpl.d.ts +3 -3
  23. package/src/Api/Implementation/Fdc3ApiImpl.js +4 -4
  24. package/src/Api/Implementation/LayoutHelpers.js +8 -27
  25. package/src/Api/Implementation/PredicateApiImpl.js +1 -1
  26. package/src/Api/Implementation/ScheduleApiImpl.js +1 -1
  27. package/src/Api/Implementation/StyledColumnApiImpl.js +1 -1
  28. package/src/Api/Implementation/ThemeApiImpl.js +3 -1
  29. package/src/Api/Internal/ActionColumnInternalApi.js +16 -19
  30. package/src/Api/Internal/AdaptableInternalApi.js +1 -1
  31. package/src/Api/Internal/ColumnFilterInternalApi.js +2 -2
  32. package/src/Api/Internal/ColumnInternalApi.js +1 -2
  33. package/src/Api/Internal/EventInternalApi.js +6 -1
  34. package/src/Api/Internal/ExportInternalApi.d.ts +10 -6
  35. package/src/Api/Internal/ExportInternalApi.js +105 -136
  36. package/src/Api/Internal/RowFormInternalApi.js +1 -1
  37. package/src/Api/LayoutApi.d.ts +1 -1
  38. package/src/Api/ThemeApi.d.ts +2 -0
  39. package/src/PredefinedConfig/AlertState.d.ts +1 -1
  40. package/src/PredefinedConfig/Common/AdaptableColumnContext.d.ts +1 -1
  41. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  42. package/src/PredefinedConfig/Common/AdaptablePredicate.js +32 -48
  43. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +6 -2
  44. package/src/PredefinedConfig/ExportState.d.ts +10 -17
  45. package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
  46. package/src/PredefinedConfig/LayoutState.d.ts +17 -17
  47. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  48. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +4 -3
  49. package/src/Redux/ActionsReducers/LayoutRedux.js +3 -3
  50. package/src/Redux/Store/AdaptableStore.js +2 -2
  51. package/src/Strategy/ColumnFilterModule.js +4 -4
  52. package/src/Strategy/StyledColumnModule.js +6 -6
  53. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +5 -6
  54. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +9 -10
  55. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +27 -27
  56. package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -0
  57. package/src/Utilities/Helpers/AdaptableHelper.js +12 -1
  58. package/src/Utilities/Helpers/DateHelper.js +3 -5
  59. package/src/Utilities/Helpers/FormatHelper.js +19 -6
  60. package/src/Utilities/ObjectFactory.js +1 -0
  61. package/src/Utilities/Services/Fdc3Service.d.ts +2 -2
  62. package/src/Utilities/Services/Fdc3Service.js +7 -2
  63. package/src/Utilities/Services/ThemeService.d.ts +1 -1
  64. package/src/Utilities/Services/ThemeService.js +5 -5
  65. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +41 -0
  66. package/src/View/ColumnInfo/ColumnInfo.js +0 -1
  67. package/src/View/Comments/CommentsEditor.js +5 -2
  68. package/src/View/Comments/CommentsPopup.js +5 -2
  69. package/src/View/Components/ColumnFilter/ColumnFilter.d.ts +1 -1
  70. package/src/View/Components/ColumnFilter/ColumnFilter.js +4 -2
  71. package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -1
  72. package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
  73. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.d.ts +1 -1
  74. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +6 -2
  75. package/src/View/Components/ColumnFilter/utils.js +2 -2
  76. package/src/View/Components/FilterForm/ListBoxFilterForm.js +3 -3
  77. package/src/View/Dashboard/CustomToolbar.js +2 -2
  78. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
  79. package/src/View/Filter/FilterSummary.js +1 -1
  80. package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +6 -2
  81. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +7 -2
  82. package/src/View/Note/NotePopup.js +5 -2
  83. package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
  84. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.d.ts +2 -0
  85. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +18 -2
  86. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
  87. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +2 -1
  88. package/src/View/StatusBar/AdaptableStatusBar.js +7 -5
  89. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +3 -4
  90. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +348 -191
  91. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +2 -2
  92. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
  93. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +4 -4
  94. package/src/agGrid/AdaptableAgGrid.d.ts +4 -8
  95. package/src/agGrid/AdaptableAgGrid.js +71 -117
  96. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  97. package/src/agGrid/AgGridAdapter.js +5 -6
  98. package/src/agGrid/AgGridColumnAdapter.js +5 -10
  99. package/src/agGrid/AgGridExportAdapter.d.ts +24 -1
  100. package/src/agGrid/AgGridExportAdapter.js +24 -25
  101. package/src/agGrid/AgGridThemeAdapter.d.ts +19 -0
  102. package/src/agGrid/AgGridThemeAdapter.js +126 -0
  103. package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -1
  104. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +2 -2
  105. package/src/components/ColorPicker/ColorPicker.js +2 -2
  106. package/src/components/Datepicker/DatepickerContext.d.ts +1 -0
  107. package/src/components/Datepicker/index.d.ts +1 -0
  108. package/src/components/OverlayTrigger/useAgGridClassName.js +1 -1
  109. package/src/components/Select/Select.d.ts +1 -0
  110. package/src/components/Select/Select.js +30 -7
  111. package/src/env.js +2 -2
  112. package/src/metamodel/adaptable.metamodel.d.ts +23 -15
  113. package/src/metamodel/adaptable.metamodel.js +1 -1
  114. package/src/migration/VersionUpgrade20.d.ts +3 -0
  115. package/src/migration/VersionUpgrade20.js +141 -12
  116. package/src/types.d.ts +3 -3
  117. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -2,18 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExportInternalApi = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const groupBy_1 = tslib_1.__importDefault(require("lodash/groupBy"));
6
5
  const ApiBase_1 = require("../Implementation/ApiBase");
6
+ const ag_grid_enterprise_1 = require("ag-grid-enterprise");
7
7
  const Uuid_1 = require("../../PredefinedConfig/Uuid");
8
8
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
9
- const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
10
- const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
11
9
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
12
10
  const FormatHelper_1 = tslib_1.__importStar(require("../../Utilities/Helpers/FormatHelper"));
13
11
  const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
14
12
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
15
13
  const InternalRedux_1 = require("../../Redux/ActionsReducers/InternalRedux");
16
- const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
17
14
  class ExportInternalApi extends ApiBase_1.ApiBase {
18
15
  /**
19
16
  * Value Items for Report Name Selection
@@ -117,7 +114,7 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
117
114
  // format is customized based on column data type
118
115
  switch (columnDataType) {
119
116
  case 'text':
120
- return dataFormatDataType.string;
117
+ return dataFormatDataType.text;
121
118
  case 'number':
122
119
  return dataFormatDataType.number;
123
120
  case 'date':
@@ -215,7 +212,6 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
215
212
  return `[${report.Name}]`;
216
213
  }
217
214
  else {
218
- // FIXME AFL: maybe fihnd a better description?
219
215
  switch (report.ReportRowScope) {
220
216
  case 'AllRows':
221
217
  return '[All Rows]';
@@ -228,138 +224,12 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
228
224
  }
229
225
  }
230
226
  }
231
- getReportDataColumns(report, includePrimaryKey = false) {
232
- let reportColumns = [];
233
- let gridColumns = this.getAdaptableApi().columnApi.getExportableColumns();
234
- if (this.getAdaptableApi().exportApi.isExternalReport(report)) {
235
- return reportColumns;
236
- }
237
- // first get the cols depending on the Column Scope
238
- switch (report.ReportColumnScope) {
239
- case 'AllColumns':
240
- reportColumns = gridColumns;
241
- break;
242
- case 'VisibleColumns':
243
- reportColumns = gridColumns.filter((c) => c.visible);
244
- break;
245
- case 'SelectedColumns':
246
- // we extract the selected columns from the grid columns to preserve the grid column order
247
- const selectedColumnIds = this.getAdaptableApi()
248
- .gridApi.getSelectedCellInfo()
249
- .columns.map((column) => column.columnId);
250
- reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.columnId));
251
- break;
252
- case 'ScopeColumns':
253
- if ('ColumnIds' in report.Scope) {
254
- reportColumns = report.Scope.ColumnIds.map((columnId) => this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId)).filter((c) => c);
255
- }
256
- else {
257
- reportColumns = this.getAdaptableApi().columnScopeApi.getColumnsInScope(report.Scope);
258
- }
259
- break;
260
- }
261
- if (includePrimaryKey) {
262
- const pkColumn = reportColumns.find((column) => column.columnId === this.getAdaptableApi().optionsApi.getPrimaryKey());
263
- // TODO simplify after we fix the IsPrimaryKey bug
264
- // const pkColumn = reportColumns.find(column => column.IsPrimaryKey);
265
- if (!pkColumn && !!this.getAdaptableApi().columnApi.getPrimaryKeyColumn()) {
266
- reportColumns.push(this.getAdaptableApi().columnApi.getPrimaryKeyColumn());
267
- }
268
- }
269
- return reportColumns;
270
- }
271
- getReportDataRows(report, columns, includePrimaryKey) {
272
- if (ArrayExtensions_1.default.IsNullOrEmpty(columns)) {
273
- return [];
274
- }
275
- const columnIds = columns.map((column) => column.columnId);
276
- const resultRowData = [];
277
- switch (report.ReportRowScope) {
278
- case 'AllRows':
279
- this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
280
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
281
- });
282
- break;
283
- case 'VisibleRows':
284
- this.getAdaptableInternalApi().forAllVisibleRowNodesDo((rowNode) => {
285
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
286
- });
287
- break;
288
- case 'ExpressionRows':
289
- this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
290
- try {
291
- if (this.getAdaptableApi()
292
- .internalApi.getQueryLanguageService()
293
- .evaluateBooleanExpression(report.Query?.BooleanExpression, ModuleConstants_1.ExportModuleId, rowNode)) {
294
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
295
- }
296
- }
297
- catch (error) {
298
- (0, AdaptableLogger_1.errorOnce)(error.message);
299
- }
300
- });
301
- break;
302
- case 'SelectedRows':
303
- // CellSelection
304
- const selectedCellInfo = this.getAdaptableApi().gridApi.getSelectedCellInfo();
305
- const { gridCells: GridCells } = selectedCellInfo;
306
- let selectedCellsByPrimaryKey = (0, groupBy_1.default)(GridCells, 'primaryKeyValue');
307
- // we iterate over all visibleRowNodes to preserve the current order
308
- this.getAdaptableInternalApi().forAllVisibleRowNodesDo((rowNode) => {
309
- const rowPrimaryKeyValue = this.getAdaptableApi().gridApi.getPrimaryKeyValueForRowNode(rowNode);
310
- const selectedRowCells = selectedCellsByPrimaryKey[rowPrimaryKeyValue];
311
- if (selectedRowCells) {
312
- const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.column.columnId);
313
- const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
314
- const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds, report.Name);
315
- if (includePrimaryKey) {
316
- row[this.getAdaptableApi().optionsApi.getPrimaryKey()] = rowPrimaryKeyValue;
317
- }
318
- resultRowData.push(row);
319
- }
320
- });
321
- // Row Selection
322
- const selectedRowInfo = this.getAdaptableApi().gridApi.getSelectedRowInfo();
323
- const selectedGridRowPrimaryKeys = selectedRowInfo?.gridRows
324
- ?.filter((gr) => gr.rowInfo.isGroup == false)
325
- .map((gridRow) => gridRow.primaryKeyValue) ?? [];
326
- if (selectedGridRowPrimaryKeys.length) {
327
- this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
328
- const rowPrimaryKeyValue = this.getAdaptableApi().gridApi.getPrimaryKeyValueForRowNode(rowNode);
329
- if (selectedGridRowPrimaryKeys.includes(rowPrimaryKeyValue)) {
330
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
331
- }
332
- });
333
- }
334
- break;
335
- }
336
- return resultRowData;
337
- }
338
- getReportData(report, includePrimaryKey = false) {
339
- if (this.getAdaptableApi().exportApi.isExternalReport(report)) {
340
- return this.getAdaptableApi().exportApi.runExternalReport(report.Name);
341
- }
342
- const columns = this.getReportDataColumns(report, includePrimaryKey);
343
- const rows = this.getReportDataRows(report, columns, includePrimaryKey);
344
- return { columns, rows };
345
- }
346
- getReportDataAsArray(report, includePrimaryKey = false) {
347
- const reportData = this.getReportData(report, includePrimaryKey);
348
- return this.convertReportDataToArray(reportData);
349
- }
350
227
  convertReportDataToArray(reportData) {
351
228
  return [
352
229
  reportData.columns.map((column) => column.friendlyName),
353
- ...reportData.rows.map((row) => reportData.columns.map((column) => row[column.columnId])),
230
+ ...reportData.rows.map((row) => reportData.columns.map((column) => row[column.field ?? column.columnId])),
354
231
  ];
355
232
  }
356
- getRowObjectForColumnIds(rowNode, columnIds, reportName) {
357
- return columnIds.reduce((result, columnId) => {
358
- // FIXME AFL if this method remains, 'false' should be replaced with dynamic value
359
- result[columnId] = this.getCellExportValueFromRowNode(rowNode, columnId, false);
360
- return result;
361
- }, {});
362
- }
363
233
  publishLiveLiveDataChangedEvent(reportDestination, liveDataTrigger, liveReport) {
364
234
  const liveDataChangedInfo = {
365
235
  ...this.getAdaptableInternalApi().buildBaseContext(),
@@ -433,9 +303,8 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
433
303
  this.sendReportToCustomDestination(reportResult, report, format, destination);
434
304
  }
435
305
  if (destination === 'Download') {
436
- if (format === 'Excel' || format === 'VisualExcel') {
437
- this.logWarn(`Download of Excel files should already be handed by internal APIs, something went wrong`);
438
- return;
306
+ if (reportResult.type === 'excel') {
307
+ Helper_1.default.createDownloadedFile(reportResult.data, this.getReportFileName(report.Name, format, destination), 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
439
308
  }
440
309
  if (reportResult.type === 'csv') {
441
310
  Helper_1.default.createDownloadedFile(reportResult.data, this.getReportFileName(report.Name, format, destination), 'text/csv;encoding:utf-8');
@@ -494,5 +363,105 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
494
363
  exportDestination,
495
364
  };
496
365
  }
366
+ createCellCsv(cellContent) {
367
+ return {
368
+ data: {
369
+ value: cellContent != undefined ? String(cellContent) : null,
370
+ },
371
+ };
372
+ }
373
+ createCellExcel(cellContent, cellType) {
374
+ return {
375
+ data: {
376
+ value: cellContent != undefined ? String(cellContent) : null,
377
+ type: cellType,
378
+ },
379
+ };
380
+ }
381
+ createCellHeader(cellContent) {
382
+ return {
383
+ data: {
384
+ value: cellContent != undefined ? String(cellContent) : null,
385
+ type: 'String',
386
+ },
387
+ };
388
+ }
389
+ getExternalReportData(externalReportName, reportFormat, exportDestination) {
390
+ const externalReport = this.getExportApi()
391
+ .getExternalReports()
392
+ ?.find((cr) => cr.name == externalReportName);
393
+ if (!externalReport) {
394
+ this.logWarn(`External Report '${externalReportName}' not found!`);
395
+ return undefined;
396
+ }
397
+ return externalReport.onExport({
398
+ ...this.buildBaseExportContext(externalReportName, reportFormat, exportDestination),
399
+ convertToExcel: this.buildExcelConverter(externalReportName, reportFormat, exportDestination),
400
+ convertToCsv: this.buildCsvConverter(externalReportName, reportFormat, exportDestination),
401
+ getGridReportColumns: this.buildGridReportColumns(),
402
+ });
403
+ }
404
+ buildGridReportColumns() {
405
+ return () => this.getAdaptableApi().columnApi.getColumns();
406
+ }
407
+ buildExcelConverter(externalReportName, reportFormat, exportDestination) {
408
+ return (reportData) => {
409
+ return this.executeGridExport(reportData, externalReportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsExcel({ ...exportParams }));
410
+ };
411
+ }
412
+ buildCsvConverter(externalReportName, reportFormat, exportDestination) {
413
+ return (reportData) => {
414
+ const csvParams = this.buildCsvExportParams(externalReportName, reportFormat, exportDestination);
415
+ return this.executeGridExport(reportData, externalReportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsCsv({ ...exportParams, ...csvParams }));
416
+ };
417
+ }
418
+ executeGridExport(reportData, externalReportName, reportFormat, exportDestination, exportFn) {
419
+ const htmlDivElement = document.createElement('div');
420
+ let ephemeralGridApi = null;
421
+ try {
422
+ const columnDefs = reportData.columns.map((col) => ({
423
+ colId: col.columnId,
424
+ field: col.field ?? col.columnId,
425
+ headerName: col.friendlyName ?? col.columnId,
426
+ type: col.dataType ?? 'text',
427
+ }));
428
+ const gridOptions = { columnDefs, rowData: reportData.rows };
429
+ const gridParams = {
430
+ modules: this.getAdaptableApi()
431
+ .internalApi.getAdaptableInstance()
432
+ .getAgGridRegisteredModules(),
433
+ };
434
+ htmlDivElement.style.display = 'none';
435
+ document.body.appendChild(htmlDivElement);
436
+ ephemeralGridApi = (0, ag_grid_enterprise_1.createGrid)(htmlDivElement, gridOptions, gridParams);
437
+ const exportParams = {
438
+ fileName: this.getReportFileName(externalReportName, reportFormat, exportDestination),
439
+ allColumns: true,
440
+ exportedRows: 'all',
441
+ };
442
+ return exportFn(ephemeralGridApi, exportParams);
443
+ }
444
+ catch (error) {
445
+ this.logWarn('Failed to export data:', error);
446
+ return null;
447
+ }
448
+ finally {
449
+ if (ephemeralGridApi) {
450
+ ephemeralGridApi.destroy();
451
+ }
452
+ if (htmlDivElement?.parentNode) {
453
+ document.body.removeChild(htmlDivElement);
454
+ }
455
+ }
456
+ }
457
+ buildCsvExportParams(externalReportName, reportFormat, exportDestination) {
458
+ const exportOptions = this.getAdaptableApi().optionsApi.getExportOptions();
459
+ const csvSeparator = typeof exportOptions.csvSeparator === 'function'
460
+ ? exportOptions.csvSeparator(this.buildBaseExportContext(externalReportName, reportFormat, exportDestination))
461
+ : exportOptions.csvSeparator;
462
+ return {
463
+ columnSeparator: csvSeparator,
464
+ };
465
+ }
497
466
  }
498
467
  exports.ExportInternalApi = ExportInternalApi;
@@ -190,7 +190,7 @@ class RowFormInternalApi extends ApiBase_1.ApiBase {
190
190
  }
191
191
  const returnValues = this.getGridApi().internalApi.getDistinctDisplayValuesForColumnOld(column.columnId);
192
192
  // FIXME add support for asynchronous custom select cell editor values
193
- // it involves refactoring the AdaptableForm & AdapatableFormComponent
193
+ // it involves refactoring the AdaptableForm & adaptableFormComponent
194
194
  // await this.getSelectCellEditorValuesForColumn(
195
195
  // column,
196
196
  // gridCell
@@ -176,7 +176,7 @@ export interface LayoutApi {
176
176
  */
177
177
  addColumnToTableLayout(columnId: string, layoutName: string): void;
178
178
  /**
179
- * Adds a Column to Current Layout
179
+ * Adds a Column to Current (Table) Layout
180
180
  * @param columnId Column to add
181
181
  */
182
182
  addColumnToCurrentTableLayout(columnId: string): void;
@@ -81,6 +81,8 @@ export interface ThemeApi {
81
81
  openThemeSettingsPanel(): void;
82
82
  /**
83
83
  * Get the name of the current AG Grid theme
84
+ *
85
+ * @deprecated required only for legacy AG Grid themes, see https://www.ag-grid.com/javascript-data-grid/theming-v32/
84
86
  */
85
87
  getAgGridCurrentThemeName(): string;
86
88
  }
@@ -150,4 +150,4 @@ export type SystemAlertPredicateIds = SystemAlertPredicateId[];
150
150
  /**
151
151
  * List of System Predicates available for Alerts
152
152
  */
153
- export type SystemAlertPredicateId = 'Blanks' | 'NonBlanks' | 'Equals' | 'NotEquals' | 'GreaterThan' | 'LessThan' | 'Positive' | 'Negative' | 'Zero' | 'Between' | 'NotBetween' | 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'Today' | 'Yesterday' | 'Tomorrow' | 'ThisWeek' | 'ThisMonth' | 'ThisQuarter' | 'ThisYear' | 'InPast' | 'InFuture' | 'Before' | 'After' | 'On' | 'NotOn' | 'NextWorkDay' | 'LastWorkDay' | 'WorkDay' | 'Holiday' | 'True' | 'False' | 'PercentChange' | 'IsNumeric' | 'IsNotNumeric' | 'In' | 'NotIn' | 'AnyChange';
153
+ export type SystemAlertPredicateId = 'Blanks' | 'NonBlanks' | 'Equals' | 'NotEquals' | 'GreaterThan' | 'LessThan' | 'Positive' | 'Negative' | 'Zero' | 'Between' | 'NotBetween' | 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'Today' | 'Yesterday' | 'Tomorrow' | 'ThisWeek' | 'ThisMonth' | 'ThisQuarter' | 'ThisYear' | 'InPast' | 'InFuture' | 'Before' | 'After' | 'On' | 'NotOn' | 'NextWorkDay' | 'LastWorkDay' | 'WorkDay' | 'Holiday' | 'True' | 'False' | 'PercentChange' | 'In' | 'NotIn' | 'AnyChange';
@@ -5,7 +5,7 @@ import { BaseContext } from './BaseContext';
5
5
  */
6
6
  export interface AdaptableColumnContext<TData = any> extends BaseContext {
7
7
  /**
8
- * Column being filtered
8
+ * The current Column
9
9
  */
10
10
  column: AdaptableColumn<TData>;
11
11
  }
@@ -104,7 +104,7 @@ export interface PredicateDefHandlerContext extends BaseContext {
104
104
  * Any (optional) inputs required to perform evaluation
105
105
  */
106
106
  inputs?: any[];
107
- predicatesLogic?: ColumnFilter['PredicatesLogic'];
107
+ predicatesOperator?: ColumnFilter['PredicatesOperator'];
108
108
  }
109
109
  /**
110
110
  * Inputs required for a Predicate
@@ -2,19 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SystemBadgeStylePredicateIds = exports.SystemFlashingCellPredicateIds = exports.SystemFormatColumnPredicateIds = exports.SystemAlertPredicateIds = exports.SystemFilterPredicateIds = exports.SystemPredicateDefs = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const isAfter_1 = tslib_1.__importDefault(require("date-fns/isAfter"));
6
- const isBefore_1 = tslib_1.__importDefault(require("date-fns/isBefore"));
7
- const isEqual_1 = tslib_1.__importDefault(require("date-fns/isEqual"));
8
- const isFuture_1 = tslib_1.__importDefault(require("date-fns/isFuture"));
9
- const isPast_1 = tslib_1.__importDefault(require("date-fns/isPast"));
10
- const isSameDay_1 = tslib_1.__importDefault(require("date-fns/isSameDay"));
11
- const isThisMonth_1 = tslib_1.__importDefault(require("date-fns/isThisMonth"));
12
- const isThisQuarter_1 = tslib_1.__importDefault(require("date-fns/isThisQuarter"));
13
- const isThisWeek_1 = tslib_1.__importDefault(require("date-fns/isThisWeek"));
14
- const isThisYear_1 = tslib_1.__importDefault(require("date-fns/isThisYear"));
15
- const isToday_1 = tslib_1.__importDefault(require("date-fns/isToday"));
16
- const isTomorrow_1 = tslib_1.__importDefault(require("date-fns/isTomorrow"));
17
- const isYesterday_1 = tslib_1.__importDefault(require("date-fns/isYesterday"));
5
+ const date_fns_1 = require("date-fns");
6
+ const date_fns_2 = require("date-fns");
7
+ const date_fns_3 = require("date-fns");
8
+ const date_fns_4 = require("date-fns");
9
+ const date_fns_5 = require("date-fns");
10
+ const date_fns_6 = require("date-fns");
11
+ const date_fns_7 = require("date-fns");
12
+ const date_fns_8 = require("date-fns");
13
+ const date_fns_9 = require("date-fns");
14
+ const date_fns_10 = require("date-fns");
15
+ const date_fns_11 = require("date-fns");
16
+ const date_fns_12 = require("date-fns");
17
+ const date_fns_13 = require("date-fns");
18
18
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
19
19
  const DateHelper_1 = require("../../Utilities/Helpers/DateHelper");
20
20
  const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
@@ -56,10 +56,10 @@ exports.SystemPredicateDefs = [
56
56
  if (column.dataType === 'date') {
57
57
  return inputs.some((input) => {
58
58
  if (adaptableApi.optionsApi.getPredicateOptions().evaluateValuesPredicateUsingTime) {
59
- return (0, isEqual_1.default)(input, value);
59
+ return (0, date_fns_3.isEqual)(input, value);
60
60
  }
61
61
  else {
62
- return (0, isSameDay_1.default)((0, DateHelper_1.parseDateValue)(input), (0, DateHelper_1.parseDateValue)(value));
62
+ return (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(input), (0, DateHelper_1.parseDateValue)(value));
63
63
  }
64
64
  });
65
65
  }
@@ -116,12 +116,12 @@ exports.SystemPredicateDefs = [
116
116
  if (column.dataType === 'date') {
117
117
  if (adaptableApi.optionsApi.getPredicateOptions().evaluateValuesPredicateUsingTime) {
118
118
  return inputs.every((input) => {
119
- return !(0, isEqual_1.default)(input, value);
119
+ return !(0, date_fns_3.isEqual)(input, value);
120
120
  });
121
121
  }
122
122
  else {
123
123
  return inputs.every((input) => {
124
- return !(0, isSameDay_1.default)((0, DateHelper_1.parseDateValue)(input), (0, DateHelper_1.parseDateValue)(value));
124
+ return !(0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(input), (0, DateHelper_1.parseDateValue)(value));
125
125
  });
126
126
  }
127
127
  }
@@ -270,22 +270,6 @@ exports.SystemPredicateDefs = [
270
270
  toString: ({ inputs }) => `Not Between ${inputs[0] ?? ''}:${inputs[1]}`,
271
271
  shortcuts: ['!:'],
272
272
  },
273
- {
274
- id: 'IsNumeric',
275
- label: 'Is Numeric',
276
- icon: { text: '1' },
277
- columnScope: { DataTypes: ['number'] },
278
- moduleScope: ['alert', 'flashingcell'],
279
- handler: ({ value }) => !isNaN(Number(value)),
280
- },
281
- {
282
- id: 'IsNotNumeric',
283
- label: 'Is Not Numeric',
284
- icon: { text: '1' },
285
- columnScope: { DataTypes: ['number'] },
286
- moduleScope: ['alert', 'flashingcell'],
287
- handler: ({ value }) => isNaN(Number(value)),
288
- },
289
273
  // String System Filters
290
274
  {
291
275
  id: 'Is',
@@ -414,7 +398,7 @@ exports.SystemPredicateDefs = [
414
398
  icon: { name: 'calendar' },
415
399
  columnScope: { DataTypes: ['date'] },
416
400
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
417
- handler: ({ value }) => (0, isToday_1.default)((0, DateHelper_1.parseDateValue)(value)),
401
+ handler: ({ value }) => (0, date_fns_11.isToday)((0, DateHelper_1.parseDateValue)(value)),
418
402
  },
419
403
  {
420
404
  id: 'Yesterday',
@@ -422,7 +406,7 @@ exports.SystemPredicateDefs = [
422
406
  icon: { name: 'calendar' },
423
407
  columnScope: { DataTypes: ['date'] },
424
408
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
425
- handler: ({ value }) => (0, isYesterday_1.default)((0, DateHelper_1.parseDateValue)(value)),
409
+ handler: ({ value }) => (0, date_fns_13.isYesterday)((0, DateHelper_1.parseDateValue)(value)),
426
410
  },
427
411
  {
428
412
  id: 'Tomorrow',
@@ -430,7 +414,7 @@ exports.SystemPredicateDefs = [
430
414
  icon: { name: 'calendar' },
431
415
  columnScope: { DataTypes: ['date'] },
432
416
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
433
- handler: ({ value }) => (0, isTomorrow_1.default)((0, DateHelper_1.parseDateValue)(value)),
417
+ handler: ({ value }) => (0, date_fns_12.isTomorrow)((0, DateHelper_1.parseDateValue)(value)),
434
418
  },
435
419
  {
436
420
  id: 'ThisWeek',
@@ -438,7 +422,7 @@ exports.SystemPredicateDefs = [
438
422
  icon: { name: 'calendar' },
439
423
  columnScope: { DataTypes: ['date'] },
440
424
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
441
- handler: ({ value }) => (0, isThisWeek_1.default)((0, DateHelper_1.parseDateValue)(value)),
425
+ handler: ({ value }) => (0, date_fns_9.isThisWeek)((0, DateHelper_1.parseDateValue)(value)),
442
426
  },
443
427
  {
444
428
  id: 'ThisMonth',
@@ -446,7 +430,7 @@ exports.SystemPredicateDefs = [
446
430
  icon: { name: 'calendar' },
447
431
  columnScope: { DataTypes: ['date'] },
448
432
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
449
- handler: ({ value }) => (0, isThisMonth_1.default)((0, DateHelper_1.parseDateValue)(value)),
433
+ handler: ({ value }) => (0, date_fns_7.isThisMonth)((0, DateHelper_1.parseDateValue)(value)),
450
434
  },
451
435
  {
452
436
  id: 'ThisQuarter',
@@ -454,7 +438,7 @@ exports.SystemPredicateDefs = [
454
438
  icon: { name: 'calendar' },
455
439
  columnScope: { DataTypes: ['date'] },
456
440
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
457
- handler: ({ value }) => (0, isThisQuarter_1.default)((0, DateHelper_1.parseDateValue)(value)),
441
+ handler: ({ value }) => (0, date_fns_8.isThisQuarter)((0, DateHelper_1.parseDateValue)(value)),
458
442
  },
459
443
  {
460
444
  id: 'ThisYear',
@@ -462,7 +446,7 @@ exports.SystemPredicateDefs = [
462
446
  icon: { name: 'calendar' },
463
447
  columnScope: { DataTypes: ['date'] },
464
448
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
465
- handler: ({ value }) => (0, isThisYear_1.default)((0, DateHelper_1.parseDateValue)(value)),
449
+ handler: ({ value }) => (0, date_fns_10.isThisYear)((0, DateHelper_1.parseDateValue)(value)),
466
450
  },
467
451
  {
468
452
  id: 'InPast',
@@ -470,7 +454,7 @@ exports.SystemPredicateDefs = [
470
454
  icon: { name: 'calendar' },
471
455
  columnScope: { DataTypes: ['date'] },
472
456
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
473
- handler: ({ value }) => (0, isPast_1.default)((0, DateHelper_1.parseDateValue)(value)),
457
+ handler: ({ value }) => (0, date_fns_5.isPast)((0, DateHelper_1.parseDateValue)(value)),
474
458
  },
475
459
  {
476
460
  id: 'InFuture',
@@ -478,7 +462,7 @@ exports.SystemPredicateDefs = [
478
462
  icon: { name: 'calendar' },
479
463
  columnScope: { DataTypes: ['date'] },
480
464
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
481
- handler: ({ value }) => (0, isFuture_1.default)((0, DateHelper_1.parseDateValue)(value)),
465
+ handler: ({ value }) => (0, date_fns_4.isFuture)((0, DateHelper_1.parseDateValue)(value)),
482
466
  },
483
467
  {
484
468
  id: 'After',
@@ -487,7 +471,7 @@ exports.SystemPredicateDefs = [
487
471
  columnScope: { DataTypes: ['date'] },
488
472
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
489
473
  inputs: [{ type: 'date' }],
490
- handler: ({ value, inputs }) => (0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
474
+ handler: ({ value, inputs }) => (0, date_fns_1.isAfter)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
491
475
  toString: ({ inputs }) => `> ${inputs[0] ?? ''}`,
492
476
  },
493
477
  {
@@ -497,7 +481,7 @@ exports.SystemPredicateDefs = [
497
481
  columnScope: { DataTypes: ['date'] },
498
482
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
499
483
  inputs: [{ type: 'date' }],
500
- handler: ({ value, inputs }) => (0, isBefore_1.default)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
484
+ handler: ({ value, inputs }) => (0, date_fns_2.isBefore)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
501
485
  toString: ({ inputs }) => `< ${inputs[0] ?? ''}`,
502
486
  },
503
487
  {
@@ -507,7 +491,7 @@ exports.SystemPredicateDefs = [
507
491
  columnScope: { DataTypes: ['date'] },
508
492
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
509
493
  inputs: [{ type: 'date' }],
510
- handler: ({ value, inputs }) => (0, isSameDay_1.default)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
494
+ handler: ({ value, inputs }) => (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
511
495
  toString: ({ inputs }) => `= ${inputs[0] ?? ''}`,
512
496
  },
513
497
  {
@@ -517,7 +501,7 @@ exports.SystemPredicateDefs = [
517
501
  columnScope: { DataTypes: ['date'] },
518
502
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
519
503
  inputs: [{ type: 'date' }],
520
- handler: ({ value, inputs }) => !(0, isSameDay_1.default)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
504
+ handler: ({ value, inputs }) => !(0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), (0, DateHelper_1.parseDateValue)(inputs[0])),
521
505
  toString: ({ inputs }) => `!= ${inputs[0] ?? ''}`,
522
506
  },
523
507
  {
@@ -526,7 +510,7 @@ exports.SystemPredicateDefs = [
526
510
  icon: { name: 'calendar' },
527
511
  columnScope: { DataTypes: ['date'] },
528
512
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
529
- handler: ({ value, adaptableApi }) => (0, isSameDay_1.default)((0, DateHelper_1.parseDateValue)(value), adaptableApi.calendarApi.getNextWorkingDay()),
513
+ handler: ({ value, adaptableApi }) => (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), adaptableApi.calendarApi.getNextWorkingDay()),
530
514
  },
531
515
  {
532
516
  id: 'LastWorkDay',
@@ -534,7 +518,7 @@ exports.SystemPredicateDefs = [
534
518
  icon: { name: 'calendar' },
535
519
  columnScope: { DataTypes: ['date'] },
536
520
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn'],
537
- handler: ({ value, adaptableApi }) => (0, isSameDay_1.default)((0, DateHelper_1.parseDateValue)(value), adaptableApi.calendarApi.getPreviousWorkingDay()),
521
+ handler: ({ value, adaptableApi }) => (0, date_fns_6.isSameDay)((0, DateHelper_1.parseDateValue)(value), adaptableApi.calendarApi.getPreviousWorkingDay()),
538
522
  },
539
523
  {
540
524
  id: 'WorkDay',
@@ -13,10 +13,10 @@ export interface ColumnFilter extends SuspendableObject {
13
13
  */
14
14
  Predicates: ColumnFilterPredicate[];
15
15
  /**
16
- * The Logic to use when combining multiple Predicates
16
+ * Logic used when combining multiple Predicates ('AND'|'OR')
17
17
  * @defaultValue 'AND'
18
18
  */
19
- PredicatesLogic?: 'AND' | 'OR';
19
+ PredicatesOperator?: PredicatesOperator;
20
20
  }
21
21
  /**
22
22
  * A Predicate used in Column Filtering
@@ -24,6 +24,10 @@ export interface ColumnFilter extends SuspendableObject {
24
24
  export interface ColumnFilterPredicate extends AdaptablePredicate {
25
25
  PredicateId: TypeHint<string, SystemFilterPredicateId>;
26
26
  }
27
+ /**
28
+ * Logic used to join multiple Predicates
29
+ */
30
+ export type PredicatesOperator = 'AND' | 'OR';
27
31
  /**
28
32
  * Array containing all System Filter Predicates
29
33
  */
@@ -3,9 +3,9 @@ import { BaseSchedule } from './Common/Schedule';
3
3
  import { ColumnScope } from './Common/ColumnScope';
4
4
  import { AdaptableColumnBase } from './Common/AdaptableColumn';
5
5
  import { AdaptableObject } from './Common/AdaptableObject';
6
- import { AdaptableFormData } from './Common/AdaptableForm';
7
6
  import { AdaptableBooleanQuery } from './Common/AdaptableQuery';
8
7
  import { TypeHint } from './Common/Types';
8
+ import { ExportDestinationType } from '../AdaptableOptions/ExportOptions';
9
9
  /**
10
10
  * Predefined Configuration for Export Module
11
11
  */
@@ -61,9 +61,15 @@ export interface ReportSchedule extends BaseSchedule {
61
61
  */
62
62
  ReportFormat: ReportFormatType;
63
63
  /**
64
- * Additional data for a Custom Destination produced by a Dynamic Form
64
+ * Destination of Report to run on Schedule
65
65
  */
66
- ExportDestinationData?: AdaptableFormData;
66
+ ExportDestination?: ExportDestinationType;
67
+ }
68
+ export interface ReportColumn extends AdaptableColumnBase {
69
+ /**
70
+ * Field in the row to get cell data from; defaults to `columnId`
71
+ */
72
+ field?: string;
67
73
  }
68
74
  /**
69
75
  * Defines the data in a Report run by AdapTable
@@ -76,7 +82,7 @@ export interface ReportData {
76
82
  /**
77
83
  * Columns in the Report
78
84
  */
79
- columns: AdaptableColumnBase[];
85
+ columns: ReportColumn[];
80
86
  /**
81
87
  * Group columns IDs in the Report
82
88
  */
@@ -86,19 +92,6 @@ export interface ReportData {
86
92
  */
87
93
  pivotColumnIds?: string[];
88
94
  }
89
- /**
90
- * Row Data in the Report
91
- */
92
- export interface ReportRow {
93
- /**
94
- * Data for the row
95
- */
96
- data: Record<string, any>;
97
- /**
98
- * Optional children rows for grouped data
99
- */
100
- children?: ReportRow[];
101
- }
102
95
  /**
103
96
  * System report names provided by AdapTable
104
97
  */