@adaptabletools/adaptable 18.1.8 → 18.1.10

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 (34) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
  3. package/src/AdaptableOptions/ContainerOptions.d.ts +7 -7
  4. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +5 -0
  5. package/src/Api/DataChangeHistoryApi.d.ts +6 -0
  6. package/src/Api/GridApi.d.ts +2 -0
  7. package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +2 -0
  8. package/src/Api/Implementation/DataChangeHistoryApiImpl.js +24 -3
  9. package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
  10. package/src/Api/Implementation/GridApiImpl.js +3 -0
  11. package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -0
  12. package/src/Api/Internal/AdaptableInternalApi.js +4 -0
  13. package/src/Api/Internal/GridInternalApi.js +12 -6
  14. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +9 -9
  15. package/src/Redux/ActionsReducers/SystemRedux.d.ts +9 -8
  16. package/src/Redux/ActionsReducers/SystemRedux.js +11 -11
  17. package/src/Strategy/DataChangeHistoryModule.js +1 -2
  18. package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +1 -0
  19. package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -0
  20. package/src/Utilities/Helpers/FormatContentHelper.d.ts +22 -0
  21. package/src/Utilities/Helpers/FormatContentHelper.js +34 -0
  22. package/src/Utilities/Helpers/FormatHelper.d.ts +0 -18
  23. package/src/Utilities/Helpers/FormatHelper.js +2 -34
  24. package/src/View/Alert/Wizard/AlertMessageWizardSection.js +4 -3
  25. package/src/View/Components/ExternalRenderer.js +3 -1
  26. package/src/View/Dashboard/CustomToolbar.js +3 -1
  27. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +32 -13
  28. package/src/agGrid/AdaptableAgGrid.d.ts +3 -0
  29. package/src/agGrid/AdaptableAgGrid.js +35 -2
  30. package/src/agGrid/AgGridMenuAdapter.js +15 -1
  31. package/src/agGrid/defaultAdaptableOptions.js +1 -0
  32. package/src/env.js +2 -2
  33. package/src/metamodel/adaptable.metamodel.js +1 -1
  34. package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "18.1.8",
3
+ "version": "18.1.10",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ChartModel, ChartRef, Column, GridApi, GridOptions, IRowNode, Module, RowModelType, StatusPanelDef } from '@ag-grid-community/core';
2
3
  import { AdaptableApi } from '../Api/AdaptableApi';
3
4
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
@@ -90,6 +91,7 @@ export interface IAdaptable {
90
91
  RowEditService: RowEditService;
91
92
  Fdc3Service: Fdc3Service;
92
93
  CellPopupService: CellPopupService;
94
+ _PRIVATE_adaptableJSXElement: JSX.Element;
93
95
  /**
94
96
  * INTERNAL ADAPTABLE EVENTS
95
97
  * These are not called externally - for that we use eventapi
@@ -178,6 +180,7 @@ export interface IAdaptable {
178
180
  getDisplayValueFromRawValue(rowNode: IRowNode, columnId: string, rawValue: any): string | undefined;
179
181
  getNormalisedValueFromRawValue(rawValue: any, column: AdaptableColumn): string | number | boolean | Date | unknown;
180
182
  getGridCellsForColumn(columnId: string, onlyVisibleRows?: boolean): GridCell[] | undefined;
183
+ getGridCellsForColumnTemp(columnId: string, onlyVisibleRows?: boolean): GridCell[] | undefined;
181
184
  getRowNodesForPrimaryKeys(primaryKeyValues: any[]): IRowNode[];
182
185
  getRowNodeForPrimaryKey(primaryKeyValue: any): IRowNode;
183
186
  getRowNodeByIndex(index: number): IRowNode;
@@ -3,42 +3,42 @@
3
3
  */
4
4
  export interface ContainerOptions {
5
5
  /**
6
- * Div containing AdapTable - string Id or HTMLElement
6
+ * Div containing AdapTable; string Id or HTMLElement
7
7
  *
8
8
  * @defaultValue "adaptable"
9
9
  * @gridInfoItem
10
10
  */
11
11
  adaptableContainer?: string | HTMLElement;
12
12
  /**
13
- * Div containing AG Grid instance - string Id or HTMLElement
13
+ * Div containing AG Grid instance; string Id or HTMLElement
14
14
  *
15
15
  * @defaultValue "grid"
16
16
  * @gridInfoItem
17
17
  */
18
18
  agGridContainer?: string | HTMLElement;
19
19
  /**
20
- * How long AdapTable waits for AG Grid before giving up connecting to it
20
+ * How long to wait for AG Grid before giving up trying to connect
21
21
  *
22
22
  * @defaultValue 60s
23
23
  * @gridInfoItem
24
24
  */
25
25
  agGridContainerWaitTimeout?: number;
26
26
  /**
27
- * Name of div where modals appear (if null, will be centre of page)
27
+ * Name of div where popups appear
28
28
  *
29
- * @defaultValue undefined
29
+ * @defaultValue undefined (centre of screen)
30
30
  * @gridInfoItem
31
31
  */
32
32
  modalContainer?: string | HTMLElement;
33
33
  /**
34
- * Div to show System Status messages - string Id or HTMLElement
34
+ * Div to show System Status messages; string Id or HTMLElement
35
35
  *
36
36
  * @defaultValue undefined
37
37
  * @gridInfoItem
38
38
  */
39
39
  systemStatusContainer?: string | HTMLElement;
40
40
  /**
41
- * Div to show Alerts - string Id or HTMLElement
41
+ * Div to display Alert messages; string Id or HTMLElement
42
42
  *
43
43
  * @defaultValue undefined
44
44
  * @gridInfoItem
@@ -25,6 +25,11 @@ export interface DataChangeHistoryOptions<TData = any> {
25
25
  * @defaultValue undefined
26
26
  */
27
27
  changeHistoryButton?: DataChangeHistoryButton<TData> | DataChangeHistoryButton<TData>[];
28
+ /**
29
+ * Whether to show all changes for each cell or just the last one
30
+ * @defaultValue true
31
+ */
32
+ showLastDataChangeOnly?: boolean;
28
33
  }
29
34
  /**
30
35
  * Built in `undo` or `clear` data change action
@@ -25,6 +25,12 @@ export interface DataChangeHistoryApi {
25
25
  * Retrieves all data changes which are currently available
26
26
  */
27
27
  getDataChangeHistoryLog(): CellDataChangedInfo[];
28
+ /**
29
+ * Adds item to Data Change History log
30
+ *
31
+ * @param dataChangeInfo the change to log
32
+ */
33
+ addDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
28
34
  /**
29
35
  * Reverts the provided data change to its previous value
30
36
  *
@@ -11,10 +11,12 @@ import { Column, IRowNode, RowModelType } from '@ag-grid-community/core';
11
11
  import { GridCellRange } from '../PredefinedConfig/Selection/GridCellRange';
12
12
  import { RowsHighlightInfo } from '../PredefinedConfig/Common/RowsHighlightInfo';
13
13
  import { TransposeConfig } from '../PredefinedConfig/Common/TransposeConfig';
14
+ import { AdaptableVariant } from '../AdaptableInterfaces/IAdaptable';
14
15
  /**
15
16
  * Provides access to important properites of AdapTable e.g. sorting, selected cells etc.
16
17
  */
17
18
  export interface GridApi {
19
+ getVariant(): AdaptableVariant;
18
20
  /**
19
21
  * Returns Grid section from AdapTable State
20
22
  */
@@ -7,7 +7,9 @@ export declare class DataChangeHistoryApiImpl extends ApiBase implements DataCha
7
7
  deactivateDataChangeHistory(): void;
8
8
  suspendDataChangeHistory(): void;
9
9
  getDataChangeHistoryLog(): CellDataChangedInfo[];
10
+ addDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
10
11
  undoDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
11
12
  clearDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
12
13
  openDataChangeHistorySettingsPanel(): void;
14
+ private getDataChangeHistoryKey;
13
15
  }
@@ -1,7 +1,22 @@
1
1
  import { ApiBase } from './ApiBase';
2
- import { SystemDataChangeHistoryClearRow, SystemDataChangeHistoryDisable, SystemDataChangeHistoryEnable, SystemDataChangeHistoryResume, SystemDataChangeHistorySuspend, SystemDataChangeHistoryUndo, } from '../../Redux/ActionsReducers/SystemRedux';
2
+ import { SystemDataChangeHistoryClearRow, SystemDataChangeHistoryDisable, SystemDataChangeHistoryEnable, SystemDataChangeHistoryResume, SystemDataChangeHistorySuspend, SystemDataChangeHistoryUndo, SystemDataChangeHistoryAdd, } from '../../Redux/ActionsReducers/SystemRedux';
3
3
  import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
4
4
  export class DataChangeHistoryApiImpl extends ApiBase {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.getDataChangeHistoryKey = (dataChangeInfo) => {
8
+ const columnId = dataChangeInfo.column.columnId;
9
+ const primaryKeyValue = dataChangeInfo.primaryKeyValue;
10
+ const changedAt = dataChangeInfo.changedAt;
11
+ const showLastDataChangeOnly = this.getAdaptableApi().optionsApi.getDataChangeHistoryOptions().showLastDataChangeOnly;
12
+ if (showLastDataChangeOnly) {
13
+ return JSON.stringify({ columnId, primaryKeyValue });
14
+ }
15
+ else {
16
+ return JSON.stringify({ columnId, primaryKeyValue, changedAt });
17
+ }
18
+ };
19
+ }
5
20
  getDataChangeHistoryMode() {
6
21
  return this.getAdaptableState().System.DataChangeHistory.currentMode;
7
22
  }
@@ -33,11 +48,17 @@ export class DataChangeHistoryApiImpl extends ApiBase {
33
48
  const changeLog = (_a = this.getAdaptableState().System.DataChangeHistory.logs) !== null && _a !== void 0 ? _a : {};
34
49
  return Object.values(changeLog);
35
50
  }
51
+ addDataChangeHistoryEntry(dataChangeInfo) {
52
+ const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
53
+ this.dispatchAction(SystemDataChangeHistoryAdd(dataChangeInfo, uniqueKey));
54
+ }
36
55
  undoDataChangeHistoryEntry(dataChangeInfo) {
37
- this.dispatchAction(SystemDataChangeHistoryUndo(dataChangeInfo));
56
+ const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
57
+ this.dispatchAction(SystemDataChangeHistoryUndo(dataChangeInfo, uniqueKey));
38
58
  }
39
59
  clearDataChangeHistoryEntry(dataChangeInfo) {
40
- this.dispatchAction(SystemDataChangeHistoryClearRow(dataChangeInfo));
60
+ const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
61
+ this.dispatchAction(SystemDataChangeHistoryClearRow(dataChangeInfo, uniqueKey));
41
62
  }
42
63
  openDataChangeHistorySettingsPanel() {
43
64
  this.showModulePopup(ModuleConstants.DataChangeHistoryModuleId);
@@ -12,12 +12,13 @@ import { Column, IRowNode, RowModelType } from '@ag-grid-community/core';
12
12
  import { GridCellRange } from '../../PredefinedConfig/Selection/GridCellRange';
13
13
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
14
14
  import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
15
- import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
15
+ import { AdaptableVariant, IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
16
16
  import { GridInternalApi } from '../Internal/GridInternalApi';
17
17
  import { TransposeConfig } from '../../PredefinedConfig/Common/TransposeConfig';
18
18
  export declare class GridApiImpl extends ApiBase implements GridApi {
19
19
  internalApi: GridInternalApi;
20
20
  constructor(adaptable: IAdaptable);
21
+ getVariant(): AdaptableVariant;
21
22
  getGridState(): GridState;
22
23
  loadGridData(dataSource: any): void;
23
24
  resetGridData(dataSource: any[]): void;
@@ -12,6 +12,9 @@ export class GridApiImpl extends ApiBase {
12
12
  super(adaptable);
13
13
  this.internalApi = new GridInternalApi(adaptable);
14
14
  }
15
+ getVariant() {
16
+ return this.adaptable.variant;
17
+ }
15
18
  getGridState() {
16
19
  return this.getAdaptableState().Grid;
17
20
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ApiBase } from '../Implementation/ApiBase';
2
3
  import { UIConfirmation } from '../../Utilities/Interface/MessagePopups';
3
4
  import { SystemState } from '../../PredefinedConfig/SystemState';
@@ -29,6 +30,7 @@ import { CellPopupService } from '../../Utilities/Services/CellPopupService';
29
30
  import { RowEditService } from '../../Utilities/Services/RowEditService';
30
31
  export declare class AdaptableInternalApi extends ApiBase {
31
32
  getSystemState(): SystemState;
33
+ getAdaptableJSXElement(): JSX.Element;
32
34
  showPopupConfirmation(confirmation: UIConfirmation): void;
33
35
  showPopupScreen(module: AdaptableModule, componentName: string, popupParams?: ModuleParams, popupProps?: {
34
36
  [key: string]: any;
@@ -12,6 +12,10 @@ export class AdaptableInternalApi extends ApiBase {
12
12
  getSystemState() {
13
13
  return this.getAdaptableState().System;
14
14
  }
15
+ getAdaptableJSXElement() {
16
+ var _a;
17
+ return (_a = this.adaptable._PRIVATE_adaptableJSXElement) !== null && _a !== void 0 ? _a : null;
18
+ }
15
19
  // Popup Redux Actions
16
20
  showPopupConfirmation(confirmation) {
17
21
  this.dispatchAction(PopupRedux.PopupShowConfirmation(confirmation));
@@ -111,17 +111,17 @@ export class GridInternalApi extends ApiBase {
111
111
  }
112
112
  shouldShowValuesCount(column) {
113
113
  const showValuesCount = this.getColumnFilterOptions().valuesFilterOptions.showValuesCount;
114
- let shouldShowValuesCount = false;
114
+ let returnValue = false;
115
115
  if (showValuesCount) {
116
116
  if (typeof showValuesCount === 'function') {
117
117
  const columnFilterContext = Object.assign({ column }, this.getAdaptableApi().internalApi.buildBaseContext());
118
- shouldShowValuesCount = showValuesCount(columnFilterContext);
118
+ returnValue = showValuesCount(columnFilterContext);
119
119
  }
120
120
  else {
121
- shouldShowValuesCount = showValuesCount;
121
+ returnValue = showValuesCount;
122
122
  }
123
123
  }
124
- return shouldShowValuesCount;
124
+ return returnValue;
125
125
  }
126
126
  async getDistinctFilterDisplayValuesForColumnForFiltersUI(columnId, filter, showFilteredRowsOnly) {
127
127
  const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
@@ -144,7 +144,13 @@ export class GridInternalApi extends ApiBase {
144
144
  addPredicateValues(params) {
145
145
  var _a, _b, _c, _d;
146
146
  const { valueOptions, column, shouldShowValuesCount, visibleRowsOnly } = params;
147
- const allGridCells = this.adaptable.getGridCellsForColumn(column.columnId, visibleRowsOnly);
147
+ const visibleGridCells = this.adaptable.getGridCellsForColumnTemp(column.columnId, visibleRowsOnly);
148
+ let allGridCells;
149
+ if (shouldShowValuesCount) {
150
+ allGridCells = visibleRowsOnly
151
+ ? visibleGridCells
152
+ : this.adaptable.getGridCellsForColumnTemp(column.columnId, this.getColumnFilterOptions().valuesFilterOptions.showCurrentlyFilteredValuesCount);
153
+ }
148
154
  const adaptableApi = this.getAdaptableApi();
149
155
  const predicateIds = adaptableApi.columnFilterApi.internalApi.getValuesFitlerPredicateIds(column);
150
156
  if (ArrayExtensions.IsNullOrEmpty(predicateIds)) {
@@ -157,7 +163,7 @@ export class GridInternalApi extends ApiBase {
157
163
  if (!visibleRowsOnly) {
158
164
  return true;
159
165
  }
160
- return this.isPredicateInVisibleCellValues(predicateId, allGridCells);
166
+ return this.isPredicateInVisibleCellValues(predicateId, visibleGridCells);
161
167
  })
162
168
  .map((predicateId) => {
163
169
  var _a;
@@ -35,19 +35,19 @@ export interface NumberFormatterOptions extends BaseFormatterOptions {
35
35
  */
36
36
  IntegerSeparator?: string;
37
37
  /**
38
- * Prefix to use before the number
38
+ * Prefix to use before cell value
39
39
  */
40
40
  Prefix?: string;
41
41
  /**
42
- * Suffix to use after the number
42
+ * Suffix to use after cell value
43
43
  */
44
44
  Suffix?: string;
45
45
  /**
46
- * Replaces cell value with supplied value
46
+ * Replaces cell value with supplied value (that can contain placeholders)
47
47
  */
48
48
  Content?: string | number;
49
49
  /**
50
- * Multiplier to use on the number
50
+ * Multiplier to use on cell value
51
51
  */
52
52
  Multiplier?: number;
53
53
  /**
@@ -55,23 +55,23 @@ export interface NumberFormatterOptions extends BaseFormatterOptions {
55
55
  */
56
56
  Parentheses?: boolean;
57
57
  /**
58
- * Truncates a number
58
+ * Truncates cell value
59
59
  */
60
60
  Truncate?: boolean;
61
61
  /**
62
- * Returns absolute value of a number
62
+ * Returns absolute value of cell value
63
63
  */
64
64
  Abs?: boolean;
65
65
  /**
66
- * Returns smallest integer > number
66
+ * Returns smallest integer greater than cell value
67
67
  */
68
68
  Ceiling?: boolean;
69
69
  /**
70
- * Returns largest intger < number
70
+ * Returns largest integer cell value
71
71
  */
72
72
  Floor?: boolean;
73
73
  /**
74
- * Rounds a Number
74
+ * Rounds cell value
75
75
  */
76
76
  Round?: boolean;
77
77
  }
@@ -210,14 +210,15 @@ export interface SystemLicenseShowWatermarkAction extends Redux.Action {
210
210
  }
211
211
  export interface SystemLicenseDisablePersistenceAction extends Redux.Action {
212
212
  }
213
- export interface SystemDataChangeHistoryAddAction extends Redux.Action {
213
+ export interface SystemDataChangeHistoryAction extends Redux.Action {
214
214
  changeInfo: CellDataChangedInfo;
215
+ uniqueKey: string;
215
216
  }
216
- export interface SystemDataChangeHistoryUndoAction extends Redux.Action {
217
- changeInfo: CellDataChangedInfo;
217
+ export interface SystemDataChangeHistoryAddAction extends SystemDataChangeHistoryAction {
218
218
  }
219
- export interface SystemDataChangeHistoryClearRowAction extends Redux.Action {
220
- changeInfo: CellDataChangedInfo;
219
+ export interface SystemDataChangeHistoryUndoAction extends SystemDataChangeHistoryAction {
220
+ }
221
+ export interface SystemDataChangeHistoryClearRowAction extends SystemDataChangeHistoryAction {
221
222
  }
222
223
  export interface SystemDataChangeHistoryEnableAction extends Redux.Action {
223
224
  }
@@ -307,9 +308,9 @@ export declare const SystemProgressIndicatorShow: (progressIndicatorConfig: Prog
307
308
  export declare const SystemProgressIndicatorHide: () => SystemProgressIndicatorHideAction;
308
309
  export declare const SystemLicenseShowWatermark: (text: string) => SystemLicenseShowWatermarkAction;
309
310
  export declare const SystemLicenseDisablePersistence: () => SystemLicenseDisablePersistenceAction;
310
- export declare const SystemDataChangeHistoryAdd: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryAddAction;
311
- export declare const SystemDataChangeHistoryUndo: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryUndoAction;
312
- export declare const SystemDataChangeHistoryClearRow: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryClearRowAction;
311
+ export declare const SystemDataChangeHistoryAdd: (changeInfo: CellDataChangedInfo, uniqueKey: string) => SystemDataChangeHistoryAddAction;
312
+ export declare const SystemDataChangeHistoryUndo: (changeInfo: CellDataChangedInfo, uniqueKey: string) => SystemDataChangeHistoryUndoAction;
313
+ export declare const SystemDataChangeHistoryClearRow: (changeInfo: CellDataChangedInfo, uniqueKey: string) => SystemDataChangeHistoryClearRowAction;
313
314
  export declare const SystemDataChangeHistoryEnable: () => SystemDataChangeHistoryEnableAction;
314
315
  export declare const SystemDataChangeHistoryDisable: () => SystemDataChangeHistoryDisableAction;
315
316
  export declare const SystemDataChangeHistorySuspend: () => SystemDataChangeHistorySuspendAction;
@@ -234,17 +234,20 @@ export const SystemLicenseShowWatermark = (text) => ({
234
234
  export const SystemLicenseDisablePersistence = () => ({
235
235
  type: SYSTEM_LICENSE_DISABLE_PERSISTENCE,
236
236
  });
237
- export const SystemDataChangeHistoryAdd = (changeInfo) => ({
237
+ export const SystemDataChangeHistoryAdd = (changeInfo, uniqueKey) => ({
238
238
  type: SYSTEM_DATA_CHANGE_HISTORY_ADD,
239
239
  changeInfo,
240
+ uniqueKey,
240
241
  });
241
- export const SystemDataChangeHistoryUndo = (changeInfo) => ({
242
+ export const SystemDataChangeHistoryUndo = (changeInfo, uniqueKey) => ({
242
243
  type: SYSTEM_DATA_CHANGE_HISTORY_UNDO,
243
244
  changeInfo,
245
+ uniqueKey,
244
246
  });
245
- export const SystemDataChangeHistoryClearRow = (changeInfo) => ({
247
+ export const SystemDataChangeHistoryClearRow = (changeInfo, uniqueKey) => ({
246
248
  type: SYSTEM_DATA_CHANGE_HISTORY_CLEAR_ROW,
247
249
  changeInfo,
250
+ uniqueKey,
248
251
  });
249
252
  export const SystemDataChangeHistoryEnable = () => ({
250
253
  type: SYSTEM_DATA_CHANGE_HISTORY_ENABLE,
@@ -654,7 +657,7 @@ export const SystemReducer = (state = initialState, action) => {
654
657
  case SYSTEM_DATA_CHANGE_HISTORY_ADD: {
655
658
  const actionTypedAdd = action;
656
659
  const cellDataChangedInfo = actionTypedAdd.changeInfo;
657
- const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
660
+ const uniqueKey = actionTypedAdd.uniqueKey;
658
661
  const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
659
662
  updatedDataChangeHistoryLogs[uniqueKey] = cellDataChangedInfo;
660
663
  return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
@@ -662,15 +665,15 @@ export const SystemReducer = (state = initialState, action) => {
662
665
  case SYSTEM_DATA_CHANGE_HISTORY_UNDO: {
663
666
  const actionTypedUndo = action;
664
667
  const cellDataChangedInfo = actionTypedUndo.changeInfo;
665
- const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
668
+ const uniqueKey = actionTypedUndo.uniqueKey;
666
669
  const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
667
670
  delete updatedDataChangeHistoryLogs[uniqueKey];
668
671
  return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
669
672
  }
670
673
  case SYSTEM_DATA_CHANGE_HISTORY_CLEAR_ROW: {
671
- const actionTypedUndo = action;
672
- const cellDataChangedInfo = actionTypedUndo.changeInfo;
673
- const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
674
+ const actionTypedClearRow = action;
675
+ const cellDataChangedInfo = actionTypedClearRow.changeInfo;
676
+ const uniqueKey = actionTypedClearRow.uniqueKey;
674
677
  const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
675
678
  delete updatedDataChangeHistoryLogs[uniqueKey];
676
679
  return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
@@ -775,6 +778,3 @@ export const SystemReducer = (state = initialState, action) => {
775
778
  return state;
776
779
  }
777
780
  };
778
- const getDataChangeHistoryKey = ({ column: columnId, primaryKeyValue, }) => {
779
- return JSON.stringify({ columnId, primaryKeyValue });
780
- };
@@ -1,6 +1,5 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
3
- import { SystemDataChangeHistoryAdd } from '../Redux/ActionsReducers/SystemRedux';
4
3
  import { DataChangeHistoryStatusBarContent } from '../View/DataChangeHistory/DataChangeHistoryStatusBarContent';
5
4
  import { ModuleNames } from '@ag-grid-community/core';
6
5
  export class DataChangeHistoryModule extends AdaptableModuleBase {
@@ -13,7 +12,7 @@ export class DataChangeHistoryModule extends AdaptableModuleBase {
13
12
  .on('CellDataChanged', (cellDataChangedInfo) => {
14
13
  if (cellDataChangedInfo.trigger !== 'undo' && cellDataChangedInfo.trigger !== 'aggChange') {
15
14
  if (this.shouldLogDataChange(cellDataChangedInfo)) {
16
- this.api.internalApi.dispatchReduxAction(SystemDataChangeHistoryAdd(cellDataChangedInfo));
15
+ this.api.dataChangeHistoryApi.addDataChangeHistoryEntry(cellDataChangedInfo);
17
16
  }
18
17
  }
19
18
  });
@@ -13,3 +13,4 @@ export declare const LicenseDocsLink: string;
13
13
  export declare const AdaptableOptionsDocsLink: string;
14
14
  export declare const AgGridModulesDocsLink: string;
15
15
  export declare const AlertMessageDocsLink: string;
16
+ export declare const FormatColumnPlaceholderDocsLink: string;
@@ -14,3 +14,4 @@ export const LicenseDocsLink = `${HOST_URL_DOCS}/guide/licensing`;
14
14
  export const AdaptableOptionsDocsLink = `${HOST_URL_DOCS}/guide/reference-options-overview`;
15
15
  export const AgGridModulesDocsLink = `${HOST_URL_DOCS}/guide/dev-guide-aggrid-modules-overview`;
16
16
  export const AlertMessageDocsLink = `${HOST_URL_DOCS}/guide/handbook-alerting-message`;
17
+ export const FormatColumnPlaceholderDocsLink = `${HOST_URL_DOCS}/guide/handbook-column-formatting-display-format-placeholder`;
@@ -0,0 +1,22 @@
1
+ import { IRowNode } from '@ag-grid-community/core';
2
+ import { AdaptableApi, AdaptableColumn } from '../../types';
3
+ /**
4
+ * Context used for Placeholders in Display Format
5
+ */
6
+ export interface DisplayFormatPlaceholderContext {
7
+ column: AdaptableColumn;
8
+ rowNode: IRowNode;
9
+ input: any;
10
+ api: AdaptableApi;
11
+ }
12
+ /**
13
+ * Supported tokens:
14
+ * - column -> [column]
15
+ * - input -> [value]
16
+ * - rowData.colId -> [rowData.colId]
17
+ */
18
+ export declare function resolvePlaceholders(text: string, context: DisplayFormatPlaceholderContext): string;
19
+ export declare const FormatContentHelper: {
20
+ resolvePlaceholders: typeof resolvePlaceholders;
21
+ };
22
+ export default FormatContentHelper;
@@ -0,0 +1,34 @@
1
+ import Helper from '../../Utilities/Helpers/Helper';
2
+ /**
3
+ * Supported tokens:
4
+ * - column -> [column]
5
+ * - input -> [value]
6
+ * - rowData.colId -> [rowData.colId]
7
+ */
8
+ export function resolvePlaceholders(text, context) {
9
+ if (!text) {
10
+ return text;
11
+ }
12
+ if (!context) {
13
+ return text;
14
+ }
15
+ if (context === null || context === void 0 ? void 0 : context.input) {
16
+ text = Helper.replaceAll(text, '[value]', context.input);
17
+ }
18
+ if (context === null || context === void 0 ? void 0 : context.column) {
19
+ text = Helper.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
20
+ }
21
+ if (context === null || context === void 0 ? void 0 : context.rowNode) {
22
+ const columns = Helper.extractColsFromText(text);
23
+ for (const column of columns) {
24
+ if (context.api.columnApi.getColumnWithColumnId(column)) {
25
+ text = Helper.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
26
+ }
27
+ }
28
+ }
29
+ return text;
30
+ }
31
+ export const FormatContentHelper = {
32
+ resolvePlaceholders,
33
+ };
34
+ export default FormatContentHelper;
@@ -4,27 +4,9 @@ import { AdaptableApi, AdaptableColumn } from '../../types';
4
4
  export declare function NumberFormatter(input: number, options?: NumberFormatterOptions, rowNode?: IRowNode, column?: AdaptableColumn, api?: AdaptableApi): string;
5
5
  export declare function DateFormatter(input: number | Date | string, options: DateFormatterOptions, strictFormatting?: boolean): string | undefined;
6
6
  export declare function StringFormatter(input: string, options?: StringFormatterOptions, rowNode?: IRowNode, column?: AdaptableColumn, api?: AdaptableApi): string;
7
- /**
8
- * Supported tokens:
9
- * - column -> [column]
10
- * - input -> [value]
11
- * - rowData.colId -> [rowData.colId]
12
- */
13
- export declare function resolvePlaceholders(text: string, context: {
14
- rowNode: IRowNode;
15
- input: any;
16
- column: AdaptableColumn<any>;
17
- api: AdaptableApi;
18
- }): string;
19
- export declare const FormatContentHelper: {
20
- resolvePlaceholders: typeof resolvePlaceholders;
21
- };
22
7
  declare const _default: {
23
8
  NumberFormatter: typeof NumberFormatter;
24
9
  DateFormatter: typeof DateFormatter;
25
10
  StringFormatter: typeof StringFormatter;
26
- FormatContentHelper: {
27
- resolvePlaceholders: typeof resolvePlaceholders;
28
- };
29
11
  };
30
12
  export default _default;
@@ -3,7 +3,7 @@
3
3
  import dateFnsFormat from 'date-fns/format';
4
4
  import { sentenceCase } from 'sentence-case';
5
5
  import { DEFAULT_DATE_FORMAT_PATTERN } from '../Constants/GeneralConstants';
6
- import Helper from '../../Utilities/Helpers/Helper';
6
+ import FormatContentHelper from './FormatContentHelper';
7
7
  /*
8
8
  export function Format(input: any, format: AdaptableFormat) {
9
9
  if (format.Formatter === 'NumberFormatter') {
@@ -165,36 +165,4 @@ export function StringFormatter(input, options = {}, rowNode, column, api) {
165
165
  }
166
166
  return s;
167
167
  }
168
- /**
169
- * Supported tokens:
170
- * - column -> [column]
171
- * - input -> [value]
172
- * - rowData.colId -> [rowData.colId]
173
- */
174
- export function resolvePlaceholders(text, context) {
175
- if (!text) {
176
- return text;
177
- }
178
- if (!context) {
179
- return text;
180
- }
181
- if (context === null || context === void 0 ? void 0 : context.input) {
182
- text = Helper.replaceAll(text, '[value]', context.input);
183
- }
184
- if (context === null || context === void 0 ? void 0 : context.column) {
185
- text = Helper.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
186
- }
187
- if (context === null || context === void 0 ? void 0 : context.rowNode) {
188
- const columns = Helper.extractColsFromText(text);
189
- for (const column of columns) {
190
- if (context.api.columnApi.getColumnWithColumnId(column)) {
191
- text = Helper.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
192
- }
193
- }
194
- }
195
- return text;
196
- }
197
- export const FormatContentHelper = {
198
- resolvePlaceholders,
199
- };
200
- export default { NumberFormatter, DateFormatter, StringFormatter, FormatContentHelper };
168
+ export default { NumberFormatter, DateFormatter, StringFormatter };
@@ -20,6 +20,7 @@ export const AlertMessageWizardSection = (props) => {
20
20
  const messageType = data.MessageType;
21
21
  const messageText = api.alertApi.internalApi.getAlertDescriptionForDataChange(data);
22
22
  const messageHeader = data.MessageHeader;
23
+ const showDocumentationLinks = api.internalApi.isDocumentationLinksDisplayed();
23
24
  const onMessageTextChange = (e) => {
24
25
  const { value } = e.target;
25
26
  props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
@@ -42,7 +43,7 @@ export const AlertMessageWizardSection = (props) => {
42
43
  React.createElement(Tabs, { "data-name": "message-text", mt: 2, mb: 3, autoFocus: false },
43
44
  React.createElement(Tabs.Tab, null, "Message Text"),
44
45
  React.createElement(Tabs.Content, null,
45
- React.createElement(Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Alert Type)"),
46
+ React.createElement(Text, { fontSize: 2, mt: 3, mb: 2 }, "Text to display as the Alert Message (leave blank to show automated Message based on Alert Type)"),
46
47
  ' ',
47
48
  React.createElement(FormLayout, null,
48
49
  React.createElement(FormRow, { label: "Header" },
@@ -51,10 +52,10 @@ export const AlertMessageWizardSection = (props) => {
51
52
  onChange: (e) => onMessageHeaderChange(e) })),
52
53
  React.createElement(FormRow, { label: "Message" },
53
54
  React.createElement(Textarea, { minWidth: 300, rows: 3, marginTop: 2, type: 'text', autoFocus: false, value: messageText !== null && messageText !== void 0 ? messageText : '', onChange: (e) => onMessageTextChange(e) }))),
54
- React.createElement(HelpBlock, { "data-name": "alert-message-documentation", mt: 3, mb: 2, style: {
55
+ showDocumentationLinks && (React.createElement(HelpBlock, { "data-name": "alert-message-documentation", mt: 3, mb: 2, style: {
55
56
  fontSize: 'var(--ab-font-size-3)',
56
57
  padding: 0,
57
58
  } },
58
59
  React.createElement(ButtonInfo, { mr: 2, onClick: () => window.open(AlertMessageDocsLink, '_blank') }),
59
- "See Alert Message documentation for more details and examples")))));
60
+ "See how to create dynamic Alert Messages using placeholders"))))));
60
61
  };
@@ -42,5 +42,7 @@ export const ExternalRenderer = (_a) => {
42
42
  }
43
43
  };
44
44
  }, []);
45
- return React.createElement("div", Object.assign({}, rest, { dangerouslySetInnerHTML: { __html: contentsHTML }, ref: ref }));
45
+ const RFC = adaptable.variant === 'react' ? frameworkComponent : null;
46
+ return RFC ? (React.createElement("div", Object.assign({}, rest, { ref: ref }),
47
+ React.createElement(RFC, { adaptableApi: adaptable.api }))) : (React.createElement("div", Object.assign({}, rest, { dangerouslySetInnerHTML: { __html: contentsHTML }, ref: ref })));
46
48
  };