@adaptabletools/adaptable 12.0.1 → 12.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 (47) hide show
  1. package/bundle.cjs.js +90 -90
  2. package/package.json +1 -1
  3. package/publishTimestamp.d.ts +1 -1
  4. package/publishTimestamp.js +1 -1
  5. package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
  6. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -1
  7. package/src/AdaptableOptions/StateOptions.d.ts +9 -23
  8. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +34 -1
  9. package/src/Api/ChartingApi.d.ts +19 -2
  10. package/src/Api/FormatColumnApi.d.ts +6 -6
  11. package/src/Api/GridApi.d.ts +1 -1
  12. package/src/Api/Implementation/ChartingApiImpl.d.ts +6 -0
  13. package/src/Api/Implementation/ChartingApiImpl.js +17 -0
  14. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -0
  15. package/src/Api/Implementation/ConfigApiImpl.js +11 -0
  16. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +3 -3
  17. package/src/Api/Implementation/FormatColumnApiImpl.js +13 -11
  18. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  19. package/src/Api/Implementation/GridApiImpl.js +2 -2
  20. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  21. package/src/PredefinedConfig/CalculatedColumnState.d.ts +0 -5
  22. package/src/PredefinedConfig/ChartingState.d.ts +20 -0
  23. package/src/PredefinedConfig/ChartingState.js +2 -0
  24. package/src/PredefinedConfig/Common/Types.d.ts +1 -1
  25. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  26. package/src/Redux/ActionsReducers/ChartingRedux.d.ts +23 -0
  27. package/src/Redux/ActionsReducers/ChartingRedux.js +38 -0
  28. package/src/Redux/Store/AdaptableStore.js +2 -0
  29. package/src/Strategy/AlertModule.js +3 -3
  30. package/src/Strategy/ChartingModule.js +1 -1
  31. package/src/Strategy/FlashingCellModule.js +3 -3
  32. package/src/Utilities/Helpers/FormatHelper.d.ts +1 -1
  33. package/src/Utilities/Helpers/FormatHelper.js +6 -2
  34. package/src/Utilities/ObjectFactory.d.ts +5 -1
  35. package/src/Utilities/ObjectFactory.js +11 -1
  36. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
  37. package/src/Utilities/Services/ReportService.d.ts +1 -1
  38. package/src/Utilities/Services/ReportService.js +5 -5
  39. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +2 -9
  40. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +13 -9
  41. package/src/agGrid/Adaptable.d.ts +4 -2
  42. package/src/agGrid/Adaptable.js +36 -20
  43. package/src/metamodel/adaptable.metamodel.d.ts +75 -1
  44. package/src/metamodel/adaptable.metamodel.js +1 -1
  45. package/src/types.d.ts +3 -1
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "12.0.1",
3
+ "version": "12.0.2",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1656489937822;
1
+ declare const _default: 1656835883968;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1656489937822;
3
+ exports.default = 1656835883968;
@@ -1,4 +1,4 @@
1
- import { Column, GridOptions, RowNode } from '@ag-grid-community/all-modules';
1
+ import { ChartModel, ChartRef, Column, GridOptions, RowNode } from '@ag-grid-community/all-modules';
2
2
  import { AdaptableApi } from '../Api/AdaptableApi';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { ColumnSort } from '../PredefinedConfig/Common/ColumnSort';
@@ -160,7 +160,7 @@ export interface IAdaptable {
160
160
  getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
161
161
  getRawValueFromRowNode(rowNode: RowNode, columnId: string): any;
162
162
  getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): string | undefined;
163
- getDisplayValueFromRawValue(columnId: string, rawValue: any): string | undefined;
163
+ getDisplayValueFromRawValue(rowNode: RowNode, columnId: string, rawValue: any): string | undefined;
164
164
  getDataRowFromRowNode(rowNode: RowNode): any;
165
165
  getRowNodesForPrimaryKeys(primaryKeyValues: any[]): RowNode[];
166
166
  getRowNodeForPrimaryKey(primaryKeyValue: any): RowNode;
@@ -243,4 +243,6 @@ export interface IAdaptable {
243
243
  skipSetupColumns?: boolean;
244
244
  }): void;
245
245
  getAgGridColumnForColumnId(columnId: string): Column;
246
+ showCharts(charts: ChartModel[]): ChartRef[];
247
+ getChartModels(): ChartModel[];
246
248
  }
@@ -13,7 +13,7 @@ export interface AdaptableQLOptions {
13
13
  */
14
14
  caseSensitiveTextComparisons?: boolean;
15
15
  /**
16
- * Which searching and filtering options should take place on server
16
+ * Which searching and filtering Modules should take place on server
17
17
  *
18
18
  * @defaultValue undefined
19
19
  * @gridInfoItem
@@ -3,30 +3,22 @@ import { AdaptableState } from '../PredefinedConfig/AdaptableState';
3
3
  * Options related to Adaptable State hydration/dehydration - allows users to intercept state persistence and state loading with custom functionality
4
4
  */
5
5
  export interface StateOptions {
6
- /**
7
- * Allows the customization of state persistence
8
- *
9
- * @defaultValue persists state to local storage
10
- */
11
- persistState?: AdaptablePersistStateFunction;
12
6
  /**
13
7
  * Allows the customization of Adaptable State loading
14
- *
15
- * @defaultValue loads state from local storage
16
8
  */
17
9
  loadState?: AdaptableLoadStateFunction;
10
+ /**
11
+ * Allows hooking into Adaptable State hydration
12
+ */
13
+ applyState?: (state: any) => any;
18
14
  /**
19
15
  * Allows the customization of the Adaptable State that is going to be persisted
20
- *
21
- * @defaultValue undefined
22
16
  */
23
17
  saveState?: AdaptableSaveStateFunction;
24
18
  /**
25
- * Allows hooking into Adaptable State hydration
26
- *
27
- * @defaultValue undefined
19
+ * Allows the customization of Adaptable State persistence
28
20
  */
29
- applyState?: (state: any) => any;
21
+ persistState?: AdaptablePersistStateFunction;
30
22
  /**
31
23
  * Allows clearing of remote Adaptable State
32
24
  *
@@ -49,9 +41,7 @@ export declare type AdaptableStateFunctionConfig = {
49
41
  url?: string;
50
42
  };
51
43
  /**
52
- * Allows the customization of state persistence.
53
- *
54
- * Used by the `persistState` function property in StateOptions
44
+ * Allows customization of state persistence - used `persistState` function in StateOptions
55
45
  *
56
46
  * @example
57
47
  * ```
@@ -73,17 +63,13 @@ export interface AdaptableClearStateFunction {
73
63
  ({ adaptableId, adaptableStateKey, userName, url }: AdaptableStateFunctionConfig): Promise<any>;
74
64
  }
75
65
  /**
76
- * Allows the customization of state persistence.
77
- *
78
- * Used by the `saveState` function property in StateOptions
66
+ * Allows the customization state persistence - used by `saveState` function in StateOptions
79
67
  */
80
68
  export interface AdaptableSaveStateFunction {
81
69
  (state: AdaptableState, { adaptableId, adaptableStateKey, userName, url }: AdaptableStateFunctionConfig): any;
82
70
  }
83
71
  /**
84
- * Allows the customization of state loading.
85
- *
86
- * Userd by the `loadState` function property in StateOptions
72
+ * Allows customization of state loading - used by `loadState` function in StateOptions
87
73
  */
88
74
  export interface AdaptableLoadStateFunction {
89
75
  (config: AdaptableStateFunctionConfig): Promise<any>;
@@ -5,6 +5,7 @@ import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
5
5
  import { AdaptableObjectTag } from '../PredefinedConfig/Common/AdaptableObject';
6
6
  import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
7
7
  import { BaseContext, GridCell } from '../../types';
8
+ import { RowNode } from '@ag-grid-community/all-modules';
8
9
  /**
9
10
  * Options for managing the User Interface of AdapTable
10
11
  */
@@ -182,9 +183,41 @@ export declare type GridInfoSections = GridInfoSection[];
182
183
  export declare type GridInfoSection = 'GridSummary' | 'AdaptableOptions' | 'ColumnInfo' | 'AdaptableObjectsSummary';
183
184
  export interface ObjectTagsContext extends BaseContext {
184
185
  }
186
+ /**
187
+ * Provides Custom Display Formats
188
+ */
185
189
  export declare type CustomDisplayFormatter = {
190
+ /**
191
+ * Id of the Formatted
192
+ */
186
193
  id: string;
194
+ /**
195
+ * Description
196
+ */
187
197
  label?: string;
188
- handler: (value: any) => any;
198
+ /**
199
+ * Function used to perform the Custom Display Format
200
+ */
201
+ handler: (customDisplayFormatterContext: CustomDisplayFormatterContext) => any;
202
+ /**
203
+ * Where the Custom Display Format can be applied
204
+ */
189
205
  scope: AdaptableScope;
190
206
  };
207
+ /**
208
+ * Context used in handler of CustomDisplayFormatter
209
+ */
210
+ export interface CustomDisplayFormatterContext extends BaseContext {
211
+ /**
212
+ * Column where Custom Display Format will apply
213
+ */
214
+ adaptableColumn: AdaptableColumn;
215
+ /**
216
+ * Non-formatted Cell Value
217
+ */
218
+ cellValue: any;
219
+ /**
220
+ * Node where Custom Display Format will apply
221
+ */
222
+ rowNode: RowNode;
223
+ }
@@ -1,9 +1,26 @@
1
+ import { ChartModel, ChartRef } from '@ag-grid-community/all-modules';
1
2
  /**
2
- * Provides run-time access to Charting Module and state
3
+ * Provides run-time access to Charting Module and related State
3
4
  */
4
5
  export interface ChartingApi {
5
6
  /**
6
- * Whether this Adaptable instance has Charting functions available.
7
+ * Whether AdapTable's charting functionality is available
7
8
  */
8
9
  isChartingEnabled(): boolean;
10
+ /**
11
+ * Retrieves current user-generated Charts
12
+ */
13
+ getCurrentCharts(): ChartModel[];
14
+ /**
15
+ * Retrieves persisted Charts from Adaptable State
16
+ */
17
+ getPersistedCharts(): ChartModel[];
18
+ /**
19
+ * Saves all current Charts into Adaptable State
20
+ */
21
+ saveCurrentCharts(): void;
22
+ /**
23
+ * Displays all persisted Charts
24
+ */
25
+ showPersistedCharts(): ChartRef[];
9
26
  }
@@ -181,22 +181,22 @@ export interface FormatColumnApi {
181
181
  /**
182
182
  * Format value according to format options.
183
183
  *
184
- * @param value value to format
184
+ * @param customDisplayFormatterContext context that includes value to format
185
185
  * @param options formatter options
186
186
  */
187
- getNumberFormattedValue(value: any, options: AdaptableFormat['Options']): any;
187
+ getNumberFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): any;
188
188
  /**
189
189
  * Format value according to format options.
190
190
  *
191
- * @param value value to format
191
+ * @param value context that includes value to format
192
192
  * @param options formatter options
193
193
  */
194
- getStringFormattedValue(value: any, options: AdaptableFormat['Options']): string;
194
+ getStringFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
195
195
  /**
196
196
  * Format value according to format options.
197
197
  *
198
- * @param value value to format
198
+ * @param customDisplayFormatterContext context that includes value to format
199
199
  * @param options formatter options
200
200
  */
201
- getDateFormattedValue(value: any, options: AdaptableFormat['Options']): string;
201
+ getDateFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
202
202
  }
@@ -262,7 +262,7 @@ export interface GridApi {
262
262
  * @param columnId ColumnId to lookup
263
263
  * @param rawValue Raw Value
264
264
  */
265
- getFormattedValueFromRawValue(columnId: string, rawValue: any): string | undefined;
265
+ getFormattedValueFromRawValue(rowNode: RowNode, columnId: string, rawValue: any): string | undefined;
266
266
  /**
267
267
  * Retrieves Display Value for Cell in given Row and Column
268
268
  * @param rowNode Row to use
@@ -1,5 +1,11 @@
1
+ import { ChartModel } from '@ag-grid-community/core';
1
2
  import { ChartingApi } from '../ChartingApi';
2
3
  import { ApiBase } from './ApiBase';
4
+ import { ChartRef } from '@ag-grid-community/all-modules';
3
5
  export declare class ChartingApiImpl extends ApiBase implements ChartingApi {
4
6
  isChartingEnabled(): boolean;
7
+ getCurrentCharts(): ChartModel[];
8
+ saveCurrentCharts(): void;
9
+ getPersistedCharts(): ChartModel[];
10
+ showPersistedCharts(): ChartRef[];
5
11
  }
@@ -1,10 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChartingApiImpl = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const ApiBase_1 = require("./ApiBase");
6
+ const ChartingRedux = tslib_1.__importStar(require("./../../Redux/ActionsReducers/ChartingRedux"));
7
+ const ChartingRedux_1 = require("./../../Redux/ActionsReducers/ChartingRedux");
5
8
  class ChartingApiImpl extends ApiBase_1.ApiBase {
6
9
  isChartingEnabled() {
7
10
  return this.adaptable.canGenerateCharts();
8
11
  }
12
+ getCurrentCharts() {
13
+ return this.adaptable.getChartModels();
14
+ }
15
+ saveCurrentCharts() {
16
+ const currentCharts = this.getCurrentCharts();
17
+ this.dispatchAction(ChartingRedux.ChartingSetChartModels(currentCharts));
18
+ }
19
+ getPersistedCharts() {
20
+ return ChartingRedux_1.ChartingGetChartModels(this.getAdaptableState()).map((chart) => chart.model);
21
+ }
22
+ showPersistedCharts() {
23
+ const persistedCharts = this.getPersistedCharts();
24
+ return this.adaptable.showCharts(persistedCharts);
25
+ }
9
26
  }
10
27
  exports.ChartingApiImpl = ChartingApiImpl;
@@ -22,6 +22,7 @@ import { AdaptableSearchState, ScheduleState } from '../../types';
22
22
  import { AdaptableSortState } from '../Events/SearchChanged';
23
23
  import { QueryState } from '../../PredefinedConfig/QueryState';
24
24
  import { PredefinedConfig } from '../../PredefinedConfig/PredefinedConfig';
25
+ import { ChartingState } from '../../PredefinedConfig/ChartingState';
25
26
  export declare class ConfigApiImpl extends ApiBase implements ConfigApi {
26
27
  configInit(): void;
27
28
  copyAllStateToClipboard(): void;
@@ -47,6 +48,7 @@ export declare class ConfigApiImpl extends ApiBase implements ConfigApi {
47
48
  getAlertState(returnJson?: boolean): AlertState;
48
49
  getApplicationState(returnJson?: boolean): ApplicationState;
49
50
  getCalculatedColumnState(returnJson?: boolean): CalculatedColumnState;
51
+ getChartingState(returnJson?: boolean): ChartingState;
50
52
  getConditionalStyleState(returnJson?: boolean): ConditionalStyleState;
51
53
  getCustomSortState(returnJson?: boolean): CustomSortState;
52
54
  getDashboardState(returnJson?: boolean): DashboardState;
@@ -11,6 +11,7 @@ const DashboardRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers
11
11
  const AlertRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/AlertRedux"));
12
12
  const BulkUpdateRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/BulkUpdateRedux"));
13
13
  const CalculatedColumnRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/CalculatedColumnRedux"));
14
+ const ChartingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ChartingRedux"));
14
15
  const ConditionalStyleRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ConditionalStyleRedux"));
15
16
  const CustomSortRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/CustomSortRedux"));
16
17
  const ExportRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ExportRedux"));
@@ -154,6 +155,10 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
154
155
  return returnJson
155
156
  ? JSON.stringify(this.getAdaptableState().CalculatedColumn)
156
157
  : this.getAdaptableState().CalculatedColumn;
158
+ case 'Charting':
159
+ return returnJson
160
+ ? JSON.stringify(this.getAdaptableState().Charting)
161
+ : this.getAdaptableState().Charting;
157
162
  case 'ConditionalStyle':
158
163
  return returnJson
159
164
  ? JSON.stringify(this.getAdaptableState().ConditionalStyle)
@@ -231,6 +236,9 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
231
236
  getCalculatedColumnState(returnJson = false) {
232
237
  return this.getUserStateByStateKey('CalculatedColumn', returnJson);
233
238
  }
239
+ getChartingState(returnJson = false) {
240
+ return this.getUserStateByStateKey('Charting', returnJson);
241
+ }
234
242
  getConditionalStyleState(returnJson = false) {
235
243
  return this.getUserStateByStateKey('ConditionalStyle', returnJson);
236
244
  }
@@ -284,6 +292,9 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
284
292
  case 'CalculatedColumn':
285
293
  this.dispatchAction(CalculatedColumnRedux.CalculatedColumnReady(this.getCalculatedColumnState()));
286
294
  break;
295
+ case 'Charting':
296
+ this.dispatchAction(ChartingRedux.ChartingReady(this.getChartingState()));
297
+ break;
287
298
  case 'ConditionalStyle':
288
299
  this.dispatchAction(ConditionalStyleRedux.ConditionalStyleReady(this.getConditionalStyleState()));
289
300
  break;
@@ -45,7 +45,7 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
45
45
  isCheckBoxStyleFormatColumn(column: AdaptableColumn): boolean;
46
46
  fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
47
47
  private applyCustomFormatters;
48
- getNumberFormattedValue(value: any, options: AdaptableFormat['Options']): string;
49
- getStringFormattedValue(value: any, options: AdaptableFormat['Options']): string;
50
- getDateFormattedValue(value: any, options: AdaptableFormat['Options']): string;
48
+ getNumberFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
49
+ getStringFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
50
+ getDateFormattedValue(value: any, node: RowNode, abColumn: AdaptableColumn, options: AdaptableFormat['Options']): string;
51
51
  }
@@ -9,6 +9,7 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exten
9
9
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
10
10
  const Helper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/Helper"));
11
11
  const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
12
+ const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
12
13
  class FormatColumnApiImpl extends ApiBase_1.ApiBase {
13
14
  getFormatColumnState() {
14
15
  return this.getAdaptableState().FormatColumn;
@@ -273,7 +274,7 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
273
274
  };
274
275
  this.adaptable.api.eventApi.emit('CheckboxColumnClicked', checkboxColumnClickedInfo);
275
276
  }
276
- applyCustomFormatters(value, options) {
277
+ applyCustomFormatters(value, node, abColumn, options) {
277
278
  var _a, _b, _c;
278
279
  const columnCustomFormatters = (_a = options === null || options === void 0 ? void 0 : options.CustomDisplayFormats) !== null && _a !== void 0 ? _a : [];
279
280
  if (!(columnCustomFormatters === null || columnCustomFormatters === void 0 ? void 0 : columnCustomFormatters.length)) {
@@ -283,23 +284,24 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
283
284
  const customFormattersFromOptions = (_c = (_b = adaptableOptions === null || adaptableOptions === void 0 ? void 0 : adaptableOptions.userInterfaceOptions) === null || _b === void 0 ? void 0 : _b.customDisplayFormatters) !== null && _c !== void 0 ? _c : [];
284
285
  // formatters are applied in the order they are defined in the options
285
286
  const customFormatters = customFormattersFromOptions.filter((customFormatterOption) => columnCustomFormatters.includes(customFormatterOption.id));
286
- return customFormatters.reduce((acc, formatter) => {
287
+ const customDisplayFormatterContext = ObjectFactory_1.default.CreateCustomDisplayFormatterContext(value, node, abColumn, this.getAdaptableApi());
288
+ return customFormatters.reduce((context, formatter) => {
287
289
  if (formatter && formatter.handler) {
288
- return formatter.handler(acc);
290
+ return formatter.handler(context);
289
291
  }
290
- return acc;
291
- }, value);
292
+ return context.cellValue;
293
+ }, customDisplayFormatterContext);
292
294
  }
293
- getNumberFormattedValue(value, options) {
294
- let preparedValue = this.applyCustomFormatters(value, options);
295
+ getNumberFormattedValue(value, node, abColumn, options) {
296
+ const preparedValue = this.applyCustomFormatters(value, node, abColumn, options);
295
297
  return FormatHelper_1.default.NumberFormatter(preparedValue, options);
296
298
  }
297
- getStringFormattedValue(value, options) {
298
- let preparedValue = this.applyCustomFormatters(value, options);
299
+ getStringFormattedValue(value, node, abColumn, options) {
300
+ const preparedValue = this.applyCustomFormatters(value, node, abColumn, options);
299
301
  return FormatHelper_1.default.StringFormatter(preparedValue, options);
300
302
  }
301
- getDateFormattedValue(value, options) {
302
- let preparedValue = this.applyCustomFormatters(value, options);
303
+ getDateFormattedValue(value, node, abColumn, options) {
304
+ const preparedValue = this.applyCustomFormatters(value, node, abColumn, options);
303
305
  return FormatHelper_1.default.DateFormatter(preparedValue, options);
304
306
  }
305
307
  }
@@ -65,7 +65,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
65
65
  getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
66
66
  getRawValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
67
67
  getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
68
- getFormattedValueFromRawValue(columnId: string, rawValue: any): string | undefined;
68
+ getFormattedValueFromRawValue(rowNode: RowNode, columnId: string, rawValue: any): string | undefined;
69
69
  getNormalisedValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
70
70
  getRowNodesForPrimaryKeys(primaryKeyValues: any[]): RowNode[];
71
71
  getRowNodeForPrimaryKey(primaryKeyValue: any): RowNode;
@@ -200,8 +200,8 @@ class GridApiImpl extends ApiBase_1.ApiBase {
200
200
  getDisplayValueFromRowNode(rowNode, columnId) {
201
201
  return this.adaptable.getDisplayValueFromRowNode(rowNode, columnId);
202
202
  }
203
- getFormattedValueFromRawValue(columnId, rawValue) {
204
- return this.adaptable.getDisplayValueFromRawValue(columnId, rawValue);
203
+ getFormattedValueFromRawValue(rowNode, columnId, rawValue) {
204
+ return this.adaptable.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
205
205
  }
206
206
  getNormalisedValueFromRowNode(rowNode, columnId) {
207
207
  const gridCell = this.getGridCellFromRowNode(rowNode, columnId);
@@ -22,6 +22,7 @@ import { ToolPanelState } from './ToolPanelState';
22
22
  import { QueryState } from './QueryState';
23
23
  import { FlashingCellState } from './FlashingCellState';
24
24
  import { StatusBarState } from './StatusBarState';
25
+ import { ChartingState } from './ChartingState';
25
26
  /**
26
27
  * The main state object of Adaptable
27
28
  */
@@ -52,6 +53,7 @@ export interface AdaptablePersistentState {
52
53
  TeamSharing: TeamSharingState;
53
54
  Theme: ThemeState;
54
55
  ToolPanel: ToolPanelState;
56
+ Charting: ChartingState;
55
57
  }
56
58
  /**
57
59
  * The state which is available in the internal Redux store but never persisted
@@ -46,11 +46,6 @@ export interface CalculatedColumnSettings extends SpecialColumnSettings {
46
46
  * @defaultValue false
47
47
  */
48
48
  ShowToolTip?: boolean;
49
- /**
50
- * If true, the Calculated Column Expression will NOT be evaluated and the value is loaded from the row data property with the same name as the ColumnId
51
- * @defaultValue false
52
- */
53
- ExternallyEvaluatedExpression?: boolean;
54
49
  }
55
50
  /**
56
51
  * Calculated Column Query which may be a Scalar or an AggregatedScalar Expression
@@ -0,0 +1,20 @@
1
+ import { ChartModel } from '@ag-grid-community/all-modules';
2
+ import { ConfigState } from './ConfigState';
3
+ /**
4
+ * Wraps an AG Grid Chart Model
5
+ */
6
+ export interface ChartDefinition {
7
+ /**
8
+ * AG Grid Chart Model
9
+ */
10
+ model: ChartModel;
11
+ }
12
+ /**
13
+ * Predefined Configuration for Quick Search Module
14
+ */
15
+ export interface ChartingState extends ConfigState {
16
+ /**
17
+ * Charting Definitions - wrap AG Grid Chart Models
18
+ */
19
+ ChartDefinitions?: ChartDefinition[];
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -34,5 +34,5 @@ export declare type TypeHint<Base, Literals> = (Base & {
34
34
  __subType?: true;
35
35
  }) | Literals;
36
36
  export declare type AdaptableQLModules = AdaptableQLModule[];
37
- export declare type AdaptableQLModule = 'Filter' | 'Query';
37
+ export declare type AdaptableQLModule = 'CalculatedColumn' | 'Filter' | 'Query';
38
38
  export declare type AdaptableColumnType = 'abColDefBoolean' | 'abColDefDate' | 'abColDefNumber' | 'abColDefString' | 'abColDefObject' | 'abColDefCustom' | 'abSpecialColumn';
@@ -17,6 +17,7 @@ import { ThemeState } from './ThemeState';
17
17
  import { ToolPanelState } from './ToolPanelState';
18
18
  import { QueryState } from './QueryState';
19
19
  import { StatusBarState } from './StatusBarState';
20
+ import { ChartingState } from './ChartingState';
20
21
  /**
21
22
  * This is the main Predefined Config interface which developers will populate at design-time
22
23
  */
@@ -97,4 +98,8 @@ export interface PredefinedConfig {
97
98
  * Sets the order and visibility of the Tool Panel controls in the AdapTable ToolPanel (on right of grid)
98
99
  */
99
100
  ToolPanel?: ToolPanelState;
101
+ /**
102
+ * Predefine charting models
103
+ */
104
+ Charting?: ChartingState;
100
105
  }
@@ -0,0 +1,23 @@
1
+ import { ChartModel } from '@ag-grid-community/all-modules';
2
+ import * as Redux from 'redux';
3
+ import { AdaptableState } from '../../../types';
4
+ import { ChartingState } from '../../PredefinedConfig/ChartingState';
5
+ /**
6
+ * @ReduxAction Set AG Grid Charting Models
7
+ */
8
+ export declare const SET_CHARTING_CHARTS = "SET_CHARTING_CHARTS";
9
+ /**
10
+ * @ReduxAction Charting Module is ready
11
+ */
12
+ export declare const CHARTING_READY = "CHARTING_READY";
13
+ export interface ChartingSetChartModelsAction extends Redux.Action {
14
+ charts: ChartModel[];
15
+ }
16
+ export interface ChartingReadyAction extends Redux.Action {
17
+ chartingState: ChartingState;
18
+ }
19
+ export declare const ChartingSetChartModels: (charts: ChartModel[]) => ChartingSetChartModelsAction;
20
+ export declare const ChartingReady: (chartingState: ChartingState) => ChartingReadyAction;
21
+ export declare const initialState: ChartingState;
22
+ export declare const ChartingGetChartModels: (state: AdaptableState) => ChartingState['ChartDefinitions'];
23
+ export declare const ChartingReducer: Redux.Reducer<ChartingState>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChartingReducer = exports.ChartingGetChartModels = exports.initialState = exports.ChartingReady = exports.ChartingSetChartModels = exports.CHARTING_READY = exports.SET_CHARTING_CHARTS = void 0;
4
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
5
+ /**
6
+ * @ReduxAction Set AG Grid Charting Models
7
+ */
8
+ exports.SET_CHARTING_CHARTS = 'SET_CHARTING_CHARTS';
9
+ /**
10
+ * @ReduxAction Charting Module is ready
11
+ */
12
+ exports.CHARTING_READY = 'CHARTING_READY';
13
+ const ChartingSetChartModels = (charts) => ({
14
+ charts,
15
+ type: exports.SET_CHARTING_CHARTS,
16
+ });
17
+ exports.ChartingSetChartModels = ChartingSetChartModels;
18
+ const ChartingReady = (chartingState) => ({
19
+ type: exports.CHARTING_READY,
20
+ chartingState,
21
+ });
22
+ exports.ChartingReady = ChartingReady;
23
+ exports.initialState = {
24
+ ChartDefinitions: GeneralConstants_1.EMPTY_ARRAY,
25
+ };
26
+ const ChartingGetChartModels = (state) => state.Charting.ChartDefinitions;
27
+ exports.ChartingGetChartModels = ChartingGetChartModels;
28
+ const ChartingReducer = (state = exports.initialState, action) => {
29
+ switch (action.type) {
30
+ case exports.SET_CHARTING_CHARTS:
31
+ const newCharts = action.charts.map((chartModel) => ({
32
+ model: chartModel,
33
+ }));
34
+ return Object.assign(Object.assign({}, state), { ChartDefinitions: newCharts });
35
+ }
36
+ return state;
37
+ };
38
+ exports.ChartingReducer = ChartingReducer;
@@ -33,6 +33,7 @@ const ScheduleRedux = tslib_1.__importStar(require("../ActionsReducers/ScheduleR
33
33
  const TeamSharingRedux = tslib_1.__importStar(require("../ActionsReducers/TeamSharingRedux"));
34
34
  const QueryRedux = tslib_1.__importStar(require("../ActionsReducers/QueryRedux"));
35
35
  const StatusBarRedux = tslib_1.__importStar(require("../ActionsReducers/StatusBarRedux"));
36
+ const ChartingRedux = tslib_1.__importStar(require("../ActionsReducers/ChartingRedux"));
36
37
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
37
38
  const ConfigConstants = tslib_1.__importStar(require("../../Utilities/Constants/ConfigConstants"));
38
39
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
@@ -146,6 +147,7 @@ class AdaptableStore {
146
147
  Theme: ThemeRedux.ThemeReducer,
147
148
  ToolPanel: ToolPanelRedux.ToolPanelReducer,
148
149
  Query: QueryRedux.QueryReducer,
150
+ Charting: ChartingRedux.ChartingReducer,
149
151
  // dead reducers
150
152
  PercentBar: DeadRedux.PercentBarReducer,
151
153
  UpdatedRow: DeadRedux.UpdatedRowReducer,
@@ -30,10 +30,10 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
30
30
  }
31
31
  if (this.api.internalApi.getAdaptableOptions().alertOptions.dataChangeDetectionPolicy ===
32
32
  'formattedValue') {
33
- const { oldValue, newValue } = cellDataChangedInfo;
33
+ const { oldValue, newValue, rowNode } = cellDataChangedInfo;
34
34
  const columnId = cellDataChangedInfo.column.columnId;
35
- const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, oldValue);
36
- const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, newValue);
35
+ const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(rowNode, columnId, oldValue);
36
+ const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(rowNode, columnId, newValue);
37
37
  if (oldFormattedValue === newFormattedValue) {
38
38
  // if the formattedValues are identical, then no alert is fired
39
39
  return;
@@ -6,7 +6,7 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
7
  class ChartingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
8
8
  constructor(api) {
9
- super(ModuleConstants.ChartingModuleId, 'Charts', 'chart', 'ChartPopup', 'Create Charts in order to see Adaptable Data visually', api);
9
+ super(ModuleConstants.ChartingModuleId, 'Charts', 'chart', 'ChartPopup', 'Create AG Grid Charts in order to see Adaptable Data visually', api);
10
10
  }
11
11
  isModuleAvailable() {
12
12
  return this.api.chartingApi.isChartingEnabled() && super.isModuleAvailable();
@@ -29,10 +29,10 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
29
29
  // - flash for the underlying small data changes, but the visual does not
30
30
  if (this.api.internalApi.getAdaptableOptions().alertOptions.dataChangeDetectionPolicy ===
31
31
  'formattedValue') {
32
- const { oldValue, newValue } = cellDataChangedInfo;
32
+ const { oldValue, newValue, rowNode } = cellDataChangedInfo;
33
33
  const columnId = cellDataChangedInfo.column.columnId;
34
- const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, oldValue);
35
- const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, newValue);
34
+ const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(rowNode, columnId, oldValue);
35
+ const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(rowNode, columnId, newValue);
36
36
  if (oldFormattedValue === newFormattedValue) {
37
37
  // if the formattedValues are identical, then no alert is fired
38
38
  return;
@@ -1,6 +1,6 @@
1
1
  import { NumberFormatterOptions, DateFormatterOptions, AdaptableFormat, StringFormatterOptions } from '../../PredefinedConfig/Common/AdaptableFormat';
2
2
  export declare function Format(input: any, format: AdaptableFormat): string;
3
- export declare function NumberFormatter(input: number, options?: NumberFormatterOptions): string;
3
+ export declare function NumberFormatter(input: number | string, options?: NumberFormatterOptions): string;
4
4
  export declare function DateFormatter(input: number | Date | string, options: DateFormatterOptions): string | undefined;
5
5
  export declare function StringFormatter(input: string, options?: StringFormatterOptions): string;
6
6
  declare const _default: {