@adaptabletools/adaptable 20.0.0-canary.2 → 20.0.0-canary.20

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/ThemeApi.d.ts +2 -0
  38. package/src/PredefinedConfig/AlertState.d.ts +1 -1
  39. package/src/PredefinedConfig/Common/AdaptableColumnContext.d.ts +1 -1
  40. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  41. package/src/PredefinedConfig/Common/AdaptablePredicate.js +13 -29
  42. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +6 -2
  43. package/src/PredefinedConfig/ExportState.d.ts +10 -17
  44. package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
  45. package/src/PredefinedConfig/LayoutState.d.ts +17 -17
  46. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  47. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +4 -3
  48. package/src/Redux/ActionsReducers/LayoutRedux.js +3 -3
  49. package/src/Redux/Store/AdaptableStore.js +3 -3
  50. package/src/Strategy/ColumnFilterModule.js +4 -4
  51. package/src/Strategy/StyledColumnModule.js +6 -6
  52. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
  53. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -3
  54. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +13 -13
  55. package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -0
  56. package/src/Utilities/Helpers/AdaptableHelper.js +10 -0
  57. package/src/Utilities/Helpers/DateHelper.js +1 -2
  58. package/src/Utilities/Helpers/FormatHelper.js +18 -5
  59. package/src/Utilities/ObjectFactory.js +1 -0
  60. package/src/Utilities/Services/Fdc3Service.d.ts +2 -2
  61. package/src/Utilities/Services/Fdc3Service.js +7 -2
  62. package/src/Utilities/Services/ThemeService.d.ts +1 -1
  63. package/src/Utilities/Services/ThemeService.js +5 -5
  64. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +41 -0
  65. package/src/View/ColumnInfo/ColumnInfo.js +0 -1
  66. package/src/View/Comments/CommentsEditor.js +5 -2
  67. package/src/View/Comments/CommentsPopup.js +5 -2
  68. package/src/View/Components/ColumnFilter/ColumnFilter.d.ts +1 -1
  69. package/src/View/Components/ColumnFilter/ColumnFilter.js +4 -2
  70. package/src/View/Components/ColumnFilter/FloatingFilter.js +1 -1
  71. package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
  72. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.d.ts +1 -1
  73. package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +6 -2
  74. package/src/View/Components/ColumnFilter/utils.js +2 -2
  75. package/src/View/Components/FilterForm/ListBoxFilterForm.js +3 -3
  76. package/src/View/Dashboard/CustomToolbar.js +2 -2
  77. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
  78. package/src/View/Filter/FilterSummary.js +1 -1
  79. package/src/View/GridInfo/GridInfoPopup/AdaptableObjectsSummary.js +6 -2
  80. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +7 -2
  81. package/src/View/Note/NotePopup.js +5 -2
  82. package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
  83. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.d.ts +2 -0
  84. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +18 -2
  85. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +4 -0
  86. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +2 -1
  87. package/src/View/StatusBar/AdaptableStatusBar.js +7 -5
  88. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +3 -4
  89. package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +348 -191
  90. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +2 -2
  91. package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +1 -1
  92. package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +4 -4
  93. package/src/agGrid/AdaptableAgGrid.d.ts +4 -8
  94. package/src/agGrid/AdaptableAgGrid.js +72 -118
  95. package/src/agGrid/AgGridAdapter.d.ts +1 -1
  96. package/src/agGrid/AgGridAdapter.js +7 -8
  97. package/src/agGrid/AgGridColumnAdapter.js +5 -10
  98. package/src/agGrid/AgGridExportAdapter.d.ts +24 -1
  99. package/src/agGrid/AgGridExportAdapter.js +24 -25
  100. package/src/agGrid/AgGridThemeAdapter.d.ts +19 -0
  101. package/src/agGrid/AgGridThemeAdapter.js +122 -0
  102. package/src/agGrid/cellRenderers/BadgeRenderer.js +2 -1
  103. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +1 -1
  104. package/src/components/ColorPicker/ColorPicker.js +2 -2
  105. package/src/components/Datepicker/DatepickerContext.d.ts +1 -0
  106. package/src/components/Datepicker/index.d.ts +1 -0
  107. package/src/components/Datepicker/index.js +1 -1
  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 +140 -12
  116. package/src/types.d.ts +3 -3
  117. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -1,15 +1,12 @@
1
- import groupBy from 'lodash/groupBy';
2
1
  import { ApiBase } from '../Implementation/ApiBase';
2
+ import { createGrid, } from 'ag-grid-enterprise';
3
3
  import { createUuid } from '../../PredefinedConfig/Uuid';
4
4
  import { ALL_DATA_REPORT, CURRENT_LAYOUT_REPORT, SELECTED_DATA_REPORT, SYSTEM_EXPORT_DESTINATIONS, SYSTEM_REPORT_NAMES, } from '../../Utilities/Constants/GeneralConstants';
5
- import { ExportModuleId } from '../../Utilities/Constants/ModuleConstants';
6
- import ArrayExtensions from '../../Utilities/Extensions/ArrayExtensions';
7
5
  import StringExtensions from '../../Utilities/Extensions/StringExtensions';
8
6
  import FormatHelper, { DateFormatter } from '../../Utilities/Helpers/FormatHelper';
9
7
  import Helper from '../../Utilities/Helpers/Helper';
10
8
  import * as PopupRedux from '../../Redux/ActionsReducers/PopupRedux';
11
9
  import { SystemExportBegin, SystemExportEnd } from '../../Redux/ActionsReducers/InternalRedux';
12
- import { errorOnce } from '../../agGrid/AdaptableLogger';
13
10
  export class ExportInternalApi extends ApiBase {
14
11
  /**
15
12
  * Value Items for Report Name Selection
@@ -113,7 +110,7 @@ export class ExportInternalApi extends ApiBase {
113
110
  // format is customized based on column data type
114
111
  switch (columnDataType) {
115
112
  case 'text':
116
- return dataFormatDataType.string;
113
+ return dataFormatDataType.text;
117
114
  case 'number':
118
115
  return dataFormatDataType.number;
119
116
  case 'date':
@@ -211,7 +208,6 @@ export class ExportInternalApi extends ApiBase {
211
208
  return `[${report.Name}]`;
212
209
  }
213
210
  else {
214
- // FIXME AFL: maybe fihnd a better description?
215
211
  switch (report.ReportRowScope) {
216
212
  case 'AllRows':
217
213
  return '[All Rows]';
@@ -224,138 +220,12 @@ export class ExportInternalApi extends ApiBase {
224
220
  }
225
221
  }
226
222
  }
227
- getReportDataColumns(report, includePrimaryKey = false) {
228
- let reportColumns = [];
229
- let gridColumns = this.getAdaptableApi().columnApi.getExportableColumns();
230
- if (this.getAdaptableApi().exportApi.isExternalReport(report)) {
231
- return reportColumns;
232
- }
233
- // first get the cols depending on the Column Scope
234
- switch (report.ReportColumnScope) {
235
- case 'AllColumns':
236
- reportColumns = gridColumns;
237
- break;
238
- case 'VisibleColumns':
239
- reportColumns = gridColumns.filter((c) => c.visible);
240
- break;
241
- case 'SelectedColumns':
242
- // we extract the selected columns from the grid columns to preserve the grid column order
243
- const selectedColumnIds = this.getAdaptableApi()
244
- .gridApi.getSelectedCellInfo()
245
- .columns.map((column) => column.columnId);
246
- reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.columnId));
247
- break;
248
- case 'ScopeColumns':
249
- if ('ColumnIds' in report.Scope) {
250
- reportColumns = report.Scope.ColumnIds.map((columnId) => this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId)).filter((c) => c);
251
- }
252
- else {
253
- reportColumns = this.getAdaptableApi().columnScopeApi.getColumnsInScope(report.Scope);
254
- }
255
- break;
256
- }
257
- if (includePrimaryKey) {
258
- const pkColumn = reportColumns.find((column) => column.columnId === this.getAdaptableApi().optionsApi.getPrimaryKey());
259
- // TODO simplify after we fix the IsPrimaryKey bug
260
- // const pkColumn = reportColumns.find(column => column.IsPrimaryKey);
261
- if (!pkColumn && !!this.getAdaptableApi().columnApi.getPrimaryKeyColumn()) {
262
- reportColumns.push(this.getAdaptableApi().columnApi.getPrimaryKeyColumn());
263
- }
264
- }
265
- return reportColumns;
266
- }
267
- getReportDataRows(report, columns, includePrimaryKey) {
268
- if (ArrayExtensions.IsNullOrEmpty(columns)) {
269
- return [];
270
- }
271
- const columnIds = columns.map((column) => column.columnId);
272
- const resultRowData = [];
273
- switch (report.ReportRowScope) {
274
- case 'AllRows':
275
- this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
276
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
277
- });
278
- break;
279
- case 'VisibleRows':
280
- this.getAdaptableInternalApi().forAllVisibleRowNodesDo((rowNode) => {
281
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
282
- });
283
- break;
284
- case 'ExpressionRows':
285
- this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
286
- try {
287
- if (this.getAdaptableApi()
288
- .internalApi.getQueryLanguageService()
289
- .evaluateBooleanExpression(report.Query?.BooleanExpression, ExportModuleId, rowNode)) {
290
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
291
- }
292
- }
293
- catch (error) {
294
- errorOnce(error.message);
295
- }
296
- });
297
- break;
298
- case 'SelectedRows':
299
- // CellSelection
300
- const selectedCellInfo = this.getAdaptableApi().gridApi.getSelectedCellInfo();
301
- const { gridCells: GridCells } = selectedCellInfo;
302
- let selectedCellsByPrimaryKey = groupBy(GridCells, 'primaryKeyValue');
303
- // we iterate over all visibleRowNodes to preserve the current order
304
- this.getAdaptableInternalApi().forAllVisibleRowNodesDo((rowNode) => {
305
- const rowPrimaryKeyValue = this.getAdaptableApi().gridApi.getPrimaryKeyValueForRowNode(rowNode);
306
- const selectedRowCells = selectedCellsByPrimaryKey[rowPrimaryKeyValue];
307
- if (selectedRowCells) {
308
- const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.column.columnId);
309
- const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
310
- const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds, report.Name);
311
- if (includePrimaryKey) {
312
- row[this.getAdaptableApi().optionsApi.getPrimaryKey()] = rowPrimaryKeyValue;
313
- }
314
- resultRowData.push(row);
315
- }
316
- });
317
- // Row Selection
318
- const selectedRowInfo = this.getAdaptableApi().gridApi.getSelectedRowInfo();
319
- const selectedGridRowPrimaryKeys = selectedRowInfo?.gridRows
320
- ?.filter((gr) => gr.rowInfo.isGroup == false)
321
- .map((gridRow) => gridRow.primaryKeyValue) ?? [];
322
- if (selectedGridRowPrimaryKeys.length) {
323
- this.getAdaptableInternalApi().forAllRowNodesDo((rowNode) => {
324
- const rowPrimaryKeyValue = this.getAdaptableApi().gridApi.getPrimaryKeyValueForRowNode(rowNode);
325
- if (selectedGridRowPrimaryKeys.includes(rowPrimaryKeyValue)) {
326
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
327
- }
328
- });
329
- }
330
- break;
331
- }
332
- return resultRowData;
333
- }
334
- getReportData(report, includePrimaryKey = false) {
335
- if (this.getAdaptableApi().exportApi.isExternalReport(report)) {
336
- return this.getAdaptableApi().exportApi.runExternalReport(report.Name);
337
- }
338
- const columns = this.getReportDataColumns(report, includePrimaryKey);
339
- const rows = this.getReportDataRows(report, columns, includePrimaryKey);
340
- return { columns, rows };
341
- }
342
- getReportDataAsArray(report, includePrimaryKey = false) {
343
- const reportData = this.getReportData(report, includePrimaryKey);
344
- return this.convertReportDataToArray(reportData);
345
- }
346
223
  convertReportDataToArray(reportData) {
347
224
  return [
348
225
  reportData.columns.map((column) => column.friendlyName),
349
- ...reportData.rows.map((row) => reportData.columns.map((column) => row[column.columnId])),
226
+ ...reportData.rows.map((row) => reportData.columns.map((column) => row[column.field ?? column.columnId])),
350
227
  ];
351
228
  }
352
- getRowObjectForColumnIds(rowNode, columnIds, reportName) {
353
- return columnIds.reduce((result, columnId) => {
354
- // FIXME AFL if this method remains, 'false' should be replaced with dynamic value
355
- result[columnId] = this.getCellExportValueFromRowNode(rowNode, columnId, false);
356
- return result;
357
- }, {});
358
- }
359
229
  publishLiveLiveDataChangedEvent(reportDestination, liveDataTrigger, liveReport) {
360
230
  const liveDataChangedInfo = {
361
231
  ...this.getAdaptableInternalApi().buildBaseContext(),
@@ -429,9 +299,8 @@ export class ExportInternalApi extends ApiBase {
429
299
  this.sendReportToCustomDestination(reportResult, report, format, destination);
430
300
  }
431
301
  if (destination === 'Download') {
432
- if (format === 'Excel' || format === 'VisualExcel') {
433
- this.logWarn(`Download of Excel files should already be handed by internal APIs, something went wrong`);
434
- return;
302
+ if (reportResult.type === 'excel') {
303
+ Helper.createDownloadedFile(reportResult.data, this.getReportFileName(report.Name, format, destination), 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
435
304
  }
436
305
  if (reportResult.type === 'csv') {
437
306
  Helper.createDownloadedFile(reportResult.data, this.getReportFileName(report.Name, format, destination), 'text/csv;encoding:utf-8');
@@ -490,4 +359,104 @@ export class ExportInternalApi extends ApiBase {
490
359
  exportDestination,
491
360
  };
492
361
  }
362
+ createCellCsv(cellContent) {
363
+ return {
364
+ data: {
365
+ value: cellContent != undefined ? String(cellContent) : null,
366
+ },
367
+ };
368
+ }
369
+ createCellExcel(cellContent, cellType) {
370
+ return {
371
+ data: {
372
+ value: cellContent != undefined ? String(cellContent) : null,
373
+ type: cellType,
374
+ },
375
+ };
376
+ }
377
+ createCellHeader(cellContent) {
378
+ return {
379
+ data: {
380
+ value: cellContent != undefined ? String(cellContent) : null,
381
+ type: 'String',
382
+ },
383
+ };
384
+ }
385
+ getExternalReportData(externalReportName, reportFormat, exportDestination) {
386
+ const externalReport = this.getExportApi()
387
+ .getExternalReports()
388
+ ?.find((cr) => cr.name == externalReportName);
389
+ if (!externalReport) {
390
+ this.logWarn(`External Report '${externalReportName}' not found!`);
391
+ return undefined;
392
+ }
393
+ return externalReport.onExport({
394
+ ...this.buildBaseExportContext(externalReportName, reportFormat, exportDestination),
395
+ convertToExcel: this.buildExcelConverter(externalReportName, reportFormat, exportDestination),
396
+ convertToCsv: this.buildCsvConverter(externalReportName, reportFormat, exportDestination),
397
+ getGridReportColumns: this.buildGridReportColumns(),
398
+ });
399
+ }
400
+ buildGridReportColumns() {
401
+ return () => this.getAdaptableApi().columnApi.getColumns();
402
+ }
403
+ buildExcelConverter(externalReportName, reportFormat, exportDestination) {
404
+ return (reportData) => {
405
+ return this.executeGridExport(reportData, externalReportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsExcel({ ...exportParams }));
406
+ };
407
+ }
408
+ buildCsvConverter(externalReportName, reportFormat, exportDestination) {
409
+ return (reportData) => {
410
+ const csvParams = this.buildCsvExportParams(externalReportName, reportFormat, exportDestination);
411
+ return this.executeGridExport(reportData, externalReportName, reportFormat, exportDestination, (gridApi, exportParams) => gridApi.getDataAsCsv({ ...exportParams, ...csvParams }));
412
+ };
413
+ }
414
+ executeGridExport(reportData, externalReportName, reportFormat, exportDestination, exportFn) {
415
+ const htmlDivElement = document.createElement('div');
416
+ let ephemeralGridApi = null;
417
+ try {
418
+ const columnDefs = reportData.columns.map((col) => ({
419
+ colId: col.columnId,
420
+ field: col.field ?? col.columnId,
421
+ headerName: col.friendlyName ?? col.columnId,
422
+ type: col.dataType ?? 'text',
423
+ }));
424
+ const gridOptions = { columnDefs, rowData: reportData.rows };
425
+ const gridParams = {
426
+ modules: this.getAdaptableApi()
427
+ .internalApi.getAdaptableInstance()
428
+ .getAgGridRegisteredModules(),
429
+ };
430
+ htmlDivElement.style.display = 'none';
431
+ document.body.appendChild(htmlDivElement);
432
+ ephemeralGridApi = createGrid(htmlDivElement, gridOptions, gridParams);
433
+ const exportParams = {
434
+ fileName: this.getReportFileName(externalReportName, reportFormat, exportDestination),
435
+ allColumns: true,
436
+ exportedRows: 'all',
437
+ };
438
+ return exportFn(ephemeralGridApi, exportParams);
439
+ }
440
+ catch (error) {
441
+ this.logWarn('Failed to export data:', error);
442
+ return null;
443
+ }
444
+ finally {
445
+ if (ephemeralGridApi) {
446
+ ephemeralGridApi.destroy();
447
+ }
448
+ if (htmlDivElement?.parentNode) {
449
+ document.body.removeChild(htmlDivElement);
450
+ }
451
+ }
452
+ }
453
+ buildCsvExportParams(externalReportName, reportFormat, exportDestination) {
454
+ const exportOptions = this.getAdaptableApi().optionsApi.getExportOptions();
455
+ const csvSeparator = typeof exportOptions.csvSeparator === 'function'
456
+ ? exportOptions.csvSeparator(this.buildBaseExportContext(externalReportName, reportFormat, exportDestination))
457
+ : exportOptions.csvSeparator;
458
+ return {
459
+ columnSeparator: csvSeparator,
460
+ };
461
+ }
493
462
  }
@@ -187,7 +187,7 @@ export class RowFormInternalApi extends ApiBase {
187
187
  }
188
188
  const returnValues = this.getGridApi().internalApi.getDistinctDisplayValuesForColumnOld(column.columnId);
189
189
  // FIXME add support for asynchronous custom select cell editor values
190
- // it involves refactoring the AdaptableForm & AdapatableFormComponent
190
+ // it involves refactoring the AdaptableForm & adaptableFormComponent
191
191
  // await this.getSelectCellEditorValuesForColumn(
192
192
  // column,
193
193
  // gridCell
@@ -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
@@ -1,16 +1,16 @@
1
- import isAfter from 'date-fns/isAfter';
2
- import isBefore from 'date-fns/isBefore';
3
- import isEqual from 'date-fns/isEqual';
4
- import isFuture from 'date-fns/isFuture';
5
- import isPast from 'date-fns/isPast';
6
- import isSameDay from 'date-fns/isSameDay';
7
- import isThisMonth from 'date-fns/isThisMonth';
8
- import isThisQuarter from 'date-fns/isThisQuarter';
9
- import isThisWeek from 'date-fns/isThisWeek';
10
- import isThisYear from 'date-fns/isThisYear';
11
- import isToday from 'date-fns/isToday';
12
- import isTomorrow from 'date-fns/isTomorrow';
13
- import isYesterday from 'date-fns/isYesterday';
1
+ import { isAfter } from 'date-fns';
2
+ import { isBefore } from 'date-fns';
3
+ import { isEqual } from 'date-fns';
4
+ import { isFuture } from 'date-fns';
5
+ import { isPast } from 'date-fns';
6
+ import { isSameDay } from 'date-fns';
7
+ import { isThisMonth } from 'date-fns';
8
+ import { isThisQuarter } from 'date-fns';
9
+ import { isThisWeek } from 'date-fns';
10
+ import { isThisYear } from 'date-fns';
11
+ import { isToday } from 'date-fns';
12
+ import { isTomorrow } from 'date-fns';
13
+ import { isYesterday } from 'date-fns';
14
14
  import StringExtensions from '../../Utilities/Extensions/StringExtensions';
15
15
  import { parseDateValue } from '../../Utilities/Helpers/DateHelper';
16
16
  import Helper from '../../Utilities/Helpers/Helper';
@@ -266,22 +266,6 @@ export const SystemPredicateDefs = [
266
266
  toString: ({ inputs }) => `Not Between ${inputs[0] ?? ''}:${inputs[1]}`,
267
267
  shortcuts: ['!:'],
268
268
  },
269
- {
270
- id: 'IsNumeric',
271
- label: 'Is Numeric',
272
- icon: { text: '1' },
273
- columnScope: { DataTypes: ['number'] },
274
- moduleScope: ['alert', 'flashingcell'],
275
- handler: ({ value }) => !isNaN(Number(value)),
276
- },
277
- {
278
- id: 'IsNotNumeric',
279
- label: 'Is Not Numeric',
280
- icon: { text: '1' },
281
- columnScope: { DataTypes: ['number'] },
282
- moduleScope: ['alert', 'flashingcell'],
283
- handler: ({ value }) => isNaN(Number(value)),
284
- },
285
269
  // String System Filters
286
270
  {
287
271
  id: 'Is',
@@ -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
  */
@@ -72,4 +72,4 @@ export type SystemFlashingCellPredicateIds = SystemFlashingCellPredicateId[];
72
72
  /**
73
73
  * List of System Predicates available for Flashing Cells
74
74
  */
75
- export type SystemFlashingCellPredicateId = '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';
75
+ export type SystemFlashingCellPredicateId = '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';
@@ -51,7 +51,7 @@ export interface LayoutBase extends AdaptableObject {
51
51
  */
52
52
  ColumnHeaders?: ColumnStringMap;
53
53
  /**
54
- * Whether to include aggFunc name in the Column header: e.g. 'sum(Price)' will just be 'Price'
54
+ * Whether to include aggFunc name in Column header: e.g. 'sum(Price)' becomes 'Price'
55
55
  */
56
56
  SuppressAggFuncInHeader?: boolean;
57
57
  /**
@@ -88,7 +88,7 @@ export interface TableLayout extends LayoutBase {
88
88
  */
89
89
  RowSummaries?: RowSummary[];
90
90
  /**
91
- * Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or 'true' (to use default aggfunc)
91
+ * Columns showing aggregated values in Grouped Rows; a record of ColumnId and aggfunc (e.g. sum) or 'true' (to use default aggfunc)
92
92
  */
93
93
  TableAggregationColumns?: TableAggregationColumns;
94
94
  /**
@@ -100,19 +100,19 @@ export interface TableLayout extends LayoutBase {
100
100
  */
101
101
  RowGroupDisplayType?: 'single' | 'multi';
102
102
  /**
103
- * Pivot Columns - can NOT be provided
103
+ * Pivot Columns - must NOT be provided
104
104
  */
105
105
  PivotColumns?: never;
106
106
  /**
107
- * Pivot Group Columns - can NOT be provided
107
+ * Pivot Group Columns - must NOT be provided
108
108
  */
109
109
  PivotGroupedColumns?: never;
110
110
  /**
111
- * Pivot Expansions - can NOT be provided
111
+ * Pivot Expansions - must NOT be provided
112
112
  */
113
113
  PivotExpandLevel?: never;
114
114
  /**
115
- * Pivot Aggregation Columns - can NOT be provided
115
+ * Pivot Aggregation Columns - must NOT be provided
116
116
  */
117
117
  PivotAggregationColumns?: never;
118
118
  }
@@ -125,7 +125,7 @@ export interface PivotLayout extends LayoutBase {
125
125
  */
126
126
  PivotColumns: string[];
127
127
  /**
128
- * How deep to expand Pivots
128
+ * How deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all)
129
129
  */
130
130
  PivotExpandLevel?: number;
131
131
  /**
@@ -137,31 +137,31 @@ export interface PivotLayout extends LayoutBase {
137
137
  */
138
138
  PivotGroupedColumns?: string[];
139
139
  /**
140
- * Table Columns - can NOT be provided
140
+ * Table Columns - must NOT be provided
141
141
  */
142
142
  TableColumns?: never;
143
143
  /**
144
- * Table Aggregation Columns - can NOT be provided
144
+ * Table Aggregation Columns - must NOT be provided
145
145
  */
146
146
  TableAggregationColumns?: never;
147
147
  /**
148
- * Row Grouped Columns Columns - can NOT be provided
148
+ * Row Grouped Columns Columns - must NOT be provided
149
149
  */
150
150
  RowGroupedColumns?: never;
151
151
  }
152
- /**
153
- * Object used for defining which Row Group Values are Expanded or Collapsed
154
- */
155
- export type RowGroupValuesWithExceptionKeys = {
156
- RowGroupDefaultBehavior: 'expanded' | 'collapsed';
157
- ExceptionGroupKeys?: any[][];
158
- };
159
152
  /**
160
153
  * Manages how (and which) Row Group values are stored
161
154
  */
162
155
  export type RowGroupValues = {
163
156
  RowGroupDefaultBehavior: 'always-expanded' | 'always-collapsed';
164
157
  } | RowGroupValuesWithExceptionKeys;
158
+ /**
159
+ * Defines which Row Group Values are expanded or collapsed
160
+ */
161
+ export type RowGroupValuesWithExceptionKeys = {
162
+ RowGroupDefaultBehavior: 'expanded' | 'collapsed';
163
+ ExceptionGroupKeys?: any[][];
164
+ };
165
165
  /**
166
166
  * Defines a map of Columns with a String value
167
167
  */
@@ -32,7 +32,7 @@ export interface StyledColumn extends SuspendableObject {
32
32
  /**
33
33
  * Displays a Sparkline Chart in an array column
34
34
  */
35
- SparkLineStyle?: SparklineStyle;
35
+ SparklineStyle?: SparklineStyle;
36
36
  /**
37
37
  * Displays cell values in Column as a Badge
38
38
  */
@@ -99,7 +99,8 @@ export interface LayoutColumnFilterEditAction extends LayoutColumnFilterAction {
99
99
  }
100
100
  export interface LayoutColumnFilterSetAction extends LayoutColumnFilterAction {
101
101
  }
102
- export interface LayoutColumnFilterClearAction extends LayoutColumnFilterAction {
102
+ export interface LayoutColumnFilterClearAction extends Redux.Action {
103
+ columnId: string;
103
104
  }
104
105
  export interface LayoutColumnFilterClearAllAction extends Redux.Action {
105
106
  }
@@ -121,7 +122,7 @@ export declare const LayoutColumnFilterAdd: (columnFilter: ColumnFilter) => Layo
121
122
  export declare const LayoutColumnFilterEdit: (columnFilter: ColumnFilter) => LayoutColumnFilterEditAction;
122
123
  export declare const LayoutColumnFilterSet: (columnFilter: ColumnFilter) => LayoutColumnFilterSetAction;
123
124
  export declare const LayoutColumnFilterClearAll: () => LayoutColumnFilterClearAllAction;
124
- export declare const LayoutColumnFilterClear: (columnFilter: ColumnFilter) => LayoutColumnFilterClearAction;
125
+ export declare const LayoutColumnFilterClear: (columnId: string) => LayoutColumnFilterClearAction;
125
126
  export declare const LayoutColumnFilterSuspend: (columnFilter: ColumnFilter) => LayoutColumnFilterSuspendAction;
126
127
  export declare const LayoutColumnFilterUnSuspend: (columnFilter: ColumnFilter) => LayoutColumnFilterUnSuspendAction;
127
128
  export declare const LayoutColumnFilterSuspendAll: () => LayoutColumnFilterSuspendAllAction;
@@ -180,7 +181,7 @@ export declare const getCurrentLayoutSelector: (state: AdaptableState) => Layout
180
181
  export declare const getColumnFilterSelector: (state: AdaptableState, columnId: string) => {
181
182
  ColumnId: string;
182
183
  Predicates: import("../../types").ColumnFilterPredicate[];
183
- PredicatesLogic?: "AND" | "OR";
184
+ PredicatesOperator?: import("../../types").PredicatesOperator;
184
185
  IsSuspended?: boolean;
185
186
  Uuid?: string;
186
187
  Source?: "Config" | "User";
@@ -105,9 +105,9 @@ export const LayoutColumnFilterSet = (columnFilter) => ({
105
105
  export const LayoutColumnFilterClearAll = () => ({
106
106
  type: LAYOUT_COLUMN_FILTER_CLEAR_ALL,
107
107
  });
108
- export const LayoutColumnFilterClear = (columnFilter) => ({
108
+ export const LayoutColumnFilterClear = (columnId) => ({
109
109
  type: LAYOUT_COLUMN_FILTER_CLEAR,
110
- columnFilter,
110
+ columnId,
111
111
  });
112
112
  export const LayoutColumnFilterSuspend = (columnFilter) => ({
113
113
  type: LAYOUT_COLUMN_FILTER_SUSPEND,
@@ -338,7 +338,7 @@ export const LayoutReducer = (state = initialState, action) => {
338
338
  const actionTypedDelete = action;
339
339
  const columnFilters = (currentLayout.ColumnFilters ?? []).filter((cf) => {
340
340
  // make sure we are deleting all filters on the same column
341
- return cf.ColumnId !== actionTypedDelete.columnFilter.ColumnId;
341
+ return cf.ColumnId !== actionTypedDelete.columnId;
342
342
  });
343
343
  const Layouts = state.Layouts.map((layout) => {
344
344
  if (layout.Name === currentLayout.Name) {