@adaptabletools/adaptable 20.2.11 → 20.3.0-canary.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 (74) hide show
  1. package/agGrid.d.ts +4 -0
  2. package/agGrid.js +5 -1
  3. package/base.css +6 -6
  4. package/base.css.map +1 -1
  5. package/index.css +6 -6
  6. package/index.css.map +1 -1
  7. package/package.json +1 -1
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
  9. package/src/AdaptableOptions/ColumnOptions.d.ts +3 -2
  10. package/src/AdaptableOptions/DefaultAdaptableOptions.js +1 -0
  11. package/src/AdaptableOptions/PredicateOptions.d.ts +2 -1
  12. package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -2
  13. package/src/AdaptableState/Common/AdaptableColumn.js +1 -0
  14. package/src/AdaptableState/Common/AdaptableFormat.d.ts +4 -0
  15. package/src/AdaptableState/Common/AdaptablePredicate.d.ts +4 -0
  16. package/src/AdaptableState/Common/AdaptablePredicate.js +17 -2
  17. package/src/AdaptableState/Common/ColumnScope.d.ts +1 -1
  18. package/src/AdaptableState/Common/CustomWindowConfig.d.ts +40 -0
  19. package/src/AdaptableState/Common/ProgressIndicatorConfig.d.ts +8 -1
  20. package/src/AdaptableState/Common/RowScope.d.ts +4 -0
  21. package/src/AdaptableState/FormatColumnState.d.ts +10 -0
  22. package/src/AdaptableState/StyledColumnState.d.ts +4 -0
  23. package/src/Api/ColumnApi.d.ts +6 -0
  24. package/src/Api/GridApi.d.ts +8 -3
  25. package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
  26. package/src/Api/Implementation/ColumnApiImpl.js +14 -0
  27. package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
  28. package/src/Api/Implementation/GridApiImpl.js +3 -0
  29. package/src/Api/Implementation/PredicateApiImpl.d.ts +1 -1
  30. package/src/Api/Implementation/PredicateApiImpl.js +25 -1
  31. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +3 -1
  32. package/src/Api/Implementation/UserInterfaceApiImpl.js +6 -0
  33. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -0
  34. package/src/Api/Internal/ColumnInternalApi.js +3 -0
  35. package/src/Api/Internal/FormatColumnInternalApi.d.ts +13 -4
  36. package/src/Api/Internal/FormatColumnInternalApi.js +33 -6
  37. package/src/Api/UserInterfaceApi.d.ts +16 -4
  38. package/src/Redux/ActionsReducers/PopupRedux.js +1 -0
  39. package/src/Strategy/StyledColumnModule.js +8 -3
  40. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +6 -0
  41. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  42. package/src/Utilities/Constants/GeneralConstants.js +1 -0
  43. package/src/Utilities/Helpers/FormatHelper.js +3 -0
  44. package/src/Utilities/getScopeViewItems.js +1 -1
  45. package/src/View/Components/ColumnFilter/utils.js +9 -4
  46. package/src/View/Components/Popups/AdaptablePopupConfirmation.js +3 -4
  47. package/src/View/Components/Popups/AdaptablePopupPrompt.js +3 -4
  48. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +1 -5
  49. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -0
  50. package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
  51. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +16 -1
  52. package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +67 -23
  53. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +34 -2
  54. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
  55. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +18 -21
  56. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -1
  57. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +22 -2
  58. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +6 -13
  59. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +5 -0
  60. package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +29 -0
  61. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  62. package/src/agGrid/AdaptableAgGrid.js +28 -2
  63. package/src/agGrid/AgGridAdapter.js +3 -7
  64. package/src/agGrid/AgGridColumnAdapter.d.ts +4 -1
  65. package/src/agGrid/AgGridColumnAdapter.js +109 -10
  66. package/src/agGrid/cellRenderers/ActionColumnRenderer.js +14 -2
  67. package/src/agGrid/cellRenderers/BadgeRenderer.js +27 -13
  68. package/src/components/ProgressIndicator/ProgressIndicator.js +18 -4
  69. package/src/env.js +2 -2
  70. package/src/layout-manager/src/index.js +2 -2
  71. package/src/metamodel/adaptable.metamodel.d.ts +43 -0
  72. package/src/metamodel/adaptable.metamodel.js +1 -1
  73. package/src/types.d.ts +2 -2
  74. package/tsconfig.esm.tsbuildinfo +1 -1
@@ -78,10 +78,11 @@ export declare class ColumnApiImpl extends ApiBase implements ColumnApi {
78
78
  getPrimaryKeyColumn(): AdaptableColumn<any>;
79
79
  getDefaultAggFunc(columnId: string): string;
80
80
  openColumnInfoSettingsPanel(): void;
81
- getColumnTypes(): string[];
81
+ getColumnTypes(): import("../../AdaptableState/Common/Types").TypeHint<string, import("../../types").AdaptableColumnType>[];
82
82
  getColumnsByColumnType(columnType: string): AdaptableColumn[];
83
83
  getRowGroupedColumns(): AdaptableColumn[];
84
84
  setColumnCaption(columnId: string, caption: string): void;
85
85
  getAGGridColDefForColumnId(columnId: string): ColDef | ColGroupDef;
86
86
  getAGGridColumnForColumnId(columnId: string): Column;
87
+ hasColumnType(columnIdentifier: string | ColDef, columnType: string): boolean;
87
88
  }
@@ -500,4 +500,18 @@ export class ColumnApiImpl extends ApiBase {
500
500
  getAGGridColumnForColumnId(columnId) {
501
501
  return this.getAgGridApi().getColumn(columnId);
502
502
  }
503
+ hasColumnType(columnIdentifier, columnType) {
504
+ const colDef = typeof columnIdentifier === 'string'
505
+ ? this.getAgGridApi().getColumnDef(columnIdentifier)
506
+ : columnIdentifier;
507
+ if (!colDef?.type) {
508
+ return false;
509
+ }
510
+ if (Array.isArray(colDef.type)) {
511
+ return colDef.type.includes(columnType);
512
+ }
513
+ else {
514
+ return colDef.type === columnType;
515
+ }
516
+ }
503
517
  }
@@ -99,6 +99,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
99
99
  isMasterDetailGrid(): boolean;
100
100
  isTreeDataGrid(): boolean;
101
101
  isGroupRowNode(rowNode: IRowNode): boolean;
102
+ isGrandTotalRowNode(rowNode: IRowNode): boolean;
102
103
  isVisibleRowNode(rowNode: IRowNode): boolean;
103
104
  isSummaryNode(rowNode: IRowNode): boolean;
104
105
  isQuickFilterAvailable(): boolean;
@@ -382,6 +382,9 @@ export class GridApiImpl extends ApiBase {
382
382
  isGroupRowNode(rowNode) {
383
383
  return this._adaptable.isGroupRowNode(rowNode);
384
384
  }
385
+ isGrandTotalRowNode(rowNode) {
386
+ return this._adaptable.isGrandTotalRowNode(rowNode);
387
+ }
385
388
  isVisibleRowNode(rowNode) {
386
389
  return this._adaptable.isRowNodeVisible(rowNode);
387
390
  }
@@ -9,7 +9,7 @@ export declare class PredicateApiImpl extends ApiBase implements PredicateApi {
9
9
  getPredicateDefs(): AdaptablePredicateDef<string>[];
10
10
  getSystemPredicateDefs(): AdaptablePredicateDef<string>[];
11
11
  getSystemPredicateDefsByModuleScope<PREDICATE_TYPE extends string = string>(moduleScope: PredicateModuleScope): AdaptablePredicateDef<PREDICATE_TYPE>[];
12
- getCustomPredicateDefs(): AdaptablePredicateDef<string>[];
12
+ getCustomPredicateDefs(): AdaptablePredicateDef[];
13
13
  getPredicateDefsByModuleScope(moduleScope: PredicateModuleScope): AdaptablePredicateDef[];
14
14
  getPredicateDefById(predicateId: string): AdaptablePredicateDef;
15
15
  getSystemPredicateDefById(predicateId: string): AdaptablePredicateDef;
@@ -18,7 +18,31 @@ export class PredicateApiImpl extends ApiBase {
18
18
  return SystemPredicateDefs.filter((p) => p.moduleScope.includes(moduleScope));
19
19
  }
20
20
  getCustomPredicateDefs() {
21
- return this.getPredicateOptions().customPredicateDefs;
21
+ const predicateDefsMap = new Map(this.getSystemPredicateDefs().map((p) => [p.id, p]));
22
+ const customPredicateDefs = this.getPredicateOptions().customPredicateDefs || [];
23
+ return customPredicateDefs
24
+ .map((p) => {
25
+ if ('extends' in p) {
26
+ const foundPredicateDef = predicateDefsMap.get(p.extends);
27
+ if (!foundPredicateDef) {
28
+ this.logWarn(`Custom predicate with ID '${p.id}' references a missing 'extends' target '${p.extends}'. No such system or custom predicate found.`);
29
+ return null;
30
+ }
31
+ else {
32
+ const { extends: _, ...rest } = p;
33
+ const result = {
34
+ ...foundPredicateDef,
35
+ ...rest,
36
+ id: rest.id,
37
+ };
38
+ predicateDefsMap.set(result.id, result);
39
+ return result;
40
+ }
41
+ }
42
+ predicateDefsMap.set(p.id, p);
43
+ return p;
44
+ })
45
+ .filter((p) => p !== null);
22
46
  }
23
47
  getPredicateDefsByModuleScope(moduleScope) {
24
48
  return this.getPredicateDefs().filter((p) => p.moduleScope.includes(moduleScope));
@@ -17,7 +17,9 @@ export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfa
17
17
  getAdaptableObjectTags(): AdaptableObjectTag[] | undefined;
18
18
  getAdaptableObjectsWithTag(tag: AdaptableObjectTag, adaptableModule?: AdaptableModule): AdaptableObject[] | undefined;
19
19
  getCustomIconDefinition(iconName: string): import("../../types").AdaptableIcon | import("../../types").CustomIcon;
20
- showProgressIndicator(config: ProgressIndicatorConfig): void;
20
+ showProgressIndicator(config: ProgressIndicatorConfig): {
21
+ close: () => void;
22
+ };
21
23
  hideProgressIndicator(): void;
22
24
  openCustomWindowPopup(config: CustomWindowConfig): {
23
25
  close: () => void;
@@ -83,6 +83,9 @@ export class UserInterfaceApiImpl extends ApiBase {
83
83
  return customIcon;
84
84
  }
85
85
  showProgressIndicator(config) {
86
+ const close = () => {
87
+ this.hideProgressIndicator();
88
+ };
86
89
  if (config.delay) {
87
90
  this.showProgressIndicatorTimeout = setTimeout(() => {
88
91
  this.dispatchAction(ProgressIndicatorShow(config));
@@ -91,6 +94,7 @@ export class UserInterfaceApiImpl extends ApiBase {
91
94
  else {
92
95
  this.dispatchAction(ProgressIndicatorShow(config));
93
96
  }
97
+ return { close };
94
98
  }
95
99
  hideProgressIndicator() {
96
100
  if (this.showProgressIndicatorTimeout) {
@@ -111,6 +115,8 @@ export class UserInterfaceApiImpl extends ApiBase {
111
115
  render: config.render,
112
116
  frameworkComponent: config.frameworkComponent,
113
117
  onFrameworkComponentDestroyed: config.onFrameworkComponentDestroyed,
118
+ size: config.size,
119
+ position: config.position,
114
120
  },
115
121
  Icon: config.icon,
116
122
  });
@@ -34,4 +34,5 @@ export declare class ColumnInternalApi extends ApiBase {
34
34
  getColumnHeaderName(params: HeaderValueGetterParams): string;
35
35
  private buildColumnHeaderContext;
36
36
  getQueryableColumnsForUIEditor(): AdaptableColumn[];
37
+ hasArrayDataType(column: AdaptableColumn): boolean;
37
38
  }
@@ -287,4 +287,7 @@ export class ColumnInternalApi extends ApiBase {
287
287
  .getQueryableColumns()
288
288
  .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn);
289
289
  }
290
+ hasArrayDataType(column) {
291
+ return ['textArray', 'numberArray', 'tupleArray', 'objectArray'].includes(column.dataType);
292
+ }
290
293
  }
@@ -1,5 +1,5 @@
1
1
  import { IRowNode } from 'ag-grid-enterprise';
2
- import { AdaptableColumn, AdaptableFormat, AdaptablePredicateDef, ColumnScope, FormatColumn, StringFormatterOptions } from '../../types';
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 {
5
5
  /**
@@ -28,7 +28,8 @@ export declare class FormatColumnInternalApi extends ApiBase {
28
28
  * @param config
29
29
  * @returns list of FormatColumn
30
30
  */
31
- getFormatColumnsWithStyleForColumn(column: AdaptableColumn, config?: {
31
+ getFormatColumnsWithStyleForColumn(column: AdaptableColumn, config: {
32
+ target: FormatColumnTarget;
32
33
  includeSuspended?: boolean;
33
34
  }): FormatColumn[];
34
35
  /**
@@ -36,8 +37,9 @@ export declare class FormatColumnInternalApi extends ApiBase {
36
37
  * @param column The Column for which to retrieve the Format Column
37
38
  * @returns format columns
38
39
  */
39
- getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn, config?: {
40
+ getFormatColumnWithStyleClassNameForColumn(column: AdaptableColumn, config: {
40
41
  includeSuspended?: boolean;
42
+ target: FormatColumnTarget;
41
43
  }): FormatColumn[];
42
44
  getFormatColumnWithColumnInScope(formatColumns: FormatColumn[], column: AdaptableColumn): FormatColumn[];
43
45
  private getFormatColumnInColumnScope;
@@ -85,7 +87,14 @@ export declare class FormatColumnInternalApi extends ApiBase {
85
87
  * @param column
86
88
  * @param params
87
89
  */
88
- formatColumnShouldRender(formatColumn: FormatColumn, column: AdaptableColumn, rowNode: IRowNode, cellValue: any): boolean;
90
+ formatColumnShouldRenderInCell(formatColumn: FormatColumn, column: AdaptableColumn, rowNode: IRowNode, cellValue: any): boolean;
91
+ /**
92
+ * Checks if format column is relevant for a given Column Header
93
+ *
94
+ * @param formatColumn
95
+ * @param column
96
+ */
97
+ formatColumnShouldRenderInHeader(formatColumn: FormatColumn, column: AdaptableColumn): boolean;
89
98
  private evaluatePredicate;
90
99
  private evaluateExpression;
91
100
  /**
@@ -75,7 +75,13 @@ export class FormatColumnInternalApi extends ApiBase {
75
75
  * @returns list of FormatColumn
76
76
  */
77
77
  getFormatColumnsWithStyleForColumn(column, config) {
78
- const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment().filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
78
+ const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment()
79
+ .filter((formatColumn) => {
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);
83
+ })
84
+ .filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
79
85
  return this.getFormatColumnWithColumnInScope(formatColumns, column);
80
86
  }
81
87
  /**
@@ -210,15 +216,20 @@ export class FormatColumnInternalApi extends ApiBase {
210
216
  * @param column
211
217
  * @param params
212
218
  */
213
- formatColumnShouldRender(formatColumn, column, rowNode, cellValue) {
219
+ formatColumnShouldRenderInCell(formatColumn, column, rowNode, cellValue) {
214
220
  // suspended is important to be first
215
221
  if (formatColumn.IsSuspended) {
216
222
  return false;
217
223
  }
218
224
  const isSummaryNode = this.getGridApi().isSummaryNode(rowNode);
219
225
  const isGroupedRowNode = this.getGridApi().isGroupRowNode(rowNode);
220
- // For Summary Rows cannot be excluded
221
- if (isSummaryNode) {
226
+ const isGrandTotalRowNode = this.getGridApi().isGrandTotalRowNode(rowNode);
227
+ if (isGrandTotalRowNode) {
228
+ if (formatColumn.RowScope?.ExcludeTotalRows) {
229
+ return false;
230
+ }
231
+ }
232
+ else if (isSummaryNode) {
222
233
  if (formatColumn.RowScope?.ExcludeSummaryRows) {
223
234
  return false;
224
235
  }
@@ -258,6 +269,22 @@ export class FormatColumnInternalApi extends ApiBase {
258
269
  // nothing has passed then return false
259
270
  return false;
260
271
  }
272
+ /**
273
+ * Checks if format column is relevant for a given Column Header
274
+ *
275
+ * @param formatColumn
276
+ * @param column
277
+ */
278
+ formatColumnShouldRenderInHeader(formatColumn, column) {
279
+ if (formatColumn.IsSuspended) {
280
+ return false;
281
+ }
282
+ if (formatColumn.ColumnGroupScope &&
283
+ !this.getFormatColumnApi().internalApi.formatColumnWithColumnGroupScopeShouldRender(formatColumn, column)) {
284
+ return false;
285
+ }
286
+ return true;
287
+ }
261
288
  evaluatePredicate(formatColumn, predicateDefHandlerContext) {
262
289
  return this.getPredicateApi().handleColumnPredicates(formatColumn.Rule?.Predicates, predicateDefHandlerContext, false);
263
290
  }
@@ -282,7 +309,7 @@ export class FormatColumnInternalApi extends ApiBase {
282
309
  * @param params
283
310
  */
284
311
  getFormatColumnsRelevantForColumn(formatColumns, column, params) {
285
- return formatColumns.filter((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
312
+ return formatColumns.filter((formatColumn) => this.formatColumnShouldRenderInCell(formatColumn, column, params.node, params.value));
286
313
  }
287
314
  /**
288
315
  * Extract from the given FormatColumns the one which is the most relevant for a given cell (intersection of given AdaptableColumn and RowNode)
@@ -292,7 +319,7 @@ export class FormatColumnInternalApi extends ApiBase {
292
319
  * @param params
293
320
  */
294
321
  getMostRelevantFormatColumnForColumn(formatColumns, column, params) {
295
- return formatColumns.find((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
322
+ return formatColumns.find((formatColumn) => this.formatColumnShouldRenderInCell(formatColumn, column, params.node, params.value));
296
323
  }
297
324
  /**
298
325
  * Retrieves all Format Columns which have an Expression
@@ -46,17 +46,29 @@ export interface UserInterfaceApi {
46
46
  * Displays a progress indicator
47
47
  * @param config.progressText - text to display in the progress indicator
48
48
  * @param config.render - render function for a custom progress indicator (if not using a framework component)
49
- * @param config.frameworkComponent - the framework (React/Angular) component to render as progress indicator
49
+ * @param config.frameworkComponent - the framework (React/Angular/Vue) component to render as progress indicator
50
+ * @param config.renderMode - how to render the custom component ('content' or 'dialog'). Applies to both render and frameworkComponent.
50
51
  * @param config.delay - delay before showing the progress indicator (in milliseconds)
52
+ * @returns An object with a close method to close the window
51
53
  */
52
- showProgressIndicator(config: ProgressIndicatorConfig): void;
54
+ showProgressIndicator(config: ProgressIndicatorConfig): {
55
+ close: () => void;
56
+ };
53
57
  /**
54
58
  * Hides the progress indicator
55
59
  */
56
60
  hideProgressIndicator(): void;
57
61
  /**
58
- * Opens window with custom content
59
- * @param config
62
+ * Opens a custom window popup
63
+ * @param config - The configuration for the custom window
64
+ * @param config.id - Unique identifier for the custom window
65
+ * @param config.title - Title of the custom window
66
+ * @param config.icon - Icon to display in the custom window heading
67
+ * @param config.render - Render function to display custom content in the window (if not using a framework component)
68
+ * @param config.frameworkComponent - A React, Angular or Vue Framework component to use for the custom window content
69
+ * @param config.onFrameworkComponentDestroyed - Callback function to be called when the framework component is destroyed
70
+ * @param config.renderMode - How to render the custom component ('content' or 'dialog'). Applies to both render and frameworkComponent.
71
+ * @returns An object with a close method to close the window
60
72
  */
61
73
  openCustomWindowPopup(config: CustomWindowConfig): {
62
74
  close: () => void;
@@ -318,6 +318,7 @@ export const PopupReducer = (state = initialState, action) => {
318
318
  text: actionTypedAdd.progressIndicatorConfig.text,
319
319
  render: actionTypedAdd.progressIndicatorConfig.render,
320
320
  frameworkComponent: actionTypedAdd.progressIndicatorConfig.frameworkComponent,
321
+ renderMode: actionTypedAdd.progressIndicatorConfig.renderMode,
321
322
  },
322
323
  };
323
324
  return Object.assign({}, state, updatedState);
@@ -6,6 +6,7 @@ import { renderStyledColumnStyleSummary } from '../View/StyledColumn/Wizard/Styl
6
6
  import ObjectFactory from '../Utilities/ObjectFactory';
7
7
  import { StyledColumnBadgePreview } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview';
8
8
  import { getObjectTagsViewItems } from '../Utilities/getObjectTagsViewItems';
9
+ import { StyledColumnBadgeSettings } from '../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings';
9
10
  export class StyledColumnModule extends AdaptableModuleBase {
10
11
  constructor(api) {
11
12
  super(ModuleConstants.StyledColumnModuleId, ModuleConstants.StyledColumnFriendlyName, 'brush', 'StyledColumnPopup', // to change
@@ -143,9 +144,8 @@ export class StyledColumnModule extends AdaptableModuleBase {
143
144
  returnColumnMenuItems.push(...[newGrandientButton, newPercentBarButton, newBadgeButton]);
144
145
  break;
145
146
  case 'text':
146
- returnColumnMenuItems.push(newBadgeButton);
147
- break;
148
147
  case 'textArray':
148
+ case 'numberArray':
149
149
  returnColumnMenuItems.push(newBadgeButton);
150
150
  break;
151
151
  }
@@ -188,15 +188,20 @@ export class StyledColumnModule extends AdaptableModuleBase {
188
188
  }
189
189
  if (styledColumn.BadgeStyle) {
190
190
  specificTypeItems.push({
191
- name: 'Settings',
191
+ name: 'Rows',
192
192
  values: [
193
193
  `Data Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeDataRows ? 'No' : 'Yes'}`,
194
194
  `Group Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeGroupRows ? 'No' : 'Yes'}`,
195
195
  `Summary Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeSummaryRows ? 'No' : 'Yes'}`,
196
+ `Total Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeTotalRows ? 'No' : 'Yes'}`,
196
197
  ],
197
198
  });
198
199
  }
199
200
  if (styledColumn.BadgeStyle) {
201
+ specificTypeItems.push({
202
+ name: 'Settings',
203
+ view: StyledColumnBadgeSettings,
204
+ });
200
205
  specificTypeItems.push({
201
206
  name: 'Preview',
202
207
  view: StyledColumnBadgePreview,
@@ -13,6 +13,12 @@ export const getFormatColumnSettingsViewItems = (formatColumn) => {
13
13
  if (formatColumn.RowScope.ExcludeSummaryRows) {
14
14
  values.push('Exclude Summary Rows');
15
15
  }
16
+ if (formatColumn.RowScope.ExcludeTotalRows) {
17
+ values.push('Exclude Total Rows');
18
+ }
19
+ }
20
+ if (formatColumn.ColumnGroupScope) {
21
+ values.push(`Column Groups: ${formatColumn.ColumnGroupScope === 'Both' ? 'Always' : formatColumn.ColumnGroupScope}`);
16
22
  }
17
23
  return {
18
24
  name: 'Settings',
@@ -26,6 +26,7 @@ export declare const AG_GRID_SELECTION_COLUMN: string;
26
26
  export declare const AG_GRID_PIVOT_COLUMN: string;
27
27
  export declare const AG_GRID_PIVOT_GRAND_TOTAL_COLUMN: string;
28
28
  export declare const AG_GRID_CHART_WINDOW = "AG Grid Window";
29
+ export declare const AG_GRID_GRAND_TOTAL_ROW_ID = "rowGroupFooter_ROOT_NODE_ID";
29
30
  export declare const ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = "(FDC3ActionColumn)";
30
31
  export declare const DEFAULT_DATE_FORMAT_PATTERN = "dd-MM-yyyy";
31
32
  export declare const DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = "dd-MM-yyyy HH:mm:ss";
@@ -26,6 +26,7 @@ export const AG_GRID_SELECTION_COLUMN = 'ag-Grid-SelectionColumn';
26
26
  export const AG_GRID_PIVOT_COLUMN = 'pivot_';
27
27
  export const AG_GRID_PIVOT_GRAND_TOTAL_COLUMN = 'PivotRowTotal_pivot_';
28
28
  export const AG_GRID_CHART_WINDOW = 'AG Grid Window';
29
+ export const AG_GRID_GRAND_TOTAL_ROW_ID = 'rowGroupFooter_ROOT_NODE_ID';
29
30
  export const ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = '(FDC3ActionColumn)';
30
31
  // FIXME AFL - load this from DateInputOptions
31
32
  export const DEFAULT_DATE_FORMAT_PATTERN = 'dd-MM-yyyy';
@@ -60,6 +60,9 @@ export function NumberFormatter(input, options = {}, rowNode, column, api) {
60
60
  if (options.Floor) {
61
61
  n = Math.floor(n);
62
62
  }
63
+ if (options.Empty) {
64
+ return ' ';
65
+ }
63
66
  let s;
64
67
  let digitsToUse;
65
68
  if (options.Truncate || options.Ceiling || options.Round || options.Floor) {
@@ -14,7 +14,7 @@ export const getScopeViewItems = (scope, api) => {
14
14
  values = scope.ColumnTypes;
15
15
  }
16
16
  return {
17
- label: 'Target',
17
+ label: 'Scope & Target',
18
18
  name: 'Target',
19
19
  values,
20
20
  };
@@ -14,10 +14,15 @@ dataType) => {
14
14
  const inputs = (adaptablePredicateDef?.inputs ?? [])?.map((input) => {
15
15
  return input.type;
16
16
  });
17
- if ((adaptablePredicateDef.id === 'In' || adaptablePredicateDef.id === 'NotIn') &&
18
- ['text', 'number', 'date'].includes(dataType)) {
19
- // add array type
20
- inputs.push(`${dataType}[]`);
17
+ if (adaptablePredicateDef.id === 'In' || adaptablePredicateDef.id === 'NotIn') {
18
+ if (['text', 'number', 'date'].includes(dataType)) {
19
+ // add array type
20
+ inputs.push(`${dataType}[]`);
21
+ }
22
+ if (['text[]', 'number[]'].includes(dataType)) {
23
+ // add array type
24
+ inputs.push(dataType);
25
+ }
21
26
  }
22
27
  const qlPredicateDef = {
23
28
  operator: adaptablePredicateDef.id,
@@ -53,8 +53,7 @@ export const AdaptablePopupConfirmation = (props) => {
53
53
  props.showInputBox && (React.createElement(Box, { padding: 2, "data-name": "body" },
54
54
  React.createElement("p", null, "Please enter a comment to confirm"),
55
55
  React.createElement(Input, { marginTop: 2, width: '100%', value: promptText, type: "string", placeholder: "Enter text", onChange: (e) => changeContent(e) }))),
56
- React.createElement(Flex, { marginTop: 3, padding: 2, "data-name": "footer" },
57
- React.createElement(SimpleButton, { tone: "error", "data-name": "delete", variant: "raised", disabled: !canConfirm(), onClick: () => onConfirmmForm() }, props.confirmButtonText),
58
- React.createElement("div", { style: { flex: 1 } }),
59
- props.cancelButtonText != null ? (React.createElement(SimpleButton, { "data-name": "cancel", tone: "neutral", variant: "raised", onClick: () => onCancelForm() }, props.cancelButtonText)) : null)))));
56
+ React.createElement(Flex, { marginTop: 3, padding: 2, "data-name": "footer", justifyContent: "space-between" },
57
+ props.cancelButtonText != null ? (React.createElement(SimpleButton, { "data-name": "cancel", tone: "neutral", variant: "raised", onClick: () => onCancelForm() }, props.cancelButtonText)) : (React.createElement("div", null)),
58
+ React.createElement(SimpleButton, { tone: "error", "data-name": "delete", variant: "raised", disabled: !canConfirm(), onClick: () => onConfirmmForm() }, props.confirmButtonText))))));
60
59
  };
@@ -36,8 +36,7 @@ export const AdaptablePopupPrompt = (props) => {
36
36
  })))),
37
37
  React.createElement(Input, { autoFocus: true, marginTop: 3, mx: 3, value: promptText, type: "string", placeholder: "Enter text", onChange: (e) => changeContent(e) }),
38
38
  React.createElement(Box, { marginTop: 3 },
39
- React.createElement(Flex, { padding: 2 },
40
- React.createElement(SimpleButton, { tone: "accent", "data-name": "ok", variant: "raised", disabled: StringExtensions.IsNullOrEmpty(promptText), onClick: () => onConfirmForm() }, "OK"),
41
- React.createElement("div", { style: { flex: 1 } }),
42
- React.createElement(SimpleButton, { tone: "neutral", variant: "raised", onClick: () => onCloseForm(), "data-name": "cancel" }, "Cancel"))))));
39
+ React.createElement(Flex, { padding: 2, "data-name": "footer", justifyContent: "space-between" },
40
+ React.createElement(SimpleButton, { tone: "neutral", variant: "raised", onClick: () => onCloseForm(), "data-name": "cancel" }, "Cancel"),
41
+ React.createElement(SimpleButton, { tone: "accent", "data-name": "ok", variant: "raised", disabled: StringExtensions.IsNullOrEmpty(promptText), onClick: () => onConfirmForm() }, "OK"))))));
43
42
  };
@@ -31,11 +31,7 @@ export const WindowPopups = () => {
31
31
  let componentNode = null;
32
32
  if (!Component &&
33
33
  (windowItem.PopupProps.render || windowItem.PopupProps.frameworkComponent)) {
34
- componentNode = (React.createElement(ExternalRenderer
35
- // TODO AFL: add configurable width&height for custom popups
36
- , {
37
- // TODO AFL: add configurable width&height for custom popups
38
- style: { height: '100%' }, render: windowItem.PopupProps.render, frameworkComponent: windowItem.PopupProps.frameworkComponent, onDestroy: windowItem.PopupProps.onFrameworkComponentDestroyed }));
34
+ componentNode = (React.createElement(ExternalRenderer, { style: { height: '100%' }, render: windowItem.PopupProps.render, frameworkComponent: windowItem.PopupProps.frameworkComponent, onDestroy: windowItem.PopupProps.onFrameworkComponentDestroyed }));
39
35
  }
40
36
  else {
41
37
  Component = Component ?? NoopComponent;
@@ -97,6 +97,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, adaptableContainerId, agGr
97
97
  rowScope: {
98
98
  ExcludeGroupRows: true,
99
99
  ExcludeSummaryRows: true,
100
+ ExcludeTotalRows: true,
100
101
  },
101
102
  actionColumnSettings: { suppressMenu: true, suppressMovable: true },
102
103
  actionColumnButton,
@@ -28,7 +28,7 @@ export const renderReportColumnsSummary = (report) => {
28
28
  };
29
29
  export const ReportColumnsWizardSection = (props) => {
30
30
  const { api, data } = useOnePageAdaptableWizardContext();
31
- return (React.createElement(Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
31
+ return (React.createElement(Flex, { flexDirection: "column", style: { height: '100%' } },
32
32
  React.createElement(Tabs, { m: 2, value: data.ReportColumnScope, onValueChange: (ReportColumnScope) => {
33
33
  const report = {
34
34
  ...data,
@@ -20,6 +20,7 @@ import { DEFAULT_DOUBLE_DISPLAY_VALUE, DEFAULT_STRING_DISPLAY_VALUE, } from '../
20
20
  import Textarea from '../../../components/Textarea';
21
21
  import { ButtonInfo } from '../../Components/Buttons/ButtonInfo';
22
22
  import { FormatColumnPlaceholderDocsLink } from '../../../Utilities/Constants/DocumentationLinkConstants';
23
+ import { PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE, PIVOT_ANY_TOTAL_COLUMN_TYPE, PIVOT_COLUMN_TOTAL_COLUMN_TYPE, PIVOT_GRAND_TOTAL_COLUMN_TYPE, } from '../../../AdaptableState/Common/AdaptableColumn';
23
24
  const DOLLAR_OPTIONS = {
24
25
  FractionDigits: 2,
25
26
  FractionSeparator: '.',
@@ -143,6 +144,18 @@ export const getFormatDisplayTypeForScope = (scope, api) => {
143
144
  return 'text';
144
145
  }
145
146
  if ('ColumnTypes' in scope && scope.ColumnTypes.length) {
147
+ // if a Pivot Total Column Type is specified, we can safely assume that the data type is number
148
+ const pivotTotalTypes = [
149
+ PIVOT_ANY_TOTAL_COLUMN_TYPE,
150
+ PIVOT_GRAND_TOTAL_COLUMN_TYPE,
151
+ PIVOT_COLUMN_TOTAL_COLUMN_TYPE,
152
+ PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE,
153
+ ];
154
+ // if all column types are pivot total types, we can safely assume that the data type is number
155
+ if (scope.ColumnTypes.length > 0 &&
156
+ scope.ColumnTypes.every((type) => pivotTotalTypes.includes(type))) {
157
+ return 'number';
158
+ }
146
159
  // need to check if all column with this column type has the same data type and return that particular one
147
160
  const columns = scope.ColumnTypes.flatMap((columnType) => {
148
161
  return api.columnApi.getColumnsByColumnType(columnType);
@@ -295,7 +308,9 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
295
308
  React.createElement(FormRow, { label: "Floor" },
296
309
  React.createElement(CheckBox, { "data-name": "floor-checkbox", checked: data.DisplayFormat.Options.Floor, onChange: (checked) => setFormatOption('Floor', checked) })),
297
310
  React.createElement(FormRow, { label: "Round" },
298
- React.createElement(CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) })))))),
311
+ React.createElement(CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) })),
312
+ React.createElement(FormRow, { label: "Empty" },
313
+ React.createElement(CheckBox, { "data-name": "empty-checkbox", checked: data.DisplayFormat.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) })))))),
299
314
  scopedCustomFormatters.length > 0 && (React.createElement(Tabs, { marginTop: 2, keyboardNavigation: false },
300
315
  React.createElement(Tabs.Tab, null, "Custom Formats"),
301
316
  React.createElement(Tabs.Content, null,