@adaptabletools/adaptable 20.3.0-canary.1 → 20.3.0

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 (35) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableOptions/ColumnOptions.d.ts +38 -154
  3. package/src/AdaptableOptions/DefaultAdaptableOptions.js +1 -0
  4. package/src/AdaptableOptions/FilterOptions.d.ts +7 -0
  5. package/src/AdaptableState/Common/AdaptablePredicate.js +12 -2
  6. package/src/AdaptableState/Common/CustomWindowConfig.d.ts +11 -11
  7. package/src/AdaptableState/Common/ProgressIndicatorConfig.d.ts +1 -4
  8. package/src/AdaptableState/Common/RowScope.d.ts +1 -1
  9. package/src/AdaptableState/FormatColumnState.d.ts +8 -8
  10. package/src/Api/Internal/ColumnInternalApi.js +2 -2
  11. package/src/Api/Internal/FormatColumnInternalApi.d.ts +4 -2
  12. package/src/Api/Internal/FormatColumnInternalApi.js +32 -3
  13. package/src/Strategy/FormatColumnModule.js +2 -0
  14. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.d.ts +5 -0
  15. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +12 -0
  16. package/src/Utilities/ObjectFactory.js +1 -0
  17. package/src/Utilities/getScopeViewItems.js +5 -2
  18. package/src/View/Components/ColumnFilter/utils.js +20 -0
  19. package/src/View/Components/NewScopeComponent.js +5 -1
  20. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
  21. package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +4 -0
  22. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -40
  23. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +24 -23
  24. package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.d.ts +8 -0
  25. package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.js +31 -0
  26. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +18 -4
  27. package/src/agGrid/AdaptableAgGrid.js +5 -2
  28. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
  29. package/src/agGrid/AgGridColumnAdapter.js +5 -4
  30. package/src/agGrid/AgGridExportAdapter.js +1 -1
  31. package/src/env.js +2 -2
  32. package/src/metamodel/adaptable.metamodel.d.ts +102 -1
  33. package/src/metamodel/adaptable.metamodel.js +1 -1
  34. package/src/types.d.ts +1 -1
  35. package/tsconfig.esm.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "20.3.0-canary.1",
3
+ "version": "20.3.0",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -57,6 +57,9 @@ export interface BaseColumnHeaderContext extends BaseContext {
57
57
  */
58
58
  currentLayout: Layout;
59
59
  }
60
+ /**
61
+ * Context for Columns created automatically by AG Grid when grouping
62
+ */
60
63
  export interface AutoGroupColumnHeaderContext extends BaseColumnHeaderContext {
61
64
  /**
62
65
  * Auto-generated Group Column when GroupDisplayType is `single` column
@@ -71,11 +74,14 @@ export interface AutoGroupColumnHeaderContext extends BaseColumnHeaderContext {
71
74
  */
72
75
  groupedColumnIds: string[];
73
76
  }
77
+ /**
78
+ * Context for Columns created when Row Grouping
79
+ */
74
80
  export interface RowGroupColumnHeaderContext extends BaseColumnHeaderContext {
75
81
  /**
76
- * Group Columns - see `TableLayout.RowGroupedColumns` or `PivotLayout.PivotGroupedColumns`
82
+ * A Row Grouped Column - see `TableLayout.RowGroupedColumns` or `PivotLayout.PivotGroupedColumns`
77
83
  */
78
- columnType: 'groupColumn';
84
+ columnType: 'rowGroupColumn';
79
85
  /**
80
86
  * Technical ID of the Column
81
87
  */
@@ -85,6 +91,9 @@ export interface RowGroupColumnHeaderContext extends BaseColumnHeaderContext {
85
91
  */
86
92
  groupColumnId: string;
87
93
  }
94
+ /**
95
+ * Context for standard Table Layout Columns
96
+ */
88
97
  export interface TableColumnHeaderContext extends BaseColumnHeaderContext {
89
98
  /**
90
99
  * Table Column - see `TableLayout.TableColumns`
@@ -99,9 +108,12 @@ export interface TableColumnHeaderContext extends BaseColumnHeaderContext {
99
108
  */
100
109
  aggregation?: string;
101
110
  }
111
+ /**
112
+ * Context for Column Group headers
113
+ */
102
114
  export interface TableColumnGroupHeaderContext extends BaseColumnHeaderContext {
103
115
  /**
104
- * Column Group - see https://www.ag-grid.com/javascript-data-grid/column-groups/
116
+ * Column Group (used when Column Grouping)
105
117
  */
106
118
  columnType: 'tableColumnGroup';
107
119
  /**
@@ -117,9 +129,12 @@ export interface TableColumnGroupHeaderContext extends BaseColumnHeaderContext {
117
129
  */
118
130
  state: 'expanded' | 'collapsed';
119
131
  }
132
+ /**
133
+ * Context for Pivot Column Groups
134
+ */
120
135
  export interface PivotColumnGroupHeaderContext extends BaseColumnHeaderContext {
121
136
  /**
122
- * Pivot Column - see `PivotLayout.PivotColumns`
137
+ * Pivot Column Column - created by `PivotLayout.PivotColumns`
123
138
  */
124
139
  columnType: 'pivotColumnGroup';
125
140
  /**
@@ -135,11 +150,14 @@ export interface PivotColumnGroupHeaderContext extends BaseColumnHeaderContext {
135
150
  */
136
151
  state: 'expanded' | 'collapsed';
137
152
  }
138
- export interface PivotAggregationColumnHeaderContext extends BaseColumnHeaderContext {
153
+ /**
154
+ * Context for Pivot Result Columns
155
+ */
156
+ export interface PivotResultColumnHeaderContext extends BaseColumnHeaderContext {
139
157
  /**
140
- * Pivot Aggregation Column - see `PivotLayout.PivotAggregationColumns`
158
+ * Pivot Result Column - intersecton of `PivotLayout.PivotAggregationColumns` and `PivotLayout.PivotColumns`
141
159
  */
142
- columnType: 'pivotAggregationColumn';
160
+ columnType: 'pivotResultColumn';
143
161
  /**
144
162
  * Technical ID of the generated Column
145
163
  */
@@ -157,6 +175,9 @@ export interface PivotAggregationColumnHeaderContext extends BaseColumnHeaderCon
157
175
  */
158
176
  aggregation: string;
159
177
  }
178
+ /**
179
+ * Context for Pivot Grand Total Columns
180
+ */
160
181
  export interface PivotGrandTotalHeaderContext extends BaseColumnHeaderContext {
161
182
  /**
162
183
  * Pivot Grand Total - see `PivotLayout.PivotGrandTotal`
@@ -171,6 +192,9 @@ export interface PivotGrandTotalHeaderContext extends BaseColumnHeaderContext {
171
192
  */
172
193
  aggregation: string;
173
194
  }
195
+ /**
196
+ * Context for Pivot Total Columns
197
+ */
174
198
  export interface PivotColumnTotalHeaderContext extends BaseColumnHeaderContext {
175
199
  /**
176
200
  * Pivot Column Total - see `PivotLayout.PivotColumnTotal`
@@ -189,6 +213,9 @@ export interface PivotColumnTotalHeaderContext extends BaseColumnHeaderContext {
189
213
  */
190
214
  aggregation: string;
191
215
  }
216
+ /**
217
+ * Context for Pivot Aggregation Totals
218
+ */
192
219
  export interface PivotAggregationTotalHeaderContext extends BaseColumnHeaderContext {
193
220
  /**
194
221
  * Pivot Aggregation Total Column - see `PivotLayout.PivotAggregationColumns.TotalColumn`
@@ -211,153 +238,10 @@ export interface PivotAggregationTotalHeaderContext extends BaseColumnHeaderCont
211
238
  */
212
239
  pivotKey: string;
213
240
  }
214
- export type ColumnHeaderContext = TableColumnHeaderContext | TableColumnGroupHeaderContext | AutoGroupColumnHeaderContext | RowGroupColumnHeaderContext | PivotColumnGroupHeaderContext | PivotAggregationColumnHeaderContext | PivotGrandTotalHeaderContext | PivotColumnTotalHeaderContext | PivotAggregationTotalHeaderContext;
215
- export type ColumnHeaderContextOld = BaseColumnHeaderContext & ({
216
- /**
217
- * Auto-generated Group Column when GroupDisplayType is `single` column
218
- */
219
- columnType: 'autoGroupColumn';
220
- /**
221
- * Technical ID of the Column
222
- */
223
- columnId: string;
224
- /**
225
- * IDs of the Columns that are grouped
226
- */
227
- groupedColumnIds: string[];
228
- } | {
229
- /**
230
- * Group Columns - see `TableLayout.RowGroupedColumns` or `PivotLayout.PivotGroupedColumns`
231
- */
232
- columnType: 'groupColumn';
233
- /**
234
- * Technical ID of the Column
235
- */
236
- columnId: string;
237
- /**
238
- * ID of the grouped Column
239
- */
240
- groupColumnId: string;
241
- } | {
242
- /**
243
- * Table Column - see `TableLayout.TableColumns`
244
- */
245
- columnType: 'tableColumn';
246
- /**
247
- * Technical ID of the Column
248
- */
249
- columnId: string;
250
- /**
251
- * Optional Aggregation function of the Column - see `TableLayout.TableAggregationColumns`
252
- */
253
- aggregation?: string;
254
- } | {
255
- /**
256
- * Column Group - see https://www.ag-grid.com/javascript-data-grid/column-groups/
257
- */
258
- columnType: 'tableColumnGroup';
259
- /**
260
- * Technical ID of the Column Group - see `ColGroupDef.groupId`
261
- */
262
- groupId: string;
263
- /**
264
- * IDs of the Column Group children - see `ColGroupDef.children`
265
- */
266
- childrenColumnIds: string[];
267
- /**
268
- * State of the Column Group
269
- */
270
- state: 'expanded' | 'collapsed';
271
- } | {
272
- /**
273
- * Pivot Column - see `PivotLayout.PivotColumns`
274
- */
275
- columnType: 'pivotColumnGroup';
276
- /**
277
- * Technical ID of the generated Column Group
278
- */
279
- groupId: string;
280
- /**
281
- * Pivot Keys for the current Column Group
282
- */
283
- pivotKeys: string[];
284
- /**
285
- * State of the Column Group
286
- */
287
- state: 'expanded' | 'collapsed';
288
- } | {
289
- /**
290
- * Pivot Aggregation Column - see `PivotLayout.PivotAggregationColumns`
291
- */
292
- columnType: 'pivotAggregationColumn';
293
- /**
294
- * Technical ID of the generated Column
295
- */
296
- columnId: string;
297
- /**
298
- * Current Pivot Keys
299
- */
300
- pivotKeys: string[];
301
- /**
302
- * ID of the Aggregated Column - see `PivotLayout.PivotAggregationColumns`
303
- */
304
- aggregatedColumnId: string;
305
- /**
306
- * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
307
- */
308
- aggregation: string;
309
- } | {
310
- /**
311
- * Pivot Grand Total - see `PivotLayout.PivotGrandTotal`
312
- */
313
- columnType: 'pivotGrandTotal';
314
- /**
315
- * ID of the Aggregated Column - see `PivotLayout.PivotAggregationColumns`
316
- */
317
- aggregatedColumnId: string;
318
- /**
319
- * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
320
- */
321
- aggregation: string;
322
- } | {
323
- /**
324
- * Pivot Column Total - see `PivotLayout.PivotColumnTotal`
325
- */
326
- columnType: 'pivotColumnTotal';
327
- /**
328
- * Current Pivot Keys
329
- */
330
- pivotKey: string;
331
- /**
332
- * ID of the Pivot Column - see `PivotLayout.PivotColumns`
333
- */
334
- pivotColumnId: string;
335
- /**
336
- * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
337
- */
338
- aggregation: string;
339
- } | {
340
- /**
341
- * Pivot Aggregation Total Column - see `PivotLayout.PivotAggregationColumns.TotalColumn`
342
- */
343
- columnType: 'pivotAggregationTotal';
344
- /**
345
- * ID of the Aggregated Column - see `PivotLayout.PivotAggregationColumns`
346
- */
347
- aggregatedColumnId: string;
348
- /**
349
- * Aggregation function of the Column - see `PivotLayout.PivotAggregationColumns.AggregationColumnValue`
350
- */
351
- aggregation: string;
352
- /**
353
- * ID of the Pivot Column - see `PivotLayout.PivotColumns`
354
- */
355
- pivotColumnId: string;
356
- /**
357
- * Current Pivot Keys
358
- */
359
- pivotKey: string;
360
- });
241
+ /**
242
+ * Context provided to columnHeader function custom Headers to be provided for any type of AG Grid Column
243
+ */
244
+ export type ColumnHeaderContext = TableColumnHeaderContext | TableColumnGroupHeaderContext | AutoGroupColumnHeaderContext | RowGroupColumnHeaderContext | PivotColumnGroupHeaderContext | PivotResultColumnHeaderContext | PivotGrandTotalHeaderContext | PivotColumnTotalHeaderContext | PivotAggregationTotalHeaderContext;
361
245
  /**
362
246
  * Context used when setting a Column Friendly Name
363
247
  */
@@ -153,6 +153,7 @@ const DefaultAdaptableOptions = {
153
153
  defaultNumericColumnFilter: 'Equals',
154
154
  defaultTextColumnFilter: 'Contains',
155
155
  defaultDateColumnFilter: 'On',
156
+ defaultArrayColumnFilter: 'In',
156
157
  hideQuickFilterDropdown: undefined,
157
158
  hideQuickFilterInput: undefined,
158
159
  quickFilterDebounce: 250,
@@ -106,6 +106,13 @@ export interface ColumnFilterOptions<TData = any> {
106
106
  * @gridInfoItem
107
107
  */
108
108
  defaultDateColumnFilter?: StrictExtract<SystemFilterPredicateId, 'After' | 'Before' | 'On' | 'NotOn' | 'In'> | ((adaptableColumnContext: AdaptableColumnContext<TData>) => StrictExtract<SystemFilterPredicateId, 'After' | 'Before' | 'On' | 'NotOn' | 'In'>);
109
+ /**
110
+ * Default filter type for array Columns ('textArray', 'numberArray', etc.)
111
+ *
112
+ * @defaultValue In
113
+ * @gridInfoItem
114
+ */
115
+ defaultArrayColumnFilter?: StrictExtract<SystemFilterPredicateId, 'In' | 'NotIn' | 'Blanks' | 'NonBlanks'> | ((adaptableColumnContext: AdaptableColumnContext<TData>) => StrictExtract<SystemFilterPredicateId, 'In' | 'NotIn' | 'Blanks' | 'NonBlanks'>);
109
116
  /**
110
117
  * Hides Dropdown in Quick Filter Bar for a given Column
111
118
  *
@@ -172,7 +172,12 @@ export const SystemPredicateDefs = [
172
172
  icon: { name: 'unfilled-circle' },
173
173
  columnScope: { All: true },
174
174
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn', 'badgeStyle'],
175
- handler: ({ value }) => Helper.isInputNullOrEmpty(value),
175
+ handler: ({ value, column, adaptableApi }) => {
176
+ if (adaptableApi.columnApi.internalApi.hasArrayDataType(column)) {
177
+ return value == undefined || value.length === 0;
178
+ }
179
+ return Helper.isInputNullOrEmpty(value);
180
+ },
176
181
  },
177
182
  {
178
183
  id: 'NonBlanks',
@@ -180,7 +185,12 @@ export const SystemPredicateDefs = [
180
185
  icon: { name: 'filled-circle' },
181
186
  columnScope: { All: true },
182
187
  moduleScope: ['columnFilter', 'alert', 'flashingcell', 'formatColumn', 'badgeStyle'],
183
- handler: ({ value }) => Helper.isInputNotNullOrEmpty(value),
188
+ handler: ({ value, column, adaptableApi }) => {
189
+ if (adaptableApi.columnApi.internalApi.hasArrayDataType(column)) {
190
+ return value == undefined || value.length === 0;
191
+ }
192
+ return Helper.isInputNotNullOrEmpty(value);
193
+ },
184
194
  },
185
195
  // Numeric System Filters
186
196
  {
@@ -1,51 +1,51 @@
1
1
  import { AdaptableSystemIconName } from '../../types';
2
2
  import { CustomRenderContext, AdaptableFrameworkComponent } from '../../agGrid/AdaptableFrameworkComponent';
3
3
  /**
4
- * Config used to open a custom window
4
+ * Config used to open a Custom Window
5
5
  */
6
6
  export interface CustomWindowConfig {
7
7
  /**
8
- * Unique identifier for the custom window.
8
+ * Unique identifier for Custom Window
9
9
  */
10
10
  id: string;
11
11
  /**
12
- * Title of the custom window.
12
+ * Title of Custom Window
13
13
  */
14
14
  title?: string;
15
15
  /**
16
- * Icon to display in the custom window heading.
16
+ * Icon to display in Custom Window header
17
17
  */
18
18
  icon?: AdaptableSystemIconName;
19
19
  /**
20
- * Render function to display custom content in the window (if not using a framework component).
20
+ * Render function to display content in Custom Window(if not using a framework component)
21
21
  */
22
22
  render?: (customRenderContext: CustomRenderContext) => string | null;
23
23
  /**
24
- * A React, Angular or Vue Framework component to use for the custom window content.
24
+ * React, Angular or Vue Framework component to use for Custom Window content
25
25
  */
26
26
  frameworkComponent?: AdaptableFrameworkComponent;
27
27
  /**
28
- * Callback function to be called when the framework component is destroyed.
28
+ * Callback function to be called when the framework component is destroyed
29
29
  */
30
30
  onFrameworkComponentDestroyed?: () => void;
31
31
  /**
32
- * Window position in pixels.
32
+ * Size of window in pixels (provided as width, height)
33
33
  */
34
34
  size?: WindowSize;
35
35
  /**
36
- * Position of the window in pixels.
36
+ * Position of window in pixels (provided as x, y)
37
37
  */
38
38
  position?: WindowPosition;
39
39
  }
40
40
  /**
41
- * Defines size of a custom window
41
+ * Defines size of a Custom Window
42
42
  */
43
43
  export interface WindowSize {
44
44
  width: number;
45
45
  height: number;
46
46
  }
47
47
  /**
48
- * Defines position of a custom window
48
+ * Defines position of a Custom Window
49
49
  */
50
50
  export interface WindowPosition {
51
51
  x: number;
@@ -17,10 +17,7 @@ export interface ProgressIndicatorConfig {
17
17
  */
18
18
  frameworkComponent?: AdaptableFrameworkComponent;
19
19
  /**
20
- * Determines how the custom component is rendered:
21
- * - "content" (default): Inside the default Dialog with spinner
22
- * - "dialog": As a complete replacement for the Dialog
23
- * Applies to both frameworkComponent and render parameters.
20
+ * Determines whether custom component is rendered as "content" (inside window) or "dialog" (replacing window)
24
21
  */
25
22
  renderMode?: 'content' | 'dialog';
26
23
  /**
@@ -15,7 +15,7 @@ export interface RowScope {
15
15
  */
16
16
  ExcludeSummaryRows?: boolean;
17
17
  /**
18
- * Exclude Grand Total Rows
18
+ * Exclude Grand Total Rows (used in Aggregations)
19
19
  */
20
20
  ExcludeTotalRows?: boolean;
21
21
  }
@@ -26,17 +26,17 @@ export interface FormatColumn extends SuspendableObject {
26
26
  */
27
27
  Scope: ColumnScope;
28
28
  /**
29
- * Which part of the Column to apply Format to: `cell`, `column header`
29
+ * Where in Column to apply Format (`cell` or `columnHeader`)
30
30
  *
31
- * @defaultValue ['cell']
31
+ * @defaultValue 'cell'
32
32
  */
33
- Target?: FormatColumnTarget[];
33
+ Target?: FormatColumnTarget;
34
34
  /**
35
35
  * Rule to decide whether to apply Format; if undefined Format is always applied
36
36
  */
37
37
  Rule?: FormatColumnRule;
38
38
  /**
39
- * Style to apply
39
+ * AdapTable Style to apply
40
40
  */
41
41
  Style?: AdaptableStyle;
42
42
  /**
@@ -44,21 +44,21 @@ export interface FormatColumn extends SuspendableObject {
44
44
  */
45
45
  DisplayFormat?: AdaptableFormat;
46
46
  /**
47
- * Aligns cells 'Left' or 'Right' or 'Center'
47
+ * Align cells 'Left' or 'Right' or 'Center'
48
48
  */
49
49
  CellAlignment?: CellAlignment;
50
50
  /**
51
- * Which types of Rows should be formatted (data, grouped, summary)
51
+ * Which types of Rows to apply format (data, grouped, summary, total)
52
52
  */
53
53
  RowScope?: RowScope;
54
54
  /**
55
- * When to format Columns in Column Groups ('Expanded', 'Collapsed' or 'Both')
55
+ * When to format Columns in Column Groups ('Expanded', 'Collapsed', 'Both')
56
56
  *
57
57
  */
58
58
  ColumnGroupScope?: ColumnGroupScope;
59
59
  }
60
60
  /**
61
- * Target for Format Column: Specifies which visual elements of the column receive formatting
61
+ * Specifies whether Column's cells or header is formatted
62
62
  */
63
63
  export type FormatColumnTarget = 'cell' | 'columnHeader';
64
64
  /**
@@ -141,7 +141,7 @@ export class ColumnInternalApi extends ApiBase {
141
141
  };
142
142
  }
143
143
  if (params.column?.getColId().startsWith(`${AG_GRID_GROUPED_COLUMN}-`)) {
144
- const columnType = 'groupColumn';
144
+ const columnType = 'rowGroupColumn';
145
145
  const columnId = params.column.getColId();
146
146
  // remove `${AG_GRID_GROUPED_COLUMN}-` from beginning of columnId
147
147
  const groupColumnId = columnId.substring(`${AG_GRID_GROUPED_COLUMN}-`.length);
@@ -261,7 +261,7 @@ export class ColumnInternalApi extends ApiBase {
261
261
  };
262
262
  }
263
263
  if (isPivotResultColumn(columnId)) {
264
- const columnType = 'pivotAggregationColumn';
264
+ const columnType = 'pivotResultColumn';
265
265
  const pivotValueCol = params.colDef.pivotValueColumn;
266
266
  const aggregatedColumnId = pivotValueCol?.getColId();
267
267
  const currentLayoutAggCols = currentPivotLayout.PivotAggregationColumns?.map((col) => col.ColumnId);
@@ -1,4 +1,4 @@
1
- import { IRowNode } from 'ag-grid-enterprise';
1
+ import { HeaderValueGetterParams, IRowNode } from 'ag-grid-enterprise';
2
2
  import { AdaptableColumn, AdaptableFormat, AdaptablePredicateDef, ColumnScope, FormatColumn, FormatColumnTarget, StringFormatterOptions } from '../../types';
3
3
  import { ApiBase } from '../Implementation/ApiBase';
4
4
  export declare class FormatColumnInternalApi extends ApiBase {
@@ -49,7 +49,8 @@ export declare class FormatColumnInternalApi extends ApiBase {
49
49
  * @param config
50
50
  * @returns list of FormatColumn
51
51
  */
52
- getFormatColumnsWithDisplayFormatForColumn(column: AdaptableColumn, config?: {
52
+ getFormatColumnsWithDisplayFormatForColumn(column: AdaptableColumn, config: {
53
+ target: FormatColumnTarget;
53
54
  includeSuspended?: boolean;
54
55
  }): FormatColumn[];
55
56
  /**
@@ -129,4 +130,5 @@ export declare class FormatColumnInternalApi extends ApiBase {
129
130
  * Retrieves the columns that need rerendering based on format column predicates.
130
131
  */
131
132
  getFormatColumnColumnsDependentOnColumnChange(column: AdaptableColumn): string[];
133
+ formatColumnHeaderName(headerName: string, params: HeaderValueGetterParams): string;
132
134
  }
@@ -78,8 +78,8 @@ export class FormatColumnInternalApi extends ApiBase {
78
78
  const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment()
79
79
  .filter((formatColumn) => {
80
80
  // FormatColumn default target is 'cell', so if no target is specified, we assume 'cell'
81
- const fcTarget = formatColumn.Target ?? ['cell'];
82
- return fcTarget.includes(config.target);
81
+ const fcTarget = formatColumn.Target ?? 'cell';
82
+ return fcTarget === config.target;
83
83
  })
84
84
  .filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
85
85
  return this.getFormatColumnWithColumnInScope(formatColumns, column);
@@ -116,7 +116,13 @@ export class FormatColumnInternalApi extends ApiBase {
116
116
  * @returns list of FormatColumn
117
117
  */
118
118
  getFormatColumnsWithDisplayFormatForColumn(column, config) {
119
- const formatColumns = this.getAllFormatColumnWithDisplayFormat().filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
119
+ const formatColumns = this.getAllFormatColumnWithDisplayFormat()
120
+ .filter((formatColumn) => {
121
+ // FormatColumn default target is 'cell', so if no target is specified, we assume 'cell'
122
+ const fcTarget = formatColumn.Target ?? 'cell';
123
+ return fcTarget === config.target;
124
+ })
125
+ .filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
120
126
  return this.getFormatColumnWithColumnInScope(formatColumns, column);
121
127
  }
122
128
  /**
@@ -356,4 +362,27 @@ export class FormatColumnInternalApi extends ApiBase {
356
362
  });
357
363
  return [...columnsThatNeedRefresh];
358
364
  }
365
+ formatColumnHeaderName(headerName, params) {
366
+ // currently we only format the header name for normal columns (NOT column groups)
367
+ if (!params.column) {
368
+ return headerName;
369
+ }
370
+ const abColumn = this.getColumnApi().getColumnWithColumnId(params.column.getColId());
371
+ const activeFormatColumnsWithDisplayFormat = this.getFormatColumnApi().internalApi.getFormatColumnsWithDisplayFormatForColumn(abColumn, {
372
+ target: 'columnHeader',
373
+ });
374
+ if (!activeFormatColumnsWithDisplayFormat.length) {
375
+ return headerName;
376
+ }
377
+ const mostRelevantFormatColumn = activeFormatColumnsWithDisplayFormat.find((formatColumn) => this.formatColumnShouldRenderInHeader(formatColumn, abColumn));
378
+ if (!mostRelevantFormatColumn) {
379
+ return headerName;
380
+ }
381
+ if (mostRelevantFormatColumn.DisplayFormat?.Formatter !== 'StringFormatter') {
382
+ // headers are always strings, so we can only use StringFormatter
383
+ return headerName;
384
+ }
385
+ const formattedHeaderName = this.getFormatColumnApi().internalApi.getStringFormattedValue(headerName, null, abColumn, mostRelevantFormatColumn.DisplayFormat.Options);
386
+ return formattedHeaderName;
387
+ }
359
388
  }
@@ -10,6 +10,7 @@ import { MoveFormatColumn } from '../View/FormatColumn/MoveFormatColumn';
10
10
  import { getObjectTagsViewItems } from '../Utilities/getObjectTagsViewItems';
11
11
  import { getRuleViewItems } from '../Utilities/getRuleViewItems';
12
12
  import { getScopeViewItems } from '../Utilities/getScopeViewItems';
13
+ import { getFormatColumnSettingsTargetItems } from './Utilities/FormatColumn/getFormatColumnSettingsTargetItems';
13
14
  export class FormatColumnModule extends AdaptableModuleBase {
14
15
  constructor(api) {
15
16
  super(ModuleConstants.FormatColumnModuleId, ModuleConstants.FormatColumnFriendlyName, 'color-palette', 'FormatColumnPopup', 'Create a column style, display format or cell alignment', api);
@@ -82,6 +83,7 @@ export class FormatColumnModule extends AdaptableModuleBase {
82
83
  abObject: formatColumn,
83
84
  items: [
84
85
  getScopeViewItems(formatColumn.Scope, this.api),
86
+ getFormatColumnSettingsTargetItems(formatColumn),
85
87
  formatColumn.Rule && getRuleViewItems(formatColumn.Rule, this.api),
86
88
  {
87
89
  name: 'Style',
@@ -0,0 +1,5 @@
1
+ import { FormatColumn } from '../../../AdaptableState/FormatColumnState';
2
+ export declare const getFormatColumnSettingsTargetItems: (formatColumn: FormatColumn) => {
3
+ name: string;
4
+ values: string[];
5
+ };
@@ -0,0 +1,12 @@
1
+ export const getFormatColumnSettingsTargetItems = (formatColumn) => {
2
+ if (!formatColumn.Target || formatColumn.Target === 'cell') {
3
+ return {
4
+ name: 'Target',
5
+ values: ['Column Cells'],
6
+ };
7
+ }
8
+ return {
9
+ name: 'Target',
10
+ values: ['Column Header'],
11
+ };
12
+ };
@@ -230,6 +230,7 @@ export function CreateEmptyFormatColumn() {
230
230
  DisplayFormat: undefined,
231
231
  CellAlignment: undefined,
232
232
  RowScope: undefined,
233
+ Target: 'cell'
233
234
  };
234
235
  }
235
236
  export function CreateEmptyFreeTextColumn(defaultSpecialColumnSettings) {
@@ -1,3 +1,4 @@
1
+ import StringExtensions from './Extensions/StringExtensions';
1
2
  export const getScopeViewItems = (scope, api) => {
2
3
  let values = [];
3
4
  if ('ColumnIds' in scope && Array.isArray(scope.ColumnIds)) {
@@ -5,7 +6,9 @@ export const getScopeViewItems = (scope, api) => {
5
6
  values = scope.ColumnIds.map((columnId) => api.columnApi.getFriendlyNameForColumnId(columnId)).filter(Boolean);
6
7
  }
7
8
  if ('DataTypes' in scope) {
8
- values = scope.DataTypes;
9
+ values = scope.DataTypes.map((d) => {
10
+ return 'Data Type: ' + StringExtensions.CapitaliseFirstLetter(d);
11
+ });
9
12
  }
10
13
  if ('All' in scope) {
11
14
  values = ['All Columns'];
@@ -14,7 +17,7 @@ export const getScopeViewItems = (scope, api) => {
14
17
  values = scope.ColumnTypes;
15
18
  }
16
19
  return {
17
- label: 'Scope & Target',
20
+ label: 'Scope',
18
21
  name: 'Target',
19
22
  values,
20
23
  };
@@ -152,6 +152,26 @@ export const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicate
152
152
  case 'boolean':
153
153
  defaultQlPredicate = { operator: 'BooleanToggle', args: [] };
154
154
  break;
155
+ case 'textArray':
156
+ case 'numberArray':
157
+ let defaultQlArrayPredicate;
158
+ const defaultArrayColumnFilter = columnFilterOptions.defaultArrayColumnFilter;
159
+ if (defaultArrayColumnFilter) {
160
+ if (typeof defaultArrayColumnFilter === 'function') {
161
+ const context = {
162
+ column: abColumn,
163
+ ...api.internalApi.buildBaseContext(),
164
+ };
165
+ defaultQlArrayPredicate = defaultArrayColumnFilter(context);
166
+ }
167
+ else {
168
+ defaultQlArrayPredicate = defaultArrayColumnFilter;
169
+ }
170
+ }
171
+ defaultQlPredicate = defaultQlArrayPredicate
172
+ ? { operator: defaultQlArrayPredicate, args: [] }
173
+ : { operator: 'In', args: [] };
174
+ break;
155
175
  }
156
176
  if (defaultQlPredicate === null) {
157
177
  // take the firstavailable one