@adaptabletools/adaptable 12.0.1-canary.0 → 12.0.3

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 (143) hide show
  1. package/base.css +5 -18
  2. package/bundle.cjs.js +107 -107
  3. package/index.css +6 -22
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
  8. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/EditOptions.d.ts +6 -9
  10. package/src/AdaptableOptions/ExportOptions.d.ts +15 -0
  11. package/src/AdaptableOptions/Glue42PluginOptions.d.ts +1 -1
  12. package/src/AdaptableOptions/IPushPullPluginOptions.d.ts +1 -3
  13. package/src/AdaptableOptions/StateOptions.d.ts +9 -23
  14. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +34 -1
  15. package/src/Api/ChartingApi.d.ts +19 -2
  16. package/src/Api/FilterApi.d.ts +7 -2
  17. package/src/Api/FinanceApi.d.ts +8 -8
  18. package/src/Api/FormatColumnApi.d.ts +6 -6
  19. package/src/Api/GridApi.d.ts +1 -1
  20. package/src/Api/Implementation/ChartingApiImpl.d.ts +6 -0
  21. package/src/Api/Implementation/ChartingApiImpl.js +17 -0
  22. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -0
  23. package/src/Api/Implementation/ConfigApiImpl.js +11 -0
  24. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -0
  25. package/src/Api/Implementation/FilterApiImpl.js +5 -0
  26. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +3 -3
  27. package/src/Api/Implementation/FormatColumnApiImpl.js +13 -11
  28. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  29. package/src/Api/Implementation/GridApiImpl.js +2 -2
  30. package/src/Api/Implementation/InternalApiImpl.js +1 -2
  31. package/src/Api/Implementation/LayoutApiImpl.js +1 -1
  32. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +1 -0
  33. package/src/Api/Implementation/TeamSharingApiImpl.js +5 -0
  34. package/src/Api/StatusBarApi.d.ts +3 -0
  35. package/src/Api/TeamSharingApi.d.ts +4 -0
  36. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  37. package/src/PredefinedConfig/CalculatedColumnState.d.ts +0 -5
  38. package/src/PredefinedConfig/ChartingState.d.ts +20 -0
  39. package/src/PredefinedConfig/ChartingState.js +2 -0
  40. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +4 -1
  41. package/src/PredefinedConfig/Common/CellSummary.d.ts +3 -0
  42. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +9 -0
  43. package/src/PredefinedConfig/Common/FDC3Context.d.ts +12 -3
  44. package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +1 -2
  45. package/src/PredefinedConfig/Common/FilterActionOnDataChange.js +1 -2
  46. package/src/PredefinedConfig/Common/Types.d.ts +1 -1
  47. package/src/PredefinedConfig/ExportState.d.ts +6 -0
  48. package/src/PredefinedConfig/FormatColumnState.d.ts +4 -1
  49. package/src/PredefinedConfig/IPushPullState.d.ts +16 -5
  50. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  51. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  52. package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
  53. package/src/PredefinedConfig/ShortcutState.d.ts +1 -1
  54. package/src/PredefinedConfig/TeamSharingState.d.ts +6 -0
  55. package/src/Redux/ActionsReducers/ChartingRedux.d.ts +23 -0
  56. package/src/Redux/ActionsReducers/ChartingRedux.js +38 -0
  57. package/src/Redux/ActionsReducers/GridRedux.d.ts +30 -1
  58. package/src/Redux/ActionsReducers/GridRedux.js +105 -2
  59. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +10 -11
  60. package/src/Redux/ActionsReducers/LayoutRedux.js +13 -10
  61. package/src/Redux/Store/AdaptableStore.js +39 -8
  62. package/src/Strategy/AdaptableModuleBase.d.ts +4 -0
  63. package/src/Strategy/AdaptableModuleBase.js +6 -0
  64. package/src/Strategy/AlertModule.js +3 -3
  65. package/src/Strategy/ChartingModule.js +1 -1
  66. package/src/Strategy/DashboardModule.js +1 -0
  67. package/src/Strategy/ExportModule.js +1 -0
  68. package/src/Strategy/FlashingCellModule.js +3 -3
  69. package/src/Strategy/FormatColumnModule.js +3 -3
  70. package/src/Strategy/GridInfoModule.js +2 -0
  71. package/src/Strategy/Interface/IModule.d.ts +11 -1
  72. package/src/Strategy/LayoutModule.js +2 -0
  73. package/src/Strategy/TeamSharingModule.d.ts +11 -1
  74. package/src/Strategy/TeamSharingModule.js +104 -0
  75. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -0
  76. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -0
  77. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +3 -0
  78. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +3 -0
  79. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +3 -0
  80. package/src/Utilities/Helpers/FormatHelper.d.ts +1 -1
  81. package/src/Utilities/Helpers/FormatHelper.js +7 -3
  82. package/src/Utilities/Helpers/Helper.js +1 -1
  83. package/src/Utilities/ObjectFactory.d.ts +5 -1
  84. package/src/Utilities/ObjectFactory.js +12 -2
  85. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
  86. package/src/Utilities/Services/ReportService.d.ts +1 -1
  87. package/src/Utilities/Services/ReportService.js +5 -5
  88. package/src/Utilities/Services/TeamSharingService.js +0 -2
  89. package/src/View/AdaptableViewFactory.js +0 -2
  90. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +2 -9
  91. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +13 -1
  92. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +17 -14
  93. package/src/View/Components/Buttons/ButtonDelete.js +3 -3
  94. package/src/View/Components/FilterForm/QuickFilterForm.js +22 -1
  95. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -0
  96. package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +1 -1
  97. package/src/View/Filter/FilterSummary.d.ts +1 -1
  98. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +13 -9
  99. package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -1
  100. package/src/View/Layout/LayoutPopup.d.ts +1 -1
  101. package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
  102. package/src/View/Layout/LayoutViewPanel.js +2 -1
  103. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +2 -27
  104. package/src/View/TeamSharing/SharedEntityDependencies.d.ts +8 -0
  105. package/src/View/TeamSharing/SharedEntityDependencies.js +27 -0
  106. package/src/View/TeamSharing/SharedEntityObjectView.d.ts +9 -0
  107. package/src/View/TeamSharing/SharedEntityObjectView.js +84 -0
  108. package/src/View/TeamSharing/TeamSharingApplyButton.d.ts +6 -0
  109. package/src/View/TeamSharing/TeamSharingApplyButton.js +15 -0
  110. package/src/agGrid/Adaptable.d.ts +4 -2
  111. package/src/agGrid/Adaptable.js +37 -22
  112. package/src/components/icons/index.js +0 -4
  113. package/src/metamodel/adaptable.metamodel.d.ts +224 -2
  114. package/src/metamodel/adaptable.metamodel.js +1 -1
  115. package/src/types.d.ts +4 -2
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
  118. package/src/View/Alert/AlertSharedEntity.d.ts +0 -5
  119. package/src/View/Alert/AlertSharedEntity.js +0 -19
  120. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.d.ts +0 -5
  121. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.js +0 -20
  122. package/src/View/ConditionalStyle/ConditionalStyleSharedEntity.d.ts +0 -5
  123. package/src/View/ConditionalStyle/ConditionalStyleSharedEntity.js +0 -23
  124. package/src/View/CustomSort/CustomSortSharedEntity.d.ts +0 -6
  125. package/src/View/CustomSort/CustomSortSharedEntity.js +0 -24
  126. package/src/View/Export/ExportSharedEntity.d.ts +0 -5
  127. package/src/View/Export/ExportSharedEntity.js +0 -16
  128. package/src/View/Filter/FilterSharedEntity.d.ts +0 -5
  129. package/src/View/Filter/FilterSharedEntity.js +0 -15
  130. package/src/View/FormatColumn/FormatColumnSharedEntity.d.ts +0 -5
  131. package/src/View/FormatColumn/FormatColumnSharedEntity.js +0 -18
  132. package/src/View/FreeTextColumn/FreeTextColumnSharedEntity.d.ts +0 -5
  133. package/src/View/FreeTextColumn/FreeTextColumnSharedEntity.js +0 -24
  134. package/src/View/Layout/LayoutSharedEntity.d.ts +0 -5
  135. package/src/View/Layout/LayoutSharedEntity.js +0 -15
  136. package/src/View/PlusMinus/PlusMinusSharedEntity.d.ts +0 -5
  137. package/src/View/PlusMinus/PlusMinusSharedEntity.js +0 -21
  138. package/src/View/Query/NamedQuerySharedEntity.d.ts +0 -5
  139. package/src/View/Query/NamedQuerySharedEntity.js +0 -19
  140. package/src/View/Shortcut/ShortcutSharedEntity.d.ts +0 -5
  141. package/src/View/Shortcut/ShortcutSharedEntity.js +0 -19
  142. package/src/View/TeamSharing/TeamSharingPopup.d.ts +0 -23
  143. package/src/View/TeamSharing/TeamSharingPopup.js +0 -163
package/index.css CHANGED
@@ -2672,6 +2672,10 @@ template {
2672
2672
  --ab-cmp-adaptable-statusbar__font-weight: 400;
2673
2673
  --ab-cmp-adaptable-statusbar__border: 1px solid var(--ab-color-primary); }
2674
2674
 
2675
+ :root {
2676
+ --ab-cmp-adaptable-shared-entity-shared-object__border: 2px solid var(--ab-color-primary);
2677
+ --ab-cmp-adaptable-shared-entity-shared-object__nesting-color: var(--ab-color-primary); }
2678
+
2675
2679
  .ab-Radio-input:focus + svg rect {
2676
2680
  stroke: var(--ab-color-accent);
2677
2681
  stroke-width: 2; }
@@ -4113,28 +4117,8 @@ button.ab-StatusBar__SubPanel:hover {
4113
4117
  background-color: var(--ab-cmp-adaptable-statusbar-sub-panel-icon__background-color-hover);
4114
4118
  cursor: pointer; }
4115
4119
 
4116
- .ab-StatusBar {
4117
- display: flex;
4118
- border-right: var(--ab-cmp-adaptable-statusbar__border);
4119
- border-left: var(--ab-cmp-adaptable-statusbar__border); }
4120
-
4121
- .ab-StatusBar__SubPanel {
4122
- padding: var(--ab-cmp-adaptable-statusbar-sub-panel__padding);
4123
- border: 0;
4124
- background: none;
4125
- font-weight: 400;
4126
- border-right: var(--ab-cmp-adaptable-statusbar__border); }
4127
-
4128
- .ab-StatusBar__SubPanel:last-child {
4129
- border-right: 0; }
4130
-
4131
- .ab-StatusBar__SubPanel,
4132
- .ab-StatusBar__SubPanel .ab-SimpleButton {
4133
- color: var(--ab-cmp-adaptable-statusbar__color); }
4134
-
4135
- button.ab-StatusBar__SubPanel:hover {
4136
- background-color: var(--ab-cmp-adaptable-statusbar-sub-panel-icon__background-color-hover);
4137
- cursor: pointer; }
4120
+ .ab-Shared-Entity-Shared-Object {
4121
+ border: var(--ab-cmp-adaptable-shared-entity-shared-object__border); }
4138
4122
 
4139
4123
  .ab-alert--error {
4140
4124
  background: var(--ab-color-error); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "12.0.1-canary.0",
3
+ "version": "12.0.3",
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: 1656107619570;
1
+ declare const _default: 1656962682750;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1656107619570;
3
+ exports.default = 1656962682750;
@@ -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
@@ -7,28 +7,22 @@ import { GridCell } from '../PredefinedConfig/Selection/GridCell';
7
7
  */
8
8
  export interface EditOptions {
9
9
  /**
10
- * Function to validate on Server Adaptable data edits
11
- *
12
- * @defaultValue undefined
10
+ * Function to validate Adaptable data edits on Server
13
11
  */
14
12
  validateOnServer?: (cellDataChangedInfo: CellDataChangedInfo) => Promise<ValidationResult>;
15
13
  /**
16
- * Displays message after Server Validation
14
+ * Whether to display message after Server Validation runs
17
15
  *
18
16
  * @defaultValue true
19
17
  * @gridInfoItem
20
18
  */
21
19
  displayServerValidationMessages?: boolean;
22
20
  /**
23
- * Function which checks if given Grid Cell is editable
24
- *
25
- * @defaultValue undefined
21
+ * Function which checks if a given Grid Cell is editable
26
22
  */
27
23
  isCellEditable?: (gridCell: GridCell) => boolean;
28
24
  /**
29
25
  * Custom Operations to use in Smart Edit
30
- *
31
- * @defaultValue undefined
32
26
  */
33
27
  smartEditCustomOperations?: SmartEditCustomOperation[];
34
28
  }
@@ -58,6 +52,9 @@ export declare type SmartEditCustomOperation = {
58
52
  */
59
53
  operation: (context: SmartEditOperationContext) => number;
60
54
  };
55
+ /**
56
+ * Operation used by Smart Edit - either System or Custom
57
+ */
61
58
  export declare type SmartEditOperation = SmartEditCustomOperation | MathOperation;
62
59
  /**
63
60
  * Context used in Custom Smart Edit Operations
@@ -101,9 +101,24 @@ export interface ExportFormContext extends FormContext {
101
101
  */
102
102
  customDestination: CustomDestination;
103
103
  }
104
+ /**
105
+ * List of System Export Destinations
106
+ */
104
107
  export declare type SystemExportDestinations = SystemExportDestination[];
108
+ /**
109
+ * Export Destinations provided by AdapTable
110
+ */
105
111
  export declare type SystemExportDestination = 'Excel' | 'CSV' | 'Clipboard' | 'JSON';
112
+ /**
113
+ * Report Context sent when using Custom Export Destinations
114
+ */
106
115
  export interface ReportContext extends BaseContext {
116
+ /**
117
+ * Definition of Report being Run
118
+ */
107
119
  report: Report;
120
+ /**
121
+ * Data being exported in the Report
122
+ */
108
123
  reportData: ReportData;
109
124
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Options for using the Glue42 plugin which provides a mechanism whereby AdapTable can be integreated with multiple widgets
2
+ * Options for using the Glue42 plugin
3
3
  */
4
4
  export interface Glue42PluginOptions {
5
5
  /**
@@ -1,7 +1,5 @@
1
1
  /**
2
- * Options required for when using the ipushpull plugin
3
- *
4
- * ipushpull allows users to collborate and share data in powerful ways and it integrates very closely with AdapTable.
2
+ * Options available in ipushpull plugin; allows users to collborate and share data in powerful ways
5
3
  */
6
4
  export interface IPushPullPluginOptions {
7
5
  /**
@@ -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
  }
@@ -42,10 +42,15 @@ export interface FilterApi {
42
42
  */
43
43
  isQuickFilterVisible(): boolean;
44
44
  /**
45
- * Retrieves all the Column Filters in the Column Filter State (of Predefined Config)
45
+ * Retrieves all Column Filters in currently applied Layout
46
46
  * @returns column filters
47
47
  */
48
48
  getColumnFilters(): ColumnFilter[];
49
+ /**
50
+ * Retrieves all Column Filters in a given Layout
51
+ * @param layoutName Layout to retrieve Column Filters for
52
+ */
53
+ getColumnFiltersForLayout(layoutName: string): ColumnFilter[];
49
54
  /**
50
55
  * Sets Column Filters - will replace filters for existing column and leave other column filters in place
51
56
  * @param columnFilters Column Filters to set
@@ -72,7 +77,7 @@ export interface FilterApi {
72
77
  */
73
78
  clearColumnFilters(): void;
74
79
  /**
75
- * Clears existing Column Filters and then sets the new ones
80
+ * Clears existing Column Filters and sets new ones
76
81
  * @param columnFilters Column Filters to set
77
82
  */
78
83
  clearAndSetColumnFilter(columnFilters: ColumnFilter[]): void;
@@ -10,49 +10,49 @@ export interface FinanceApi {
10
10
  */
11
11
  getPluginOptions(): FinancePluginOptions;
12
12
  /**
13
- * Creates Instrument Context
13
+ * Creates FDC3 Instrument Context
14
14
  * @param instrumentColumn Instrument Column to create Context For
15
15
  * @param rowNode Row Node to use for Context Data
16
16
  */
17
17
  createFDC3InstrumentContext(instrumentColumn: InstrumentColumn, rowNode: RowNode): InstrumentContext;
18
18
  /**
19
- * Creates Instrumentlist Context
19
+ * Creates FDC3 Instrumentlist Context
20
20
  * @param instrumentColumn Instrument Column to create Context For
21
21
  * @param rowNode Row Nodes to use for Context Data
22
22
  */
23
23
  createFDC3InstrumentListContext(instrumentColumn: InstrumentColumn, rowNodes: RowNode[]): InstrumentListContext;
24
24
  /**
25
- * Creates Position Context
25
+ * Creates FDC3 Position Context
26
26
  * @param instrumentColumn Position Column to create Context For
27
27
  * @param rowNode Row Node to use for Context Data
28
28
  */
29
29
  createFDC3PositionContext(positionColumn: PositionColumn, rowNode: RowNode): PositionContext;
30
30
  /**
31
- * Creates Portfolio Context
31
+ * Creates FDC3 Portfolio Context
32
32
  * @param instrumentColumn Position Column to create Context For
33
33
  * @param rowNode Row Nodes to use for Context Data
34
34
  */
35
35
  createFDC3PortfolioContext(positionColumn: PositionColumn, rowNodes: RowNode[]): PortfolioContext;
36
36
  /**
37
- * Creates Contact Context
37
+ * Creates FDC3 Contact Context
38
38
  * @param instrumentColumn Contact Column to create Context For
39
39
  * @param rowNode Row Node to use for Context Data
40
40
  */
41
41
  createFDC3ContactContext(contactColumn: ContactColumn, rowNode: RowNode): ContactContext;
42
42
  /**
43
- * Creates Contact List Context
43
+ * Creates FDC3 Contact List Context
44
44
  * @param instrumentColumn Contact Column to create Context For
45
45
  * @param rowNode Row Nodes to use for Context Data
46
46
  */
47
47
  createFDC3ContactListContext(contactColumn: ContactColumn, rowNodes: RowNode[]): ContactListContext;
48
48
  /**
49
- * Creates Organization Context
49
+ * Creates FDC3 Organization Context
50
50
  * @param instrumentColumn Organization Column to create Context For
51
51
  * @param rowNode Row Node to use for Context Data
52
52
  */
53
53
  createFDC3OrganizationContext(organizationColumn: OrganizationColumn, rowNode: RowNode): OrganizationContext;
54
54
  /**
55
- * Creates Country Context
55
+ * Creates FDC3 Country Context
56
56
  * @param instrumentColumn Country Column to create Context For
57
57
  * @param rowNode Row Node to use for Context Data
58
58
  */
@@ -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;
@@ -15,6 +15,7 @@ export declare class FilterApiImpl extends ApiBase implements FilterApi {
15
15
  isQuickFilterAvailable(): boolean;
16
16
  isQuickFilterVisible(): boolean;
17
17
  getColumnFilters(): ColumnFilter[];
18
+ getColumnFiltersForLayout(layoutName: string): ColumnFilter[];
18
19
  setColumnFilter(columnFilters: ColumnFilter[]): ColumnFilter[] | null;
19
20
  clearColumnFilter(columnFilter: ColumnFilter): void;
20
21
  clearColumnFilterByColumns(columns: string[]): void;
@@ -47,6 +47,11 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
47
47
  const currentLayout = this.adaptable.api.layoutApi.getCurrentLayout();
48
48
  return (_a = currentLayout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
49
49
  }
50
+ getColumnFiltersForLayout(layoutName) {
51
+ var _a;
52
+ const layout = this.adaptable.api.layoutApi.getLayoutByName(layoutName);
53
+ return (_a = layout.ColumnFilters) !== null && _a !== void 0 ? _a : [];
54
+ }
50
55
  setColumnFilter(columnFilters) {
51
56
  columnFilters.forEach((columnFilter) => {
52
57
  if (!columnFilter.Predicate) {
@@ -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;