@adaptabletools/adaptable-cjs 19.0.0 → 19.0.2

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 (73) hide show
  1. package/README.md +1 -2
  2. package/base.css +1 -1
  3. package/base.css.map +1 -1
  4. package/index.css +1 -1
  5. package/index.css.map +1 -1
  6. package/package.json +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
  8. package/src/AdaptableOptions/ActionRowOptions.d.ts +2 -2
  9. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
  10. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -2
  11. package/src/Api/AlertApi.d.ts +8 -0
  12. package/src/Api/ColumnApi.d.ts +18 -15
  13. package/src/Api/CustomSortApi.d.ts +8 -0
  14. package/src/Api/DataChangeHistoryApi.d.ts +5 -0
  15. package/src/Api/Events/GridSorted.d.ts +3 -3
  16. package/src/Api/Events/LiveDataChanged.d.ts +1 -1
  17. package/src/Api/FlashingCellApi.d.ts +25 -12
  18. package/src/Api/FormatColumnApi.d.ts +8 -0
  19. package/src/Api/GridApi.d.ts +53 -2
  20. package/src/Api/Implementation/AlertApiImpl.d.ts +2 -0
  21. package/src/Api/Implementation/AlertApiImpl.js +6 -0
  22. package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -2
  23. package/src/Api/Implementation/ColumnApiImpl.js +19 -30
  24. package/src/Api/Implementation/CustomSortApiImpl.d.ts +2 -0
  25. package/src/Api/Implementation/CustomSortApiImpl.js +6 -0
  26. package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +2 -0
  27. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +5 -0
  28. package/src/Api/Implementation/FlashingCellApiImpl.d.ts +3 -0
  29. package/src/Api/Implementation/FlashingCellApiImpl.js +9 -0
  30. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +2 -0
  31. package/src/Api/Implementation/FormatColumnApiImpl.js +6 -0
  32. package/src/Api/Implementation/GridApiImpl.d.ts +11 -2
  33. package/src/Api/Implementation/GridApiImpl.js +105 -1
  34. package/src/Api/Implementation/ShortcutApiImpl.d.ts +2 -0
  35. package/src/Api/Implementation/ShortcutApiImpl.js +6 -0
  36. package/src/Api/Implementation/StyledColumnApiImpl.d.ts +2 -0
  37. package/src/Api/Implementation/StyledColumnApiImpl.js +6 -0
  38. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +1 -0
  39. package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -0
  40. package/src/Api/Internal/ActionRowInternalApi.d.ts +1 -1
  41. package/src/Api/Internal/ActionRowInternalApi.js +10 -8
  42. package/src/Api/Internal/ExportInternalApi.d.ts +3 -3
  43. package/src/Api/Internal/ExportInternalApi.js +17 -13
  44. package/src/Api/Internal/GridFilterInternalApi.d.ts +1 -1
  45. package/src/Api/Internal/GridFilterInternalApi.js +5 -2
  46. package/src/Api/ShortcutApi.d.ts +8 -0
  47. package/src/Api/StyledColumnApi.d.ts +8 -0
  48. package/src/Api/UserInterfaceApi.d.ts +6 -2
  49. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +1 -1
  50. package/src/PredefinedConfig/Common/RowScope.d.ts +1 -1
  51. package/src/Redux/ActionsReducers/SystemRedux.js +3 -8
  52. package/src/Utilities/license/hashing.js +1 -1
  53. package/src/View/Dashboard/DashboardPopup.js +4 -3
  54. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +1 -0
  55. package/src/View/Layout/Wizard/getGridFilterPreview.js +1 -1
  56. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  57. package/src/View/Layout/Wizard/sections/GridFilterSection.js +1 -1
  58. package/src/agGrid/ActionColumnRenderer.d.ts +2 -0
  59. package/src/agGrid/ActionColumnRenderer.js +29 -3
  60. package/src/agGrid/AdaptableAgGrid.d.ts +1 -1
  61. package/src/agGrid/AdaptableAgGrid.js +22 -8
  62. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  63. package/src/agGrid/AgGridAdapter.js +12 -0
  64. package/src/agGrid/AgGridColumnAdapter.d.ts +2 -0
  65. package/src/agGrid/AgGridColumnAdapter.js +26 -13
  66. package/src/agGrid/PercentBarRenderer.js +1 -1
  67. package/src/agGrid/defaultAdaptableOptions.js +1 -0
  68. package/src/env.js +2 -2
  69. package/src/metamodel/adaptable.metamodel.js +1 -1
  70. package/src/types.d.ts +2 -2
  71. package/tsconfig.cjs.tsbuildinfo +1 -1
  72. package/src/agGrid/CheckboxRenderer.d.ts +0 -16
  73. package/src/agGrid/CheckboxRenderer.js +0 -94
@@ -495,7 +495,22 @@ class GridApiImpl extends ApiBase_1.ApiBase {
495
495
  if (gridCell.column.readOnly) {
496
496
  return false;
497
497
  }
498
- return this.adaptable.isCellEditable(gridCell.rowNode, this.adaptable.getAgGridColumnForColumnId(gridCell.column.columnId));
498
+ if (gridCell.rowNode && this.isSummaryNode(gridCell.rowNode)) {
499
+ return false;
500
+ }
501
+ const cellEditableFn = this.getEditOptions().isCellEditable;
502
+ if (cellEditableFn) {
503
+ const cellEditableContext = Object.assign({ gridCell }, this.getAdaptableApi().internalApi.buildBaseContext());
504
+ return cellEditableFn(cellEditableContext);
505
+ }
506
+ return true;
507
+ }
508
+ isCellEdited(gridCell) {
509
+ if (!gridCell) {
510
+ return false;
511
+ }
512
+ const cellDataChangedInfo = this.getDataChangeHistoryApi().getDataChangeForGridCell(gridCell);
513
+ return cellDataChangedInfo != null;
499
514
  }
500
515
  isEveryCellEditable(gridCells) {
501
516
  for (let gridCell of gridCells) {
@@ -508,6 +523,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
508
523
  getRowCount() {
509
524
  return this.adaptable.getRowCount();
510
525
  }
526
+ getVisibleRowCount() {
527
+ return this.adaptable.getVisibleRowCount();
528
+ }
511
529
  getRowsInViewport() {
512
530
  return this.adaptable.getRowsInViewport();
513
531
  }
@@ -559,5 +577,91 @@ class GridApiImpl extends ApiBase_1.ApiBase {
559
577
  getAllAgGridColumns() {
560
578
  return this.adaptable.getAllGridColumns();
561
579
  }
580
+ updateAgGridColumnState(columnState) {
581
+ const columnExists = this.getColumnApi().doesColumnExist(columnState.colId);
582
+ if (!columnExists) {
583
+ this.logWarn(`Column with id ${columnState.colId} does not exist, could NOT update configuration`);
584
+ return;
585
+ }
586
+ const agGridApi = this.adaptable.agGridAdapter.getAgGridApi();
587
+ agGridApi.applyColumnState({
588
+ state: [columnState],
589
+ });
590
+ }
591
+ updateAgGridColumnStates(columnStates) {
592
+ const existingColumnStates = columnStates.filter((cc) => this.getColumnApi().doesColumnExist(cc.colId));
593
+ const notExistingColumnIds = columnStates
594
+ .filter((cc) => !this.getColumnApi().doesColumnExist(cc.colId))
595
+ .map((cc) => cc.colId);
596
+ notExistingColumnIds.forEach((colId) => {
597
+ this.logWarn(`Column with id ${colId} does not exist, could NOT update configuration`);
598
+ });
599
+ const agGridApi = this.adaptable.agGridAdapter.getAgGridApi();
600
+ agGridApi.applyColumnState({
601
+ state: existingColumnStates,
602
+ });
603
+ }
604
+ setAgGridColumnDefinitions(columnDefinitions) {
605
+ const agGridApi = this.adaptable.agGridAdapter.getAgGridApi();
606
+ agGridApi.setGridOption('columnDefs', columnDefinitions);
607
+ this.adaptable.updateColumnModelAndRefreshGrid({ skipColDefsRefresh: true });
608
+ }
609
+ updateAgGridColumnDefinition(columnDefinitionToBeUpdated) {
610
+ const currentColDefs = [...this.adaptable.agGridAdapter.getAgGridApi().getColumnDefs()];
611
+ const columnId = columnDefinitionToBeUpdated.colId;
612
+ const doesColumnExist = this.getColumnApi().doesColumnExist(columnId);
613
+ if (!doesColumnExist) {
614
+ this.logWarn(`Column with id ${columnId} does not exist, will add it instead!`);
615
+ const newColDefs = [...currentColDefs, columnDefinitionToBeUpdated];
616
+ this.setAgGridColumnDefinitions(newColDefs);
617
+ return;
618
+ }
619
+ const updatedColDefs = this.adaptable.agGridAdapter.traverseColDefs(currentColDefs, (colDef) => {
620
+ return colDef.colId === columnId ? Object.assign(Object.assign({}, colDef), columnDefinitionToBeUpdated) : colDef;
621
+ });
622
+ this.setAgGridColumnDefinitions(updatedColDefs);
623
+ }
624
+ updateAgGridColumnDefinitions(columnDefinitionsToBeUpdated) {
625
+ const currentColDefs = [...this.adaptable.agGridAdapter.getAgGridApi().getColumnDefs()];
626
+ const updatedColDefs = this.adaptable.agGridAdapter.traverseColDefs(currentColDefs, (colDef) => {
627
+ const newColDef = newColumnDefinitions.find((c) => c.colId === colDef.colId);
628
+ return newColDef ? Object.assign(Object.assign({}, colDef), newColDef) : colDef;
629
+ });
630
+ // find out new columns which are not in the current column definitions
631
+ const currentColIds = [];
632
+ this.adaptable.agGridAdapter.traverseColDefs(currentColDefs, (colDef) => {
633
+ currentColIds.push(colDef.colId);
634
+ return colDef;
635
+ });
636
+ const newColumnDefinitions = columnDefinitionsToBeUpdated.filter((c) => !currentColIds.includes(c.colId));
637
+ if (newColumnDefinitions.length) {
638
+ this.logWarn(`Columns with ids ${newColumnDefinitions.map((c) => c.colId).join(', ')} do not exist, will add them instead!`);
639
+ }
640
+ this.setAgGridColumnDefinitions([...updatedColDefs, ...newColumnDefinitions]);
641
+ }
642
+ removeAgGridColumnDefinition(columnId) {
643
+ const doesColumnExist = this.getColumnApi().doesColumnExist(columnId);
644
+ if (!doesColumnExist) {
645
+ this.logWarn(`Column with id ${columnId} does not exist!`);
646
+ return;
647
+ }
648
+ const currentColDefs = this.adaptable.agGridAdapter.getAgGridApi().getColumnDefs();
649
+ const updatedColDefs = this.adaptable.agGridAdapter
650
+ .traverseColDefs(currentColDefs, (colDef) => {
651
+ return colDef.colId === columnId ? null : colDef;
652
+ })
653
+ .filter(Boolean);
654
+ this.setAgGridColumnDefinitions(updatedColDefs);
655
+ }
656
+ addAgGridColumnDefinition(newColumnDefinition) {
657
+ const currentColDefs = this.adaptable.agGridAdapter.getAgGridApi().getColumnDefs();
658
+ // just in case check of there is not already an existing column with the same id and eliminate it
659
+ const sanitizedColDefs = this.adaptable.agGridAdapter
660
+ .traverseColDefs(currentColDefs, (colDef) => {
661
+ return colDef.colId === newColumnDefinition.colId ? null : colDef;
662
+ })
663
+ .filter(Boolean);
664
+ this.setAgGridColumnDefinitions([...sanitizedColDefs, newColumnDefinition]);
665
+ }
562
666
  }
563
667
  exports.GridApiImpl = GridApiImpl;
@@ -14,5 +14,7 @@ export declare class ShortcutApiImpl extends ApiBase implements ShortcutApi {
14
14
  deleteAllShortcuts(): void;
15
15
  suspendShortcut(shortcut: Shortcut): Shortcut;
16
16
  unSuspendShortcut(shortcut: Shortcut): Shortcut;
17
+ suspendAllShortcut(): void;
18
+ unSuspendAllShortcut(): void;
17
19
  openShortcutSettingsPanel(): void;
18
20
  }
@@ -43,6 +43,12 @@ class ShortcutApiImpl extends ApiBase_1.ApiBase {
43
43
  this.dispatchAction(ShortcutRedux.ShortcutUnSuspend(shortcut));
44
44
  return this.getShortcutById(shortcut.Uuid);
45
45
  }
46
+ suspendAllShortcut() {
47
+ this.dispatchAction(ShortcutRedux.ShortcutSuspendAll());
48
+ }
49
+ unSuspendAllShortcut() {
50
+ this.dispatchAction(ShortcutRedux.ShortcutUnSuspendAll());
51
+ }
46
52
  openShortcutSettingsPanel() {
47
53
  this.showModulePopup(ModuleConstants.ShortcutModuleId);
48
54
  }
@@ -24,5 +24,7 @@ export declare class StyledColumnApiImpl extends ApiBase implements StyledColumn
24
24
  canDisplaySparklines(): boolean;
25
25
  suspendStyledColumn(styledColumn: StyledColumn): void;
26
26
  unSuspendStyledColumn(styledColumn: StyledColumn): void;
27
+ suspendAllStyledColumn(): void;
28
+ unSuspendAllStyledColumn(): void;
27
29
  openStyledColumnSettingsPanel(): void;
28
30
  }
@@ -67,6 +67,12 @@ class StyledColumnApiImpl extends ApiBase_1.ApiBase {
67
67
  unSuspendStyledColumn(styledColumn) {
68
68
  this.dispatchAction(StyledColumnRedux.StyledColumnUnSuspend(styledColumn));
69
69
  }
70
+ suspendAllStyledColumn() {
71
+ this.dispatchAction(StyledColumnRedux.StyledColumnSuspendAll());
72
+ }
73
+ unSuspendAllStyledColumn() {
74
+ this.dispatchAction(StyledColumnRedux.StyledColumnUnSuspendAll());
75
+ }
70
76
  openStyledColumnSettingsPanel() {
71
77
  this.showModulePopup(ModuleConstants.StyledColumnModuleId);
72
78
  }
@@ -26,6 +26,7 @@ export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfa
26
26
  getEditLookUpItemForColumn(column: AdaptableColumn): EditLookUpPermittedValues | undefined;
27
27
  getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues, gridCell: GridCell): any[] | undefined;
28
28
  getEditableCellStyle(): AdaptableStyle | undefined;
29
+ getEditedCellStyle(): AdaptableStyle | undefined;
29
30
  getReadOnlyCellStyle(): AdaptableStyle | undefined;
30
31
  getAdaptableObjectTags(): AdaptableObjectTag[] | undefined;
31
32
  getCustomIconDefinition(iconName: string): import("../../types").AdaptableIcon | import("../../types").CustomIcon;
@@ -146,6 +146,9 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
146
146
  getEditableCellStyle() {
147
147
  return this.getUserInterfaceOptions().editableCellStyle;
148
148
  }
149
+ getEditedCellStyle() {
150
+ return this.getUserInterfaceOptions().editedCellStyle;
151
+ }
149
152
  getReadOnlyCellStyle() {
150
153
  return this.getUserInterfaceOptions().readOnlyCellStyle;
151
154
  }
@@ -18,7 +18,7 @@ export declare class ActionRowInternalApi extends ApiBase {
18
18
  private buidActionRowButtons;
19
19
  private prepareCreateData;
20
20
  private prepareEditData;
21
- private isColumnEditable;
21
+ private isCellEditable;
22
22
  private buildFormField;
23
23
  private getFormFieldLabel;
24
24
  private buildFormFieldLabelContext;
@@ -53,7 +53,7 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
53
53
  .columnApi.getColumns()
54
54
  .filter((column) => {
55
55
  // if there is NO rowNode, do NOT display the non-editable fields as they will be empty
56
- return !!rowNode || this.isColumnEditable(column, rowNode);
56
+ return !!rowNode || this.isCellEditable(column, rowNode);
57
57
  })
58
58
  .filter((column) => !this.getAdaptableApi().columnApi.internalApi.isActionRowButtonColumn(column.columnId) &&
59
59
  this.showColumnInActionRowForm(column, actionRowType));
@@ -120,21 +120,23 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
120
120
  dataToSave[this.getOptions().primaryKey] = pkValue;
121
121
  return dataToSave;
122
122
  }
123
- isColumnEditable(column, rowNode) {
124
- return rowNode
125
- ? this.adaptableInstance.isCellEditable(rowNode, this.adaptableInstance.getAgGridColumnForColumnId(column.columnId))
126
- : !column.readOnly;
123
+ isCellEditable(column, rowNode) {
124
+ if (!rowNode) {
125
+ return !column.readOnly;
126
+ }
127
+ const gridCell = this.getAdaptableApi().gridApi.getGridCellFromRowNode(rowNode, column.columnId);
128
+ return this.getAdaptableApi().gridApi.isCellEditable(gridCell);
127
129
  }
128
130
  buildFormField(type, column, rowNode) {
129
- const isColumnEditable = this.isColumnEditable(column, rowNode);
131
+ const isCellEditable = this.isCellEditable(column, rowNode);
130
132
  const fieldValueOptions = this.getFieldValueOptions(column, rowNode);
131
- const fieldType = isColumnEditable
133
+ const fieldType = isCellEditable
132
134
  ? !!(fieldValueOptions === null || fieldValueOptions === void 0 ? void 0 : fieldValueOptions.length)
133
135
  ? 'select'
134
136
  : this.getFieldTypeFromColumnType(column)
135
137
  : 'textOutput';
136
138
  const defaultValue = rowNode
137
- ? isColumnEditable
139
+ ? isCellEditable
138
140
  ? this.getAdaptableApi().gridApi.getRawValueFromRowNode(rowNode, column.columnId)
139
141
  : this.getAdaptableApi().gridApi.getDisplayValueFromRowNode(rowNode, column.columnId)
140
142
  : null;
@@ -30,10 +30,10 @@ export declare class ExportInternalApi extends ApiBase {
30
30
  getReportData(report: Report, includePrimaryKey?: boolean): ReportData;
31
31
  getReportDataAsArray(report: Report, includePrimaryKey?: boolean): any[][];
32
32
  convertReportDataToArray(reportData: ReportData): any[][];
33
- getRowObjectForColumnIds(rowNode: IRowNode, columnIds: string[]): Record<string, any>;
33
+ getRowObjectForColumnIds(rowNode: IRowNode, columnIds: string[], reportName: string): Record<string, any>;
34
34
  publishLiveLiveDataChangedEvent(reportDestination: 'ipushpull' | 'OpenFin', liveDataTrigger: 'Connected' | 'Disconnected' | 'SnapshotSent' | 'LiveDataStarted' | 'LiveDataStopped' | 'LiveDataUpdated', liveReport?: any): void;
35
- getCellExportValueFromRowNode(rowNode: IRowNode, columnId: string): any;
36
- getCellExportValueFromRawValue(rowNode: IRowNode, cellRawValue: any, columnId: string): any;
35
+ getCellExportValueFromRowNode(rowNode: IRowNode, columnId: string, reportName: string): any;
36
+ getCellExportValueFromRawValue(rowNode: IRowNode, cellRawValue: any, columnId: string, reportName: string): any;
37
37
  getReportFileName(reportName: string, destination: SystemExportDestination | CustomDestination): string;
38
38
  private getCustomExportDateFormat;
39
39
  private getCellExportValueFromRawValueByType;
@@ -365,12 +365,12 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
365
365
  switch (report.ReportRowScope) {
366
366
  case 'AllRows':
367
367
  this.getAdaptableApi().internalApi.forAllRowNodesDo((rowNode) => {
368
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds));
368
+ resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
369
369
  });
370
370
  break;
371
371
  case 'VisibleRows':
372
372
  this.getAdaptableApi().internalApi.forAllVisibleRowNodesDo((rowNode) => {
373
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds));
373
+ resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
374
374
  });
375
375
  break;
376
376
  case 'ExpressionRows':
@@ -379,7 +379,7 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
379
379
  if (this.getAdaptableApi()
380
380
  .internalApi.getQueryLanguageService()
381
381
  .evaluateBooleanExpression((_a = report.Query) === null || _a === void 0 ? void 0 : _a.BooleanExpression, ModuleConstants_1.ExportModuleId, rowNode)) {
382
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds));
382
+ resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
383
383
  }
384
384
  });
385
385
  break;
@@ -394,7 +394,7 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
394
394
  if (selectedRowCells) {
395
395
  const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.column.columnId);
396
396
  const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
397
- const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds);
397
+ const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds, report.Name);
398
398
  if (includePrimaryKey) {
399
399
  row[this.getAdaptableApi().optionsApi.getPrimaryKey()] = rowPrimaryKeyValue;
400
400
  }
@@ -409,7 +409,7 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
409
409
  this.getAdaptableApi().internalApi.forAllRowNodesDo((rowNode) => {
410
410
  const rowPrimaryKeyValue = this.getAdaptableApi().gridApi.getPrimaryKeyValueForRowNode(rowNode);
411
411
  if (selectedGridRowPrimaryKeys.includes(rowPrimaryKeyValue)) {
412
- resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds));
412
+ resultRowData.push(this.getRowObjectForColumnIds(rowNode, columnIds, report.Name));
413
413
  }
414
414
  });
415
415
  }
@@ -435,9 +435,9 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
435
435
  ...reportData.rows.map((row) => reportData.columns.map((column) => row[column.columnId])),
436
436
  ];
437
437
  }
438
- getRowObjectForColumnIds(rowNode, columnIds) {
438
+ getRowObjectForColumnIds(rowNode, columnIds, reportName) {
439
439
  return columnIds.reduce((result, columnId) => {
440
- result[columnId] = this.getCellExportValueFromRowNode(rowNode, columnId);
440
+ result[columnId] = this.getCellExportValueFromRowNode(rowNode, columnId, reportName);
441
441
  return result;
442
442
  }, {});
443
443
  }
@@ -445,24 +445,28 @@ class ExportInternalApi extends ApiBase_1.ApiBase {
445
445
  const liveDataChangedInfo = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { reportDestination: reportDestination, liveDataTrigger: liveDataTrigger, liveReport: liveReport });
446
446
  this.getAdaptableApi().eventApi.emit('LiveDataChanged', liveDataChangedInfo);
447
447
  }
448
- getCellExportValueFromRowNode(rowNode, columnId) {
449
- return this.getCellExportValueFromRawValue(rowNode, this.getAdaptableApi().gridApi.getRawValueFromRowNode(rowNode, columnId), columnId);
448
+ getCellExportValueFromRowNode(rowNode, columnId, reportName) {
449
+ return this.getCellExportValueFromRawValue(rowNode, this.getAdaptableApi().gridApi.getRawValueFromRowNode(rowNode, columnId), columnId, reportName);
450
450
  }
451
- getCellExportValueFromRawValue(rowNode, cellRawValue, columnId) {
451
+ getCellExportValueFromRawValue(rowNode, cellRawValue, columnId, reportName) {
452
452
  if (StringExtensions_1.default.IsNullOrEmpty(cellRawValue)) {
453
453
  return cellRawValue;
454
454
  }
455
455
  const column = this.getAdaptableApi().columnApi.getColumnWithColumnId(columnId);
456
456
  const columnDataType = column.dataType;
457
- // if this is a date column and there is a custom export date format provided, that will take precedence
457
+ // 1. if it is a Visual Data report then we always ONLY send the formatted value and ignore all other properties
458
+ if (reportName == GeneralConstants_1.VISUAL_DATA_REPORT) {
459
+ return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, 'formattedValue');
460
+ }
461
+ // 2. if this is a date column and there is a custom export date format provided, that will next take precedence
458
462
  if (columnDataType === 'Date' && !!this.getCustomExportDateFormat()) {
459
463
  const exportDateFormat = this.getCustomExportDateFormat();
460
464
  return FormatHelper_1.default.DateFormatter(cellRawValue, {
461
465
  Pattern: exportDateFormat,
462
466
  });
463
467
  }
464
- // otherwise check the general export format types
465
- let cellExportFormat = this.getAdaptableApi().exportApi.internalApi.getCellExportFormatType(column, columnDataType);
468
+ // 3. in all other cases check the general export format types
469
+ const cellExportFormat = this.getAdaptableApi().exportApi.internalApi.getCellExportFormatType(column, columnDataType);
466
470
  return this.getCellExportValueFromRawValueByType(rowNode, cellRawValue, columnId, cellExportFormat);
467
471
  }
468
472
  getReportFileName(reportName, destination) {
@@ -3,7 +3,7 @@ import { GridFilter } from '../../types';
3
3
  export declare class GridFilterInternalApi extends ApiBase {
4
4
  fireGridFilterAppliedEvent(): void;
5
5
  /**
6
- * Compares to Grid Filters to see if they are identical
6
+ * Compares to Grid Filter to see if they are identical
7
7
  */
8
8
  isGridFilterDifferent(oldFilter: GridFilter, newFilter: GridFilter): boolean;
9
9
  }
@@ -14,10 +14,13 @@ class GridFilterInternalApi extends ApiBase_1.ApiBase {
14
14
  }
15
15
  }
16
16
  /**
17
- * Compares to Grid Filters to see if they are identical
17
+ * Compares to Grid Filter to see if they are identical
18
18
  */
19
19
  isGridFilterDifferent(oldFilter, newFilter) {
20
- return (oldFilter === null || oldFilter === void 0 ? void 0 : oldFilter.Expression) === (newFilter === null || newFilter === void 0 ? void 0 : newFilter.Expression);
20
+ if (oldFilter == undefined && newFilter == undefined) {
21
+ return false;
22
+ }
23
+ return (oldFilter === null || oldFilter === void 0 ? void 0 : oldFilter.Expression) !== (newFilter === null || newFilter === void 0 ? void 0 : newFilter.Expression);
21
24
  }
22
25
  }
23
26
  exports.GridFilterInternalApi = GridFilterInternalApi;
@@ -53,6 +53,14 @@ export interface ShortcutApi {
53
53
  * @returns shortcut
54
54
  */
55
55
  unSuspendShortcut(shortcut: Shortcut): Shortcut;
56
+ /**
57
+ * Suspends all Shortcuts
58
+ */
59
+ suspendAllShortcut(): void;
60
+ /**
61
+ * Activates all suspended Shortcut
62
+ */
63
+ unSuspendAllShortcut(): void;
56
64
  /**
57
65
  * Opens Settings Panel with Shortcut section selected and visible
58
66
  */
@@ -57,6 +57,14 @@ export interface StyledColumnApi {
57
57
  * @param styledColumn
58
58
  */
59
59
  unSuspendStyledColumn(styledColumn: StyledColumn): void;
60
+ /**
61
+ * Suspends all Styled Columns
62
+ */
63
+ suspendAllStyledColumn(): void;
64
+ /**
65
+ * Activates all suspended Styled Column
66
+ */
67
+ unSuspendAllStyledColumn(): void;
60
68
  /**
61
69
  * Checks whether Column with given `columnId` has a PercentBar Style applied
62
70
  * @param columnId column ID
@@ -55,11 +55,15 @@ export interface UserInterfaceApi {
55
55
  */
56
56
  getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues, gridCell: GridCell): any[] | undefined;
57
57
  /**
58
- * Returns Style set for Editable cells
58
+ * Returns Style set for Editable Cells
59
59
  */
60
60
  getEditableCellStyle(): AdaptableStyle | undefined;
61
61
  /**
62
- * Returns Style set for ReadOnly cells
62
+ * Returns Style for Cells that have been edited
63
+ */
64
+ getEditedCellStyle(): AdaptableStyle | undefined;
65
+ /**
66
+ * Returns Style set for ReadOnly Cells
63
67
  */
64
68
  getReadOnlyCellStyle(): AdaptableStyle | undefined;
65
69
  /**
@@ -43,7 +43,7 @@ export interface NumberFormatterOptions extends BaseFormatterOptions {
43
43
  */
44
44
  Suffix?: string;
45
45
  /**
46
- * Replaces cell value with supplied value (that can contain placeholders)
46
+ * Replaces cell value with supplied value (that can contain Template Literals)
47
47
  */
48
48
  Content?: string | number;
49
49
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Defines which types of Rows to exclude when rendering Format Columns, Action Columns, Badges
2
+ * Defines which types of Rows to exclude when rendering Format Columns, Action Columns and Badges
3
3
  */
4
4
  export type RowScope = {
5
5
  /**
@@ -536,10 +536,8 @@ const SystemReducer = (state = initialState, action) => {
536
536
  });
537
537
  const AdaptableFlashingCellsMap = Object.assign({}, state.AdaptableFlashingCellsMap);
538
538
  AdaptableFlashingCellsMap[FlashingCell.Uuid] = FlashingCell;
539
- return Object.assign({}, state, {
540
- AdaptableFlashingCells: AdaptableFlashingCells,
541
- AdaptableFlashingCellsMap: AdaptableFlashingCellsMap,
542
- });
539
+ return Object.assign(Object.assign({}, state), { AdaptableFlashingCells,
540
+ AdaptableFlashingCellsMap });
543
541
  }
544
542
  case exports.SYSTEM_FLASHING_CELL_DELETE: {
545
543
  const { flashingCell: FlashingCell } = action;
@@ -563,10 +561,7 @@ const SystemReducer = (state = initialState, action) => {
563
561
  return Object.assign(Object.assign({}, state), { AdaptableFlashingCells: AdaptableFlashingCells, AdaptableFlashingCellsMap: AdaptableFlashingCellsMap });
564
562
  }
565
563
  case exports.SYSTEM_FLASHING_CELL_DELETE_ALL: {
566
- return Object.assign({}, state, {
567
- AdaptableFlashingCells: {},
568
- AdaptableFlashingCellsMap: {},
569
- });
564
+ return Object.assign(Object.assign({}, state), { AdaptableFlashingCells: {}, AdaptableFlashingCellsMap: {} });
570
565
  }
571
566
  case exports.SYSTEM_HIGHLIGHT_CELL_ADD: {
572
567
  const actionTypedAdd = action;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compute_string=void 0;const r=3988292384;function t(t=r){var e,n,o,u=new Array;for(e=0;e<256;e++){for(o=e,n=8;n>0;n--)1&~o?o>>>=1:o=o>>>1^t;u[e]=o}return u}function e(){return 4294967295}function n(r,t,e){return t=t>>>8^r[e^255&t]}function o(r){return r=(r=~r)<0?4294967295+r+1:r}function u(u,c=r){var i,f=t(c),s=0;for(s=e(),i=0;i<u.length;i++)s=n(f,s,u.charCodeAt(i));return`${s=o(s)}`}exports.compute_string=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compute_string=void 0;const r=3988292384;function t(r=3988292384){var t,e,n,o=new Array;for(t=0;t<256;t++){for(n=t,e=8;e>0;e--)1&~n?n>>>=1:n=n>>>1^r;o[t]=n}return o}function e(){return 4294967295}function n(r,t,e){return t=t>>>8^r[e^255&t]}function o(r){return r=(r=~r)<0?4294967295+r+1:r}function u(r,u=3988292384){var c,i=t(u),f=0;for(f=e(),c=0;c<r.length;c++)f=n(i,f,r.charCodeAt(c));return`${f=o(f)}`}exports.compute_string=u;
@@ -76,9 +76,10 @@ class DashboardPopupComponent extends React.Component {
76
76
  React.createElement(CheckBox_1.CheckBox, { "data-name": "hidden", className: `${baseClassName}__settings-option`, checked: this.props.IsHidden, onChange: (checked) => this.props.onSetDashboardHidden(checked) }, "Hidden"))),
77
77
  React.createElement(Panel_1.default, { header: 'Dashboard Contents', style: { borderBottom: '1px solid var(--ab-color-primary)' }, variant: "default", borderRadius: "none", marginTop: 4 },
78
78
  React.createElement(rebass_1.Flex, { className: `${baseClassName}__contents-selector`, flexDirection: "row", padding: 2 },
79
- React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Toolbars, checked: this.state.DashboardConfigView == DashboardConfigView.Toolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Tabs & Toolbars"),
80
- React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Buttons, checked: this.state.DashboardConfigView == DashboardConfigView.Buttons, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Buttons"),
81
- React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.PinnedToolbars, checked: this.state.DashboardConfigView == DashboardConfigView.PinnedToolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Pinned Toolbars")),
79
+ React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Toolbars, checked: this.state.DashboardConfigView == DashboardConfigView.Toolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Tabbed Toolbars"),
80
+ React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.PinnedToolbars, checked: this.state.DashboardConfigView == DashboardConfigView.PinnedToolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Pinned Toolbars"),
81
+ ' ',
82
+ React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Buttons, checked: this.state.DashboardConfigView == DashboardConfigView.Buttons, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Buttons")),
82
83
  React.createElement(rebass_1.Box, { className: `${baseClassName}__Module-Selector`, "data-name": this.state.DashboardConfigView === DashboardConfigView.Toolbars
83
84
  ? 'toolbars'
84
85
  : 'buttons', style: { minHeight: 0, flex: '1 1 0' }, padding: 2 },
@@ -43,6 +43,7 @@ const GridInfoPopup = (props) => {
43
43
  returnRows.push(createReadOnlyColItem(colItems, 'Column Filters', columnFilterDescription));
44
44
  returnRows.push(createReadOnlyColItem(colItems, 'Grid Filter', gridFilterExpression));
45
45
  returnRows.push(createReadOnlyColItem(colItems, 'All Rows', props.api.gridApi.getRowCount()));
46
+ returnRows.push(createReadOnlyColItem(colItems, 'Visible Rows', props.api.gridApi.getVisibleRowCount()));
46
47
  returnRows.push(createReadOnlyColItem(colItems, 'Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.length));
47
48
  returnRows.push(createReadOnlyColItem(colItems, 'Visible Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.filter((gr) => { var _a; return ((_a = gr.rowNode) === null || _a === void 0 ? void 0 : _a.displayed) == true; }).length));
48
49
  returnRows.push(createReadOnlyColItem(colItems, 'All Columns', props.api.gridApi.getColumnCount()));
@@ -8,7 +8,7 @@ const Tag_1 = require("../../../components/Tag");
8
8
  const getGridFilterViewItems = (layout) => {
9
9
  var _a;
10
10
  return {
11
- name: 'Grid Filters',
11
+ name: 'Grid Filter',
12
12
  view: (React.createElement(Tag_1.Tag, null,
13
13
  React.createElement(ExpressionPreview_1.ExpressionPreview, { query: { BooleanExpression: (_a = layout.GridFilter) === null || _a === void 0 ? void 0 : _a.Expression } }))),
14
14
  };
@@ -190,7 +190,7 @@ const ColumnRow = (props) => {
190
190
  const ColumnsSection = (props) => {
191
191
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
192
192
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
193
- const allColumns = adaptable.api.columnApi.getColumns();
193
+ const allColumns = adaptable.api.columnApi.getStandardColumns();
194
194
  const sortedColumns = React.useMemo(() => {
195
195
  return ArrayExtensions_1.default.sortArrayWithOrder(allColumns.map((col) => col.columnId), layout.Columns, { sortUnorderedItems: false }).map((colId) => adaptable.api.columnApi.getColumnWithColumnId(colId));
196
196
  }, [layout, allColumns]);
@@ -39,7 +39,7 @@ const GridFilterSection = (props) => {
39
39
  props.onChange(Object.assign(Object.assign({}, layout), { GridFilter: Object.assign(Object.assign({}, layout.GridFilter), { Expression: expression }) }));
40
40
  }, initialData: initialData, columns: api.columnApi.getQueryableColumns(), fields: api.expressionApi.internalApi.getAvailableFields(), namedQueries: api.namedQueryApi.getNamedQueries(), api: api })));
41
41
  return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
42
- React.createElement(Tabs_1.Tabs.Tab, null, "Grid Filters"),
42
+ React.createElement(Tabs_1.Tabs.Tab, null, "Grid Filter"),
43
43
  React.createElement(Tabs_1.Tabs.Content, null,
44
44
  React.createElement(Panel_1.default, null, expressionEditorContent))));
45
45
  };
@@ -7,6 +7,8 @@ export declare class ActionColumnRenderer implements ICellRendererComp {
7
7
  private eGui;
8
8
  private eventListener;
9
9
  private unmountReactRoot?;
10
+ private layoutSwitchUnsubscribe?;
11
+ private actionButtons;
10
12
  init(params: ActionColumnCellRendererParams): void;
11
13
  render(): void;
12
14
  getGui(): HTMLElement;
@@ -6,6 +6,7 @@ const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButt
6
6
  const React = tslib_1.__importStar(require("react"));
7
7
  const useRerender_1 = require("../components/utils/useRerender");
8
8
  const renderWithAdaptableContext_1 = require("../View/renderWithAdaptableContext");
9
+ const LayoutRedux_1 = require("../Redux/ActionsReducers/LayoutRedux");
9
10
  const ActionButtons = (props) => {
10
11
  const { buttons, adaptableApi, context, rerender } = props;
11
12
  return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
@@ -69,6 +70,20 @@ const ReactActionColumnRenderer = (props) => {
69
70
  if (!shouldRender) {
70
71
  return null;
71
72
  }
73
+ // subscribe to the LayoutChange event and rerender on change
74
+ const unsubscribe = adaptable.api.eventApi.on('AdaptableStateChanged', (eventInfo) => {
75
+ if (eventInfo.actionName === LayoutRedux_1.LAYOUT_SELECT) {
76
+ if (eventInfo.oldState.Layout.CurrentLayout !== eventInfo.newState.Layout.CurrentLayout) {
77
+ rerender();
78
+ }
79
+ }
80
+ });
81
+ // unsubscribe on unmount
82
+ React.useEffect(() => {
83
+ return () => {
84
+ unsubscribe();
85
+ };
86
+ }, []);
72
87
  const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node, props.api);
73
88
  const buttonContext = Object.assign(Object.assign({ actionColumn, primaryKeyValue: pkValue, rowNode: props.node }, adaptable.api.internalApi.buildBaseContext()), { data: props.data });
74
89
  return (React.createElement("div", { className: "ab-ActionColumn" },
@@ -88,6 +103,7 @@ class ActionColumnRenderer {
88
103
  if (!actionColumn || !actionButtons.length) {
89
104
  return;
90
105
  }
106
+ this.actionButtons = actionButtons;
91
107
  // create the cell
92
108
  this.eGui = document.createElement('div');
93
109
  this.eGui.className = 'ab-ActionColumn';
@@ -119,13 +135,22 @@ class ActionColumnRenderer {
119
135
  const eGui = this.eGui;
120
136
  const doRender = () => {
121
137
  this.unmountReactRoot = adaptable.renderReactRoot((0, renderWithAdaptableContext_1.renderWithAdaptableContext)(ActionButtons({
122
- buttons: actionButtons,
138
+ buttons: this.actionButtons,
123
139
  context: buttonContext,
124
140
  rerender: doRender,
125
141
  adaptableApi: adaptable.api,
126
142
  }), adaptable), eGui);
127
143
  };
128
144
  this.render = doRender;
145
+ this.layoutSwitchUnsubscribe = adaptable.api.eventApi.on('AdaptableStateChanged', (eventInfo) => {
146
+ if (eventInfo.actionName === LayoutRedux_1.LAYOUT_SELECT) {
147
+ if (eventInfo.oldState.Layout.CurrentLayout !== eventInfo.newState.Layout.CurrentLayout) {
148
+ const { actionButtons: freshActionButtons } = adaptable.api.internalApi.getActionButtonsAndActionColumn(params.colDef);
149
+ this.actionButtons = freshActionButtons;
150
+ doRender();
151
+ }
152
+ }
153
+ });
129
154
  doRender();
130
155
  }
131
156
  // defined on init
@@ -143,8 +168,9 @@ class ActionColumnRenderer {
143
168
  }
144
169
  // gets called when the cell is removed from the grid
145
170
  destroy() {
146
- var _a;
147
- (_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
171
+ var _a, _b;
172
+ (_a = this.layoutSwitchUnsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
173
+ (_b = this.unmountReactRoot) === null || _b === void 0 ? void 0 : _b.call(this);
148
174
  // do cleanup, remove event listener from button
149
175
  if (this.eGui) {
150
176
  this.eGui.removeEventListener('click', this.eventListener);
@@ -249,7 +249,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
249
249
  getRowNodeByIndex(index: number): IRowNode;
250
250
  getAgGridStatusPanels(): import("@ag-grid-community/core").StatusPanelDef[];
251
251
  setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: IRowNode): void;
252
- isCellEditable(rowNode: IRowNode, column: Column): boolean;
253
252
  forAllRowNodesDo(func: (rowNode: IRowNode, rowIndex: number) => void, config?: {
254
253
  includeGroupRows?: boolean;
255
254
  filterFn?: (rowNode: IRowNode) => boolean;
@@ -285,6 +284,7 @@ export declare class AdaptableAgGrid implements IAdaptable {
285
284
  updateChart(chart: ChartDefinition): void;
286
285
  getChartModels(): import("@ag-grid-community/core").ChartModel[];
287
286
  getRowCount(): number;
287
+ getVisibleRowCount(): number;
288
288
  getColumnCount(): number;
289
289
  getVisibleColumnCount(): number;
290
290
  isGridGroupable(): boolean;