@adaptabletools/adaptable 11.2.2 → 11.2.4

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 (98) hide show
  1. package/base.css +24 -1
  2. package/bundle.cjs.js +103 -103
  3. package/index.css +28 -1
  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 +3 -0
  8. package/src/AdaptableOptions/AdaptableOptions.d.ts +7 -0
  9. package/src/AdaptableOptions/FinancePluginOptions.d.ts +33 -3
  10. package/src/AdaptableOptions/FormatColumnOptions.d.ts +9 -0
  11. package/src/AdaptableOptions/FormatColumnOptions.js +2 -0
  12. package/src/AdaptableOptions/LayoutOptions.d.ts +36 -11
  13. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +0 -1
  14. package/src/Api/ColumnApi.d.ts +4 -1
  15. package/src/Api/FinanceApi.d.ts +3 -2
  16. package/src/Api/FormatColumnApi.d.ts +22 -1
  17. package/src/Api/GridApi.d.ts +8 -1
  18. package/src/Api/Implementation/ColumnApiImpl.js +6 -2
  19. package/src/Api/Implementation/FilterApiImpl.js +2 -7
  20. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +5 -0
  21. package/src/Api/Implementation/FormatColumnApiImpl.js +29 -0
  22. package/src/Api/Implementation/FreeTextColumnApiImpl.js +3 -3
  23. package/src/Api/Implementation/GridApiImpl.d.ts +3 -0
  24. package/src/Api/Implementation/GridApiImpl.js +3 -0
  25. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
  26. package/src/Api/Implementation/InternalApiImpl.js +49 -28
  27. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  28. package/src/Api/Implementation/LayoutApiImpl.js +6 -0
  29. package/src/Api/Implementation/SystemStatusApiImpl.js +1 -1
  30. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +2 -1
  31. package/src/Api/Implementation/TeamSharingApiImpl.js +11 -2
  32. package/src/Api/Implementation/ThemeApiImpl.js +1 -1
  33. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -1
  34. package/src/Api/Implementation/UserInterfaceApiImpl.js +16 -4
  35. package/src/Api/InternalApi.d.ts +2 -0
  36. package/src/Api/LayoutApi.d.ts +6 -1
  37. package/src/Api/TeamSharingApi.d.ts +10 -1
  38. package/src/Api/UserInterfaceApi.d.ts +6 -1
  39. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  40. package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +8 -3
  41. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +5 -5
  42. package/src/PredefinedConfig/Common/AdaptablePredicate.js +17 -1
  43. package/src/PredefinedConfig/Common/FDC3Context.d.ts +5 -1
  44. package/src/Redux/ActionsReducers/TeamSharingRedux.d.ts +1 -1
  45. package/src/Redux/ActionsReducers/TeamSharingRedux.js +4 -4
  46. package/src/Strategy/DashboardModule.js +3 -0
  47. package/src/Strategy/FilterModule.d.ts +7 -0
  48. package/src/Strategy/FilterModule.js +11 -2
  49. package/src/Strategy/FormatColumnModule.js +1 -1
  50. package/src/Strategy/Interface/IModule.d.ts +5 -0
  51. package/src/Strategy/LayoutModule.js +7 -7
  52. package/src/Strategy/Utilities/getObjectTagsViewItems.js +1 -1
  53. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +4 -1
  54. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +4 -3
  55. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +16 -36
  56. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +2 -4
  57. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +24 -14
  58. package/src/Utilities/Services/CalculatedColumnExpressionService.js +32 -9
  59. package/src/View/AdaptablePopover/index.d.ts +1 -0
  60. package/src/View/AdaptablePopover/index.js +2 -2
  61. package/src/View/AdaptableView.js +8 -2
  62. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  63. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  64. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.d.ts +13 -0
  65. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +41 -0
  66. package/src/View/Components/EntityRulesEditor/index.js +2 -1
  67. package/src/View/Components/ExpressionWizard.js +2 -1
  68. package/src/View/Components/FilterForm/FilterForm.d.ts +4 -1
  69. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +4 -1
  70. package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
  71. package/src/View/Components/FilterForm/QuickFilterForm.js +15 -2
  72. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
  73. package/src/View/Components/Popups/AdaptableToaster.js +1 -0
  74. package/src/View/Components/TagValueSelector/index.js +4 -3
  75. package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +2 -2
  76. package/src/View/Export/ReportExportDropdown.js +1 -1
  77. package/src/View/Filter/ActiveFiltersPanel.d.ts +1 -13
  78. package/src/View/Filter/ActiveFiltersPanel.js +8 -31
  79. package/src/View/Filter/FilterStatusBarSubPanelPopover.js +1 -10
  80. package/src/View/Filter/FilterViewPanel.js +2 -2
  81. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +3 -2
  82. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +53 -22
  83. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -3
  84. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
  85. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
  86. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -1
  87. package/src/View/Schedule/Wizard/ScheduleWizard.js +4 -4
  88. package/src/agGrid/Adaptable.d.ts +3 -0
  89. package/src/agGrid/Adaptable.js +31 -22
  90. package/src/agGrid/agGridHelper.js +1 -0
  91. package/src/components/ExpressionEditor/BaseEditorInput.js +8 -1
  92. package/src/components/ExpressionEditor/index.js +54 -5
  93. package/src/metamodel/adaptable.metamodel.d.ts +49 -20
  94. package/src/metamodel/adaptable.metamodel.js +158 -31
  95. package/src/parser/src/types.d.ts +1 -1
  96. package/src/types.d.ts +5 -5
  97. package/version.d.ts +1 -1
  98. package/version.js +1 -1
package/index.css CHANGED
@@ -2284,7 +2284,16 @@ template {
2284
2284
  --ab-cmp-adaptable-object-list-item__margin-bottom: var(--ab-space-3);
2285
2285
  --ab-cmp-adaptable-object-list-item-label__padding-top: var(--ab-space-3);
2286
2286
  --ab-cmp-adaptable-object-list-item-label__width: 130px;
2287
- --ab-cmp-adaptable-object-list-item-tag__padding: 6px 12px; }
2287
+ --ab-cmp-adaptable-object-list-item-tag__padding: 6px 12px;
2288
+ --ab-cmp-adaptable-object-compact-list__background: var(--ab-color-primarylight);
2289
+ --ab-cmp-adaptable-object-compact-list__padding: var(--ab-space-2);
2290
+ --ab-cmp-adaptable-object-compact-list-item__background: var(--ab-color-defaultbackground);
2291
+ --ab-cmp-adaptable-object-compact-list-item__padding: var(--ab-space-1);
2292
+ --ab-cmp-adaptable-object-compact-list-item__margin-bottom: var(--ab-space-2);
2293
+ --ab-cmp-adaptable-object-compact-list-item-name__width: 80px;
2294
+ --ab-cmp-adaptable-object-compact-list-item-name__padding: var(--ab-space-1);
2295
+ --ab-cmp-adaptable-object-compact-list-item-name__margin-right: var(--ab-space-1);
2296
+ --ab-cmp-adaptable-object-compact-list-item-name__font-size: var(--ab-font-size-4); }
2288
2297
 
2289
2298
  :root {
2290
2299
  --ab-cmp-adaptable-options__background-color: var(--ab-color-defaultbackground);
@@ -3691,6 +3700,24 @@ html.ab--theme-dark .ab-ListBoxFilterForm--aggrid-style {
3691
3700
  .ab-Adaptable-Object-List__Item__label:hover .ab-Adaptable-Object-List__Item__edit-property {
3692
3701
  visibility: visible; }
3693
3702
 
3703
+ .ab-Adaptable-Object-Compact-List {
3704
+ padding: var(--ab-cmp-adaptable-object-compact-list__padding);
3705
+ background: var(--ab-cmp-adaptable-object-compact-list__background); }
3706
+
3707
+ .ab-Adaptable-Object-Compact-List .ab-Adaptable-Object-Compact-List__Item {
3708
+ padding: var(--ab-cmp-adaptable-object-compact-list-item__padding);
3709
+ margin-bottom: var(--ab-cmp-adaptable-object-compact-list-item__margin-bottom);
3710
+ background: var(--ab-cmp-adaptable-object-compact-list-item__background); }
3711
+
3712
+ .ab-Adaptable-Object-Compact-List .ab-Adaptable-Object-Compact-List__Item:last-child {
3713
+ margin-bottom: 0; }
3714
+
3715
+ .ab-Adaptable-Object-Compact-List__Item__Name {
3716
+ width: var(--ab-cmp-adaptable-object-compact-list-item-name__width);
3717
+ padding: var(--ab-cmp-adaptable-object-compact-list-item-name__padding);
3718
+ margin-right: var(--ab-cmp-adaptable-object-compact-list-item-name__margin-right);
3719
+ font-size: var(--ab-cmp-adaptable-object-compact-list-item-name__font-size); }
3720
+
3694
3721
  .ab-StatusBar {
3695
3722
  display: flex; }
3696
3723
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.2.2",
3
+ "version": "11.2.4",
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: 1652713434785;
1
+ declare const _default: 1653160464222;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1652713434785;
3
+ exports.default = 1653160464222;
@@ -174,6 +174,9 @@ export interface IAdaptable {
174
174
  forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
175
175
  forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
176
176
  getVisibleRowNodes(): RowNode[];
177
+ getAllRowNodes(config?: {
178
+ includeGroupRows?: boolean;
179
+ }): RowNode[];
177
180
  getRowsInViewport(): RowNode[];
178
181
  isGroupRowNode(rowNode: RowNode): boolean;
179
182
  isVisibleNode(rowNode: RowNode): boolean;
@@ -22,6 +22,7 @@ import { GridOptions, Module } from '@ag-grid-community/all-modules';
22
22
  import { FlashingCellOptions } from './FlashingCellOptions';
23
23
  import { AlertOptions } from './AlertOptions';
24
24
  import { AdaptableQLOptions } from './AdaptableQLOptions';
25
+ import { FormatColumnOptions } from './FormatColumnOptions';
25
26
  /**
26
27
  * Group of property options enabling developers to set up AdapTable at design time to fit precise requirements - provides AG Grid, Predefined Config and other information required to ensure a full, rich user experience
27
28
  */
@@ -141,6 +142,12 @@ export interface AdaptableOptions {
141
142
  * @gridInfoContainer
142
143
  */
143
144
  flashingCellOptions?: FlashingCellOptions;
145
+ /**
146
+ * Options for managing format columns
147
+ *
148
+ * @gridInfoContainer
149
+ */
150
+ formatColumnOptions?: FormatColumnOptions;
144
151
  /**
145
152
  * General options to manage AdapTable e.g. grouping behaviour, Primary Keys
146
153
  *
@@ -1,4 +1,5 @@
1
- import { ContextMenuContext } from '../../types';
1
+ import { ContextMenuContext, GridCell } from '../../types';
2
+ import { CustomFDC3Context } from '../PredefinedConfig/Common/FDC3Context';
2
3
  /**
3
4
  * Options required for when using the Finance plugin
4
5
  */
@@ -27,6 +28,14 @@ export interface FinancePluginOptions {
27
28
  * FDC3 Organizations
28
29
  */
29
30
  organizationColumns?: OrganizationColumn[];
31
+ /**
32
+ * Custom FDC3 Columns
33
+ */
34
+ customFDC3Columns?: CustomFDC3Column[];
35
+ /**
36
+ * Custom FDC3 Intents
37
+ */
38
+ customFDC3Intents?: CustomFDC3Intent[];
30
39
  };
31
40
  /**
32
41
  * Columns to use a Weighted Average aggregation
@@ -69,11 +78,15 @@ export interface FDC3Column {
69
78
  /**
70
79
  * FDC3 intents which the Column can raise
71
80
  */
72
- intents?: any;
81
+ intents?: any[];
73
82
  /**
74
83
  * Label to display in Intent Context Menu Item
75
84
  */
76
85
  intentContextMenuLabel?: string | ((raiseFDC3IntentContext: RaiseFDC3IntentContext) => string);
86
+ /**
87
+ * Returns the icon to display in the Raise Intent Context Menu Item
88
+ */
89
+ getIconForIntent?: (intent: FDC3Intent | CustomFDC3Intent) => any;
77
90
  }
78
91
  /**
79
92
  * A Column which will be defined as an FDC3 Instrument
@@ -222,10 +235,27 @@ export declare type CountryIntents = CountryIntent[];
222
235
  * FDC3 Intents available to a Country Column
223
236
  */
224
237
  export declare type CountryIntent = 'ViewChart';
238
+ /**
239
+ * A Column which will be defined as Custom FDC3 (can be any datatype)
240
+ */
241
+ export interface CustomFDC3Column extends FDC3Column {
242
+ /**
243
+ * Custom FDC3 Intents available to the column
244
+ */
245
+ intents: CustomFDC3Intent[];
246
+ /**
247
+ * Function which creates FDC3 context for the current column and row
248
+ */
249
+ createContext: (gridCell: GridCell) => CustomFDC3Context;
250
+ }
225
251
  /**
226
252
  * Full list of FDC3 Intents available - each FDC3 Column can use a subset
227
253
  */
228
254
  export declare type FDC3Intent = 'StartCall' | 'StartChat' | 'ViewAnalysis' | 'ViewChart' | 'ViewContact' | 'ViewInstrument' | 'ViewNews' | 'ViewQuote';
255
+ /**
256
+ * Custom FDC3 Intent - just a string value
257
+ */
258
+ export declare type CustomFDC3Intent = string;
229
259
  /**
230
260
  * Context passed into Raise FDC3 Intent functions (e.g. get label)
231
261
  */
@@ -233,5 +263,5 @@ export interface RaiseFDC3IntentContext extends ContextMenuContext {
233
263
  /**
234
264
  * FDC3 Intent that was raised
235
265
  */
236
- intent: FDC3Intent;
266
+ intent: FDC3Intent | CustomFDC3Intent;
237
267
  }
@@ -0,0 +1,9 @@
1
+ export declare type CustomDisplayFormatter = {
2
+ id: string;
3
+ label?: string;
4
+ handler: (value: any) => any;
5
+ type: 'Date' | 'Number' | 'String';
6
+ };
7
+ export interface FormatColumnOptions {
8
+ customDisplayFormatters?: CustomDisplayFormatter[];
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,3 @@
1
- import { AdaptableApi } from '../Api/AdaptableApi';
2
1
  import { AlertDefinition } from '../PredefinedConfig/AlertState';
3
2
  import { ConditionalStyle } from '../PredefinedConfig/ConditionalStyleState';
4
3
  import { CustomSort } from '../PredefinedConfig/CustomSortState';
@@ -60,43 +59,69 @@ export interface LayoutOptions {
60
59
  /**
61
60
  * Customize how Layouts are displayed in Settings Panel
62
61
  */
63
- viewOptions?: LayoutViewOptions;
62
+ layoutViewOptions?: LayoutViewOptions;
64
63
  /**
65
- * Checks if the provided AdaptableObject is available in the given Layout
64
+ * Options for leveraging Object Tags to extend Layouts
66
65
  */
67
- isObjectAvailableInLayout?: (context: IsObjectAvailableInLayoutContext) => boolean;
66
+ layoutTagOptions?: LayoutTagOptions;
67
+ }
68
+ export interface LayoutTagOptions {
68
69
  /**
69
- * Automatically generate a tag for each existing layout
70
+ * Automatically generate an Object Tag for each Layout
70
71
  */
71
72
  autoGenerateTagsForLayouts?: boolean | ((context: AutoGenerateTagsForLayoutsContext) => AdaptableObjectTag[]);
73
+ /**
74
+ * Checks if the provided Adaptable Object is available in the given Layout
75
+ */
76
+ isObjectAvailableInLayout?: (context: LayoutAvailableContext) => boolean;
77
+ /**
78
+ * Automatically checks if Adaptable Objects Tags are available in current Layout
79
+ * @defaultValue false
80
+ */
81
+ autoCheckTagsForLayouts?: boolean;
72
82
  }
73
83
  /**
74
84
  * Customize how Layouts are displayed in Settings Panel
75
85
  */
76
86
  export interface LayoutViewOptions {
77
87
  /**
78
- * How many columns to display in inline Layout preview
88
+ * How many Column Names to display in inline Layout preview
79
89
  *
80
90
  * @defaultValue 10
81
91
  */
82
92
  maxColumnsToDisplay?: number;
83
93
  }
84
94
  /**
85
- * Context for `LayoutOptions.isObjectAvailableInLayout` method
95
+ * Context for `LayoutOptions.isObjectAvailableInLayout` functions
86
96
  */
87
- export interface IsObjectAvailableInLayoutContext {
88
- abObject: LayoutAssociatedObject;
97
+ export interface LayoutAvailableContext extends BaseContext {
98
+ /**
99
+ * Object being checked
100
+ */
101
+ adaptableObject: LayoutAssociatedObject;
102
+ /**
103
+ * Current Adaptable Module
104
+ */
89
105
  module: AdaptableModule;
106
+ /**
107
+ * Current Layout
108
+ */
90
109
  layout: Layout;
91
- adaptableApi: AdaptableApi;
92
110
  }
93
111
  /**
94
- * Types of objects that can be associated with a Layout
112
+ * Types of Adaptable Objects that can be associated with a Layout
95
113
  */
96
114
  export declare type LayoutAssociatedObject = AlertDefinition | ConditionalStyle | CustomSort | FlashingCellDefinition | FormatColumn | PlusMinusNudge | Shortcut | BaseSchedule;
97
115
  /**
98
116
  * Context for `LayoutOptions.autoGenerateTagsForLayouts` method
99
117
  */
100
118
  export interface AutoGenerateTagsForLayoutsContext extends BaseContext {
119
+ /**
120
+ * Layouts currently in Adaptable State
121
+ */
101
122
  layouts: Layout[];
123
+ /**
124
+ * Object Tags provided in User Interface Options
125
+ */
126
+ objectTags: AdaptableObjectTag[];
102
127
  }
@@ -18,7 +18,6 @@ export interface UserInterfaceOptions {
18
18
  * @gridInfoItem
19
19
  */
20
20
  useCustomMacLikeScrollbars?: boolean;
21
- testproperty?: any;
22
21
  /**
23
22
  * The application icon to appear in Dashboard and elsewhere (e.g. OpenFin notifications)
24
23
  *
@@ -227,7 +227,10 @@ export interface ColumnApi {
227
227
  * @param columnFilter Current applied filter
228
228
  */
229
229
  getDistinctFilterDisplayValuesForColumn(columnId: string, filter: string): Promise<{
230
- values: any[];
230
+ values: {
231
+ value: any;
232
+ label: string;
233
+ }[];
231
234
  suppressClientSideFilter: boolean;
232
235
  }>;
233
236
  /**
@@ -1,5 +1,5 @@
1
1
  import { RowNode } from '@ag-grid-community/all-modules';
2
- import { ContactColumn, ContactIntent, CountryColumn, FDC3Intent, FinancePluginOptions, InstrumentColumn, InstrumentIntent, OrganizationColumn, PositionColumn, PositionIntent } from '../AdaptableOptions/FinancePluginOptions';
2
+ import { ContactColumn, ContactIntent, CountryColumn, CustomFDC3Column, CustomFDC3Intent, FDC3Intent, FinancePluginOptions, InstrumentColumn, InstrumentIntent, OrganizationColumn, PositionColumn, PositionIntent } from '../AdaptableOptions/FinancePluginOptions';
3
3
  import { ContactContext, ContactListContext, CountryContext, FDC3Context, InstrumentContext, InstrumentListContext, OrganizationContext, PortfolioContext, PositionContext } from '../types';
4
4
  /**
5
5
  * Provides run-time access to the Finance Plugin
@@ -82,6 +82,7 @@ export interface FinanceApi {
82
82
  * @param instrumentColumnId Column to Look
83
83
  */
84
84
  getCountryColumnById(countryColumnId: string): CountryColumn;
85
+ getCustomFDC3ColumnById(customFDC3ColumnId: string): CustomFDC3Column;
85
86
  /**
86
87
  * Publishes an FDC3 Message Event of type `Broadcast`
87
88
  * @param context context for Event
@@ -92,7 +93,7 @@ export interface FinanceApi {
92
93
  * @param context context for Event
93
94
  * @param intent FDC3 Intent to Raise
94
95
  */
95
- publishRaiseFDC3IntentEvent(context: FDC3Context, intent: FDC3Intent): void;
96
+ publishRaiseFDC3IntentEvent(context: FDC3Context, intent: FDC3Intent | CustomFDC3Intent): void;
96
97
  /**
97
98
  * Checks whether the Instrument Intent is valid for Instrument Lists
98
99
  * @param intent FDC3 Intent to check
@@ -1,5 +1,5 @@
1
1
  import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison } from '../PredefinedConfig/FormatColumnState';
2
- import { AdaptableColumn } from '../types';
2
+ import { AdaptableColumn, AdaptableFormat } from '../types';
3
3
  import { RowNode } from '@ag-grid-community/all-modules';
4
4
  /**
5
5
  * Provides run-time access to the Format Column Module and associated state
@@ -172,4 +172,25 @@ export interface FormatColumnApi {
172
172
  * Publishes the CheckboxColumnClickedEvent - when the checkbox in an Checkbox Column is clicked
173
173
  */
174
174
  fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
175
+ /**
176
+ * Format value according to format options.
177
+ *
178
+ * @param value value to format
179
+ * @param options formatter options
180
+ */
181
+ getNumberFormattedValue(value: any, options: AdaptableFormat['Options']): any;
182
+ /**
183
+ * Format value according to format options.
184
+ *
185
+ * @param value value to format
186
+ * @param options formatter options
187
+ */
188
+ getStringFormattedValue(value: any, options: AdaptableFormat['Options']): string;
189
+ /**
190
+ * Format value according to format options.
191
+ *
192
+ * @param value value to format
193
+ * @param options formatter options
194
+ */
195
+ getDateFormattedValue(value: any, options: AdaptableFormat['Options']): string;
175
196
  }
@@ -197,9 +197,16 @@ export interface GridApi {
197
197
  */
198
198
  getFirstDisplayedRowNode(): RowNode;
199
199
  /**
200
- * Retrieves all Row Nodes currently in the Grid (i.e. filtered)
200
+ * Retrieves all filtered Row Nodes currently in the Grid (i.e. after applying the current filter)
201
201
  */
202
202
  getVisibleRowNodes(): RowNode[];
203
+ /**
204
+ * Retrieves all Row Nodes currently in the Grid (by default excluding the group rows)
205
+ * @param config - configuration
206
+ */
207
+ getAllRowNodes(config?: {
208
+ includeGroupRows?: boolean;
209
+ }): RowNode[];
203
210
  /**
204
211
  * Retrieves Row Nodes that contain given Primary Keys
205
212
  * @param primaryKeyValues Primary Kev Values to look up
@@ -10,7 +10,8 @@ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants")
10
10
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
11
11
  class ColumnApiImpl extends ApiBase_1.ApiBase {
12
12
  getColumns() {
13
- return this.adaptable.api.gridApi.getGridState().Columns;
13
+ var _a;
14
+ return (_a = this.adaptable.api.gridApi.getGridState().Columns) !== null && _a !== void 0 ? _a : [];
14
15
  }
15
16
  getVisibleColumns() {
16
17
  const layout = this.adaptable.api.layoutApi.getCurrentLayout();
@@ -298,7 +299,10 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
298
299
  const { gridCells, suppressClientSideFilter } = await this.adaptable.getDistinctFilterValuesForColumn(abColumn, false, filter);
299
300
  return {
300
301
  values: this.sortDistinctValues(gridCells, abColumn).map((cv) => {
301
- return cv.displayValue;
302
+ return {
303
+ label: cv.displayValue,
304
+ value: cv.normalisedValue,
305
+ };
302
306
  }),
303
307
  suppressClientSideFilter,
304
308
  };
@@ -156,7 +156,7 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
156
156
  return columnFilters.map((cf) => this.columnFilterToString(cf)).join(', ');
157
157
  }
158
158
  evaluateColumnFilter(columnFilter, node) {
159
- var _a, _b;
159
+ var _a;
160
160
  if (!columnFilter.Predicate) {
161
161
  return true;
162
162
  }
@@ -172,15 +172,10 @@ class FilterApiImpl extends ApiBase_1.ApiBase {
172
172
  return true;
173
173
  }
174
174
  let value = gridCell.normalisedValue;
175
- if (((_b = columnFilter.Predicate) === null || _b === void 0 ? void 0 : _b.PredicateId) === 'Contains' && column.dataType === 'Date') {
176
- // although 'Contains' Predicate is NOT relevant for Date columns, we have to handle the special case of QuickSearching
177
- // in that case, we have to evaluate the displayedValue of the cell, not the normalisedValue (it's a textual search after all)
178
- value = gridCell.displayValue;
179
- }
180
175
  return this.adaptable.api.predicateApi.handlePredicate(columnFilter.Predicate, {
181
176
  value: value,
182
177
  oldValue: null,
183
- displayValue: gridCell.normalisedValue,
178
+ displayValue: gridCell.displayValue,
184
179
  node,
185
180
  column,
186
181
  }, true);
@@ -4,6 +4,7 @@ import { FormatColumnApi } from '../FormatColumnApi';
4
4
  import { FormatColumnState, FormatColumn, ColumnStyle, ColumnComparison } from '../../PredefinedConfig/FormatColumnState';
5
5
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
6
6
  import { RowNode } from '@ag-grid-community/all-modules';
7
+ import { AdaptableFormat } from '../../types';
7
8
  export declare class FormatColumnApiImpl extends ApiBase implements FormatColumnApi {
8
9
  getFormatColumnState(): FormatColumnState;
9
10
  getAllFormatColumn(config?: {
@@ -44,4 +45,8 @@ export declare class FormatColumnApiImpl extends ApiBase implements FormatColumn
44
45
  getCheckBoxStyleFormatColumn(column: AdaptableColumn): FormatColumn | undefined;
45
46
  isCheckBoxStyleFormatColumn(column: AdaptableColumn): boolean;
46
47
  fireCheckboxColumnClickedEvent(columnId: string, rowData: any, primaryKeyValue: any, isChecked: boolean): void;
48
+ private applyCustomFormatters;
49
+ getNumberFormattedValue(value: any, options: AdaptableFormat['Options']): string;
50
+ getStringFormattedValue(value: any, options: AdaptableFormat['Options']): string;
51
+ getDateFormattedValue(value: any, options: AdaptableFormat['Options']): string;
47
52
  }
@@ -8,6 +8,7 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
8
8
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
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
+ const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
11
12
  class FormatColumnApiImpl extends ApiBase_1.ApiBase {
12
13
  getFormatColumnState() {
13
14
  return this.getAdaptableState().FormatColumn;
@@ -269,5 +270,33 @@ class FormatColumnApiImpl extends ApiBase_1.ApiBase {
269
270
  };
270
271
  this.adaptable.api.eventApi.emit('CheckboxColumnClicked', checkboxColumnClickedInfo);
271
272
  }
273
+ applyCustomFormatters(value, options) {
274
+ var _a, _b;
275
+ const columnCustomFormatters = (_a = options === null || options === void 0 ? void 0 : options.CustomDisplayFormats) !== null && _a !== void 0 ? _a : [];
276
+ if (!(columnCustomFormatters === null || columnCustomFormatters === void 0 ? void 0 : columnCustomFormatters.length)) {
277
+ return value;
278
+ }
279
+ const adaptableOptions = this.adaptable.adaptableOptions;
280
+ const customFormattersFromOptions = (_b = adaptableOptions === null || adaptableOptions === void 0 ? void 0 : adaptableOptions.formatColumnOptions) === null || _b === void 0 ? void 0 : _b.customDisplayFormatters;
281
+ const customFormatters = columnCustomFormatters.map((customFormatter) => customFormattersFromOptions === null || customFormattersFromOptions === void 0 ? void 0 : customFormattersFromOptions.find((customFormatterOption) => customFormatterOption.id === customFormatter.Id));
282
+ return customFormatters.reduce((acc, formatter) => {
283
+ if (formatter && formatter.handler) {
284
+ return formatter.handler(acc);
285
+ }
286
+ return acc;
287
+ }, value);
288
+ }
289
+ getNumberFormattedValue(value, options) {
290
+ let preparedValue = this.applyCustomFormatters(value, options);
291
+ return FormatHelper_1.default.NumberFormatter(preparedValue, options);
292
+ }
293
+ getStringFormattedValue(value, options) {
294
+ let preparedValue = this.applyCustomFormatters(value, options);
295
+ return FormatHelper_1.default.StringFormatter(preparedValue, options);
296
+ }
297
+ getDateFormattedValue(value, options) {
298
+ let preparedValue = this.applyCustomFormatters(value, options);
299
+ return FormatHelper_1.default.DateFormatter(preparedValue, options);
300
+ }
272
301
  }
273
302
  exports.FormatColumnApiImpl = FormatColumnApiImpl;
@@ -12,11 +12,11 @@ class FreeTextColumnApiImpl extends ApiBase_1.ApiBase {
12
12
  return this.getAdaptableState().FreeTextColumn;
13
13
  }
14
14
  getAllFreeTextColumn() {
15
- return this.getFreeTextColumnState().FreeTextColumns;
15
+ var _a;
16
+ return (_a = this.getFreeTextColumnState().FreeTextColumns) !== null && _a !== void 0 ? _a : [];
16
17
  }
17
18
  getFreeTextColumnById(columnId) {
18
- var _a;
19
- return (_a = this.getAllFreeTextColumn()) === null || _a === void 0 ? void 0 : _a.find((ftc) => ftc.ColumnId === columnId);
19
+ return this.getAllFreeTextColumn().find((ftc) => ftc.ColumnId === columnId);
20
20
  }
21
21
  addFreeTextColumn(freeTextColumn) {
22
22
  this.addUidToAdaptableObject(freeTextColumn);
@@ -59,6 +59,9 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
59
59
  getFirstRowNode(): RowNode;
60
60
  getFirstDisplayedRowNode(): RowNode;
61
61
  getVisibleRowNodes(): RowNode[];
62
+ getAllRowNodes(config: {
63
+ includeGroupRows?: boolean;
64
+ }): RowNode[];
62
65
  getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
63
66
  getRawValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
64
67
  getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
@@ -188,6 +188,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
188
188
  getVisibleRowNodes() {
189
189
  return this.adaptable.getVisibleRowNodes();
190
190
  }
191
+ getAllRowNodes(config) {
192
+ return this.adaptable.getAllRowNodes(config);
193
+ }
191
194
  getGridCellFromRowNode(rowNode, columnId) {
192
195
  return this.adaptable.getGridCellFromRowNode(rowNode, columnId);
193
196
  }
@@ -131,4 +131,6 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
131
131
  private getLayoutTags;
132
132
  dispatchReduxAction(action: Action): void;
133
133
  showSettingsPanel(module: AdaptableModule, moduleParams?: ModuleParams): void;
134
+ getLabelForTag(adaptableObjectTag: AdaptableObjectTag): string;
135
+ getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
134
136
  }
@@ -364,17 +364,17 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
364
364
  getQueryPreviewData() {
365
365
  var _a;
366
366
  const firstRowNode = this.adaptable.api.gridApi.getFirstRowNode();
367
- const firstRowData = (_a = firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.data) !== null && _a !== void 0 ? _a : {};
368
- if (firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.data) {
369
- // we have to add the calculated values which are not persisted in the row data
370
- const firstRowPrimaryKeyValue = this.adaptable.api.gridApi.getPrimaryKeyValueForRowNode(firstRowNode);
371
- this.adaptable.api.calculatedColumnApi
372
- .getAllCalculatedColumn()
373
- .forEach((calculatedColumn) => {
374
- firstRowData[calculatedColumn.ColumnId] = this.adaptable.api.gridApi.getCellRawValue(firstRowPrimaryKeyValue, calculatedColumn.ColumnId);
375
- });
376
- // FIXME AFL shouldn't here be also the FreeTextColumn??
377
- }
367
+ const firstRowData = (_a = Object.assign({}, firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.data)) !== null && _a !== void 0 ? _a : {};
368
+ // handle CalcCols which are not persisted in the rowModel
369
+ this.adaptable.api.calculatedColumnApi.getAllCalculatedColumn().forEach((calculatedColumn) => {
370
+ const columnRawValue = this.adaptable.api.gridApi.getRawValueFromRowNode(firstRowNode, calculatedColumn.ColumnId);
371
+ firstRowData[calculatedColumn.ColumnId] = columnRawValue;
372
+ });
373
+ // handle FreeTextCols which are not persisted in the rowModel
374
+ this.adaptable.api.freeTextColumnApi.getAllFreeTextColumn().forEach((freeTextColumn) => {
375
+ const columnRawValue = this.adaptable.api.gridApi.getRawValueFromRowNode(firstRowNode, freeTextColumn.ColumnId);
376
+ firstRowData[freeTextColumn.ColumnId] = columnRawValue;
377
+ });
378
378
  return firstRowData;
379
379
  }
380
380
  waitForTeamSharingImportEnd() {
@@ -470,19 +470,31 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
470
470
  return wordToSpell;
471
471
  }
472
472
  hasLayoutSpecificObjects() {
473
- return (typeof this.adaptable.adaptableOptions.layoutOptions.isObjectAvailableInLayout === 'function');
473
+ const layoutTagOptions = this.getAdaptableOptions().layoutOptions.layoutTagOptions;
474
+ if (!layoutTagOptions) {
475
+ return false;
476
+ }
477
+ if (layoutTagOptions.autoCheckTagsForLayouts == true ||
478
+ typeof (layoutTagOptions === null || layoutTagOptions === void 0 ? void 0 : layoutTagOptions.isObjectAvailableInLayout) === 'function') {
479
+ return true;
480
+ }
481
+ return false;
474
482
  }
475
483
  isObjectAvailableInLayout(object, module) {
476
484
  if (!this.hasLayoutSpecificObjects()) {
477
485
  return true;
478
486
  }
487
+ const layoutTagOptions = this.getAdaptableOptions().layoutOptions.layoutTagOptions;
488
+ if ((layoutTagOptions === null || layoutTagOptions === void 0 ? void 0 : layoutTagOptions.autoCheckTagsForLayouts) == true) {
489
+ return this.getAdaptableApi().layoutApi.isObjectAvailableInCurrentLayout(object);
490
+ }
479
491
  const context = {
480
- abObject: object,
492
+ adaptableObject: object,
481
493
  module,
482
- layout: this.adaptable.api.layoutApi.getCurrentLayout(),
483
- adaptableApi: this.adaptable.api,
494
+ layout: this.getAdaptableApi().layoutApi.getCurrentLayout(),
495
+ adaptableApi: this.getAdaptableApi(),
484
496
  };
485
- return this.adaptable.adaptableOptions.layoutOptions.isObjectAvailableInLayout(context);
497
+ return layoutTagOptions === null || layoutTagOptions === void 0 ? void 0 : layoutTagOptions.isObjectAvailableInLayout(context);
486
498
  }
487
499
  showLayoutNotAssociatedObjects() {
488
500
  return this.getAdaptableState().System.ShowLayoutNotAssociatedObjects;
@@ -507,30 +519,33 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
507
519
  }
508
520
  if (typeof this.adaptable.adaptableOptions.userInterfaceOptions.objectTags === 'function') {
509
521
  // sanitize the provided tags, just to be sure that the user does NOT break the UI
510
- return this.adaptable.adaptableOptions.userInterfaceOptions
522
+ return (this.adaptable.adaptableOptions.userInterfaceOptions
511
523
  .objectTags(this.adaptable.api)
512
- .filter((tag) => (tag === null || tag === void 0 ? void 0 : tag.value) != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined);
524
+ // jw - not sure how to check here only for when its a object and then do check
525
+ .filter((tag) => typeof tag == 'string' ? tag : tag.value != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined));
513
526
  }
514
527
  }
515
528
  getLayoutTags() {
516
- if (!this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts) {
529
+ var _a;
530
+ if (!((_a = this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions) === null || _a === void 0 ? void 0 : _a.autoGenerateTagsForLayouts)) {
517
531
  return;
518
532
  }
519
- if (this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts === true) {
533
+ if (this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions.autoGenerateTagsForLayouts ===
534
+ true) {
520
535
  return this.adaptable.api.layoutApi.getAllLayout().map((layout) => {
521
- return {
522
- label: layout.Name,
523
- value: layout.Name,
524
- };
536
+ return layout.Name;
525
537
  });
526
538
  }
527
- if (typeof this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts === 'function') {
528
- const customGeneratedTags = this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts({
539
+ if (typeof this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions
540
+ .autoGenerateTagsForLayouts === 'function') {
541
+ const autoGenerateTagsForLayoutsContext = {
529
542
  layouts: this.adaptable.api.layoutApi.getAllLayout(),
543
+ objectTags: this.getAdaptableApi().userInterfaceApi.getAdaptableObjectTags(),
530
544
  adaptableApi: this.adaptable.api,
531
- });
545
+ };
546
+ const customGeneratedTags = this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions.autoGenerateTagsForLayouts(autoGenerateTagsForLayoutsContext);
532
547
  // sanitize the provided tags, just to be sure that the user does NOT break the UI
533
- return customGeneratedTags.filter((tag) => (tag === null || tag === void 0 ? void 0 : tag.value) != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined);
548
+ return customGeneratedTags.filter((tag) => typeof tag == 'string' ? tag : tag.value != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined);
534
549
  }
535
550
  }
536
551
  // General way to get to store from inside Adaptable...
@@ -541,5 +556,11 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
541
556
  showSettingsPanel(module, moduleParams) {
542
557
  this.showModulePopup(module, moduleParams);
543
558
  }
559
+ getLabelForTag(adaptableObjectTag) {
560
+ return typeof adaptableObjectTag == 'string' ? adaptableObjectTag : adaptableObjectTag.label;
561
+ }
562
+ getValueForTag(adaptableObjectTag) {
563
+ return typeof adaptableObjectTag == 'string' ? adaptableObjectTag : adaptableObjectTag.value;
564
+ }
544
565
  }
545
566
  exports.InternalApiImpl = InternalApiImpl;