@adaptabletools/adaptable-cjs 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 +23 -2
  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 +2 -1
  20. package/src/Utilities/Helpers/FormatContentHelper.d.ts +22 -0
  21. package/src/Utilities/Helpers/FormatContentHelper.js +39 -0
  22. package/src/Utilities/Helpers/FormatHelper.d.ts +0 -18
  23. package/src/Utilities/Helpers/FormatHelper.js +5 -38
  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.cjs.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
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
  }
@@ -6,6 +6,21 @@ const ApiBase_1 = require("./ApiBase");
6
6
  const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
7
7
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
8
  class DataChangeHistoryApiImpl extends ApiBase_1.ApiBase {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.getDataChangeHistoryKey = (dataChangeInfo) => {
12
+ const columnId = dataChangeInfo.column.columnId;
13
+ const primaryKeyValue = dataChangeInfo.primaryKeyValue;
14
+ const changedAt = dataChangeInfo.changedAt;
15
+ const showLastDataChangeOnly = this.getAdaptableApi().optionsApi.getDataChangeHistoryOptions().showLastDataChangeOnly;
16
+ if (showLastDataChangeOnly) {
17
+ return JSON.stringify({ columnId, primaryKeyValue });
18
+ }
19
+ else {
20
+ return JSON.stringify({ columnId, primaryKeyValue, changedAt });
21
+ }
22
+ };
23
+ }
9
24
  getDataChangeHistoryMode() {
10
25
  return this.getAdaptableState().System.DataChangeHistory.currentMode;
11
26
  }
@@ -37,11 +52,17 @@ class DataChangeHistoryApiImpl extends ApiBase_1.ApiBase {
37
52
  const changeLog = (_a = this.getAdaptableState().System.DataChangeHistory.logs) !== null && _a !== void 0 ? _a : {};
38
53
  return Object.values(changeLog);
39
54
  }
55
+ addDataChangeHistoryEntry(dataChangeInfo) {
56
+ const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
57
+ this.dispatchAction((0, SystemRedux_1.SystemDataChangeHistoryAdd)(dataChangeInfo, uniqueKey));
58
+ }
40
59
  undoDataChangeHistoryEntry(dataChangeInfo) {
41
- this.dispatchAction((0, SystemRedux_1.SystemDataChangeHistoryUndo)(dataChangeInfo));
60
+ const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
61
+ this.dispatchAction((0, SystemRedux_1.SystemDataChangeHistoryUndo)(dataChangeInfo, uniqueKey));
42
62
  }
43
63
  clearDataChangeHistoryEntry(dataChangeInfo) {
44
- this.dispatchAction((0, SystemRedux_1.SystemDataChangeHistoryClearRow)(dataChangeInfo));
64
+ const uniqueKey = this.getDataChangeHistoryKey(dataChangeInfo);
65
+ this.dispatchAction((0, SystemRedux_1.SystemDataChangeHistoryClearRow)(dataChangeInfo, uniqueKey));
45
66
  }
46
67
  openDataChangeHistorySettingsPanel() {
47
68
  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;
@@ -16,6 +16,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
16
16
  super(adaptable);
17
17
  this.internalApi = new GridInternalApi_1.GridInternalApi(adaptable);
18
18
  }
19
+ getVariant() {
20
+ return this.adaptable.variant;
21
+ }
19
22
  getGridState() {
20
23
  return this.getAdaptableState().Grid;
21
24
  }
@@ -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;
@@ -16,6 +16,10 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
16
16
  getSystemState() {
17
17
  return this.getAdaptableState().System;
18
18
  }
19
+ getAdaptableJSXElement() {
20
+ var _a;
21
+ return (_a = this.adaptable._PRIVATE_adaptableJSXElement) !== null && _a !== void 0 ? _a : null;
22
+ }
19
23
  // Popup Redux Actions
20
24
  showPopupConfirmation(confirmation) {
21
25
  this.dispatchAction(PopupRedux.PopupShowConfirmation(confirmation));
@@ -115,17 +115,17 @@ class GridInternalApi extends ApiBase_1.ApiBase {
115
115
  }
116
116
  shouldShowValuesCount(column) {
117
117
  const showValuesCount = this.getColumnFilterOptions().valuesFilterOptions.showValuesCount;
118
- let shouldShowValuesCount = false;
118
+ let returnValue = false;
119
119
  if (showValuesCount) {
120
120
  if (typeof showValuesCount === 'function') {
121
121
  const columnFilterContext = Object.assign({ column }, this.getAdaptableApi().internalApi.buildBaseContext());
122
- shouldShowValuesCount = showValuesCount(columnFilterContext);
122
+ returnValue = showValuesCount(columnFilterContext);
123
123
  }
124
124
  else {
125
- shouldShowValuesCount = showValuesCount;
125
+ returnValue = showValuesCount;
126
126
  }
127
127
  }
128
- return shouldShowValuesCount;
128
+ return returnValue;
129
129
  }
130
130
  async getDistinctFilterDisplayValuesForColumnForFiltersUI(columnId, filter, showFilteredRowsOnly) {
131
131
  const abColumn = this.getColumnApi().getColumnWithColumnId(columnId);
@@ -148,7 +148,13 @@ class GridInternalApi extends ApiBase_1.ApiBase {
148
148
  addPredicateValues(params) {
149
149
  var _a, _b, _c, _d;
150
150
  const { valueOptions, column, shouldShowValuesCount, visibleRowsOnly } = params;
151
- const allGridCells = this.adaptable.getGridCellsForColumn(column.columnId, visibleRowsOnly);
151
+ const visibleGridCells = this.adaptable.getGridCellsForColumnTemp(column.columnId, visibleRowsOnly);
152
+ let allGridCells;
153
+ if (shouldShowValuesCount) {
154
+ allGridCells = visibleRowsOnly
155
+ ? visibleGridCells
156
+ : this.adaptable.getGridCellsForColumnTemp(column.columnId, this.getColumnFilterOptions().valuesFilterOptions.showCurrentlyFilteredValuesCount);
157
+ }
152
158
  const adaptableApi = this.getAdaptableApi();
153
159
  const predicateIds = adaptableApi.columnFilterApi.internalApi.getValuesFitlerPredicateIds(column);
154
160
  if (ArrayExtensions_1.default.IsNullOrEmpty(predicateIds)) {
@@ -161,7 +167,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
161
167
  if (!visibleRowsOnly) {
162
168
  return true;
163
169
  }
164
- return this.isPredicateInVisibleCellValues(predicateId, allGridCells);
170
+ return this.isPredicateInVisibleCellValues(predicateId, visibleGridCells);
165
171
  })
166
172
  .map((predicateId) => {
167
173
  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;
@@ -275,19 +275,22 @@ const SystemLicenseDisablePersistence = () => ({
275
275
  type: exports.SYSTEM_LICENSE_DISABLE_PERSISTENCE,
276
276
  });
277
277
  exports.SystemLicenseDisablePersistence = SystemLicenseDisablePersistence;
278
- const SystemDataChangeHistoryAdd = (changeInfo) => ({
278
+ const SystemDataChangeHistoryAdd = (changeInfo, uniqueKey) => ({
279
279
  type: exports.SYSTEM_DATA_CHANGE_HISTORY_ADD,
280
280
  changeInfo,
281
+ uniqueKey,
281
282
  });
282
283
  exports.SystemDataChangeHistoryAdd = SystemDataChangeHistoryAdd;
283
- const SystemDataChangeHistoryUndo = (changeInfo) => ({
284
+ const SystemDataChangeHistoryUndo = (changeInfo, uniqueKey) => ({
284
285
  type: exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO,
285
286
  changeInfo,
287
+ uniqueKey,
286
288
  });
287
289
  exports.SystemDataChangeHistoryUndo = SystemDataChangeHistoryUndo;
288
- const SystemDataChangeHistoryClearRow = (changeInfo) => ({
290
+ const SystemDataChangeHistoryClearRow = (changeInfo, uniqueKey) => ({
289
291
  type: exports.SYSTEM_DATA_CHANGE_HISTORY_CLEAR_ROW,
290
292
  changeInfo,
293
+ uniqueKey,
291
294
  });
292
295
  exports.SystemDataChangeHistoryClearRow = SystemDataChangeHistoryClearRow;
293
296
  const SystemDataChangeHistoryEnable = () => ({
@@ -727,7 +730,7 @@ const SystemReducer = (state = initialState, action) => {
727
730
  case exports.SYSTEM_DATA_CHANGE_HISTORY_ADD: {
728
731
  const actionTypedAdd = action;
729
732
  const cellDataChangedInfo = actionTypedAdd.changeInfo;
730
- const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
733
+ const uniqueKey = actionTypedAdd.uniqueKey;
731
734
  const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
732
735
  updatedDataChangeHistoryLogs[uniqueKey] = cellDataChangedInfo;
733
736
  return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
@@ -735,15 +738,15 @@ const SystemReducer = (state = initialState, action) => {
735
738
  case exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO: {
736
739
  const actionTypedUndo = action;
737
740
  const cellDataChangedInfo = actionTypedUndo.changeInfo;
738
- const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
741
+ const uniqueKey = actionTypedUndo.uniqueKey;
739
742
  const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
740
743
  delete updatedDataChangeHistoryLogs[uniqueKey];
741
744
  return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
742
745
  }
743
746
  case exports.SYSTEM_DATA_CHANGE_HISTORY_CLEAR_ROW: {
744
- const actionTypedUndo = action;
745
- const cellDataChangedInfo = actionTypedUndo.changeInfo;
746
- const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
747
+ const actionTypedClearRow = action;
748
+ const cellDataChangedInfo = actionTypedClearRow.changeInfo;
749
+ const uniqueKey = actionTypedClearRow.uniqueKey;
747
750
  const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
748
751
  delete updatedDataChangeHistoryLogs[uniqueKey];
749
752
  return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
@@ -849,6 +852,3 @@ const SystemReducer = (state = initialState, action) => {
849
852
  }
850
853
  };
851
854
  exports.SystemReducer = SystemReducer;
852
- const getDataChangeHistoryKey = ({ column: columnId, primaryKeyValue, }) => {
853
- return JSON.stringify({ columnId, primaryKeyValue });
854
- };
@@ -4,7 +4,6 @@ exports.DataChangeHistoryModule = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
- const SystemRedux_1 = require("../Redux/ActionsReducers/SystemRedux");
8
7
  const DataChangeHistoryStatusBarContent_1 = require("../View/DataChangeHistory/DataChangeHistoryStatusBarContent");
9
8
  const core_1 = require("ag-grid-community");
10
9
  class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
@@ -17,7 +16,7 @@ class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase
17
16
  .on('CellDataChanged', (cellDataChangedInfo) => {
18
17
  if (cellDataChangedInfo.trigger !== 'undo' && cellDataChangedInfo.trigger !== 'aggChange') {
19
18
  if (this.shouldLogDataChange(cellDataChangedInfo)) {
20
- this.api.internalApi.dispatchReduxAction((0, SystemRedux_1.SystemDataChangeHistoryAdd)(cellDataChangedInfo));
19
+ this.api.dataChangeHistoryApi.addDataChangeHistoryEntry(cellDataChangedInfo);
21
20
  }
22
21
  }
23
22
  });
@@ -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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlertMessageDocsLink = exports.AgGridModulesDocsLink = exports.AdaptableOptionsDocsLink = exports.LicenseDocsLink = exports.PrimaryKeyDocsLink = exports.PredicateDocsLink = exports.QuantileAggregatedScalarQueryDocsLink = exports.CumulativeAggregatedScalarQueryDocsLink = exports.AggregatedScalarQueryDocsLink = exports.AggregatedBooleanQueryDocsLink = exports.ObservableQueryDocsLink = exports.ScalarQueryDocsLink = exports.BooleanQueryDocsLink = exports.ExpressionEditorDocsLink = exports.HOST_URL_DOCS = void 0;
3
+ exports.FormatColumnPlaceholderDocsLink = exports.AlertMessageDocsLink = exports.AgGridModulesDocsLink = exports.AdaptableOptionsDocsLink = exports.LicenseDocsLink = exports.PrimaryKeyDocsLink = exports.PredicateDocsLink = exports.QuantileAggregatedScalarQueryDocsLink = exports.CumulativeAggregatedScalarQueryDocsLink = exports.AggregatedScalarQueryDocsLink = exports.AggregatedBooleanQueryDocsLink = exports.ObservableQueryDocsLink = exports.ScalarQueryDocsLink = exports.BooleanQueryDocsLink = exports.ExpressionEditorDocsLink = exports.HOST_URL_DOCS = void 0;
4
4
  exports.HOST_URL_DOCS = 'https://docs.adaptabletools.com';
5
5
  //export const HOST_URL_DOCS = 'http://localhost:3000';
6
6
  exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/guide/ui-expression-editor`;
@@ -17,3 +17,4 @@ exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/guide/licensing`;
17
17
  exports.AdaptableOptionsDocsLink = `${exports.HOST_URL_DOCS}/guide/reference-options-overview`;
18
18
  exports.AgGridModulesDocsLink = `${exports.HOST_URL_DOCS}/guide/dev-guide-aggrid-modules-overview`;
19
19
  exports.AlertMessageDocsLink = `${exports.HOST_URL_DOCS}/guide/handbook-alerting-message`;
20
+ exports.FormatColumnPlaceholderDocsLink = `${exports.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,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormatContentHelper = exports.resolvePlaceholders = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
6
+ /**
7
+ * Supported tokens:
8
+ * - column -> [column]
9
+ * - input -> [value]
10
+ * - rowData.colId -> [rowData.colId]
11
+ */
12
+ function resolvePlaceholders(text, context) {
13
+ if (!text) {
14
+ return text;
15
+ }
16
+ if (!context) {
17
+ return text;
18
+ }
19
+ if (context === null || context === void 0 ? void 0 : context.input) {
20
+ text = Helper_1.default.replaceAll(text, '[value]', context.input);
21
+ }
22
+ if (context === null || context === void 0 ? void 0 : context.column) {
23
+ text = Helper_1.default.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
24
+ }
25
+ if (context === null || context === void 0 ? void 0 : context.rowNode) {
26
+ const columns = Helper_1.default.extractColsFromText(text);
27
+ for (const column of columns) {
28
+ if (context.api.columnApi.getColumnWithColumnId(column)) {
29
+ text = Helper_1.default.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
30
+ }
31
+ }
32
+ }
33
+ return text;
34
+ }
35
+ exports.resolvePlaceholders = resolvePlaceholders;
36
+ exports.FormatContentHelper = {
37
+ resolvePlaceholders,
38
+ };
39
+ exports.default = exports.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;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormatContentHelper = exports.resolvePlaceholders = exports.StringFormatter = exports.DateFormatter = exports.NumberFormatter = void 0;
3
+ exports.StringFormatter = exports.DateFormatter = exports.NumberFormatter = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  // TODO inspect why the following is erroring on angular build
6
6
  // import dateFnsFormat from 'date-fns/format';
7
7
  const format_1 = tslib_1.__importDefault(require("date-fns/format"));
8
8
  const sentence_case_1 = require("sentence-case");
9
9
  const GeneralConstants_1 = require("../Constants/GeneralConstants");
10
- const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
10
+ const FormatContentHelper_1 = tslib_1.__importDefault(require("./FormatContentHelper"));
11
11
  /*
12
12
  export function Format(input: any, format: AdaptableFormat) {
13
13
  if (format.Formatter === 'NumberFormatter') {
@@ -29,7 +29,7 @@ function NumberFormatter(input, options = {}, rowNode, column, api) {
29
29
  input,
30
30
  api,
31
31
  };
32
- preparedInput = exports.FormatContentHelper.resolvePlaceholders(options.Content.toString(), context);
32
+ preparedInput = FormatContentHelper_1.default.resolvePlaceholders(options.Content.toString(), context);
33
33
  }
34
34
  else {
35
35
  preparedInput = input;
@@ -137,7 +137,7 @@ function StringFormatter(input, options = {}, rowNode, column, api) {
137
137
  input,
138
138
  api,
139
139
  };
140
- preparedInput = exports.FormatContentHelper.resolvePlaceholders(options.Content, context);
140
+ preparedInput = FormatContentHelper_1.default.resolvePlaceholders(options.Content, context);
141
141
  }
142
142
  else {
143
143
  preparedInput = input;
@@ -172,37 +172,4 @@ function StringFormatter(input, options = {}, rowNode, column, api) {
172
172
  return s;
173
173
  }
174
174
  exports.StringFormatter = StringFormatter;
175
- /**
176
- * Supported tokens:
177
- * - column -> [column]
178
- * - input -> [value]
179
- * - rowData.colId -> [rowData.colId]
180
- */
181
- function resolvePlaceholders(text, context) {
182
- if (!text) {
183
- return text;
184
- }
185
- if (!context) {
186
- return text;
187
- }
188
- if (context === null || context === void 0 ? void 0 : context.input) {
189
- text = Helper_1.default.replaceAll(text, '[value]', context.input);
190
- }
191
- if (context === null || context === void 0 ? void 0 : context.column) {
192
- text = Helper_1.default.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
193
- }
194
- if (context === null || context === void 0 ? void 0 : context.rowNode) {
195
- const columns = Helper_1.default.extractColsFromText(text);
196
- for (const column of columns) {
197
- if (context.api.columnApi.getColumnWithColumnId(column)) {
198
- text = Helper_1.default.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
199
- }
200
- }
201
- }
202
- return text;
203
- }
204
- exports.resolvePlaceholders = resolvePlaceholders;
205
- exports.FormatContentHelper = {
206
- resolvePlaceholders,
207
- };
208
- exports.default = { NumberFormatter, DateFormatter, StringFormatter, FormatContentHelper: exports.FormatContentHelper };
175
+ exports.default = { NumberFormatter, DateFormatter, StringFormatter };