@adaptabletools/adaptable-cjs 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 +4 -0
  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 +2 -1
  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 +3 -2
  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 +34 -0
  61. package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
  62. package/src/agGrid/AdaptableAgGrid.js +27 -1
  63. package/src/agGrid/AgGridAdapter.js +2 -6
  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.cjs.tsbuildinfo +1 -1
@@ -382,9 +382,14 @@ export interface GridApi {
382
382
  */
383
383
  isGroupRowNode(rowNode: IRowNode): boolean;
384
384
  /**
385
- * Whether given Row Node is visible
386
- * @param rowNode Node to check
387
- */
385
+ * Whether given Row Node is a Grand Total Row
386
+ * @param rowNode Node to check
387
+ */
388
+ isGrandTotalRowNode(rowNode: IRowNode): boolean;
389
+ /**
390
+ * Whether given Row Node is visible
391
+ * @param rowNode Node to check
392
+ */
388
393
  isVisibleRowNode(rowNode: IRowNode): boolean;
389
394
  /**
390
395
  * Whether given Row Node is in a Summary Row
@@ -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
  }
@@ -510,5 +510,19 @@ class ColumnApiImpl extends ApiBase_1.ApiBase {
510
510
  getAGGridColumnForColumnId(columnId) {
511
511
  return this.getAgGridApi().getColumn(columnId);
512
512
  }
513
+ hasColumnType(columnIdentifier, columnType) {
514
+ const colDef = typeof columnIdentifier === 'string'
515
+ ? this.getAgGridApi().getColumnDef(columnIdentifier)
516
+ : columnIdentifier;
517
+ if (!colDef?.type) {
518
+ return false;
519
+ }
520
+ if (Array.isArray(colDef.type)) {
521
+ return colDef.type.includes(columnType);
522
+ }
523
+ else {
524
+ return colDef.type === columnType;
525
+ }
526
+ }
513
527
  }
514
528
  exports.ColumnApiImpl = ColumnApiImpl;
@@ -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;
@@ -386,6 +386,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
386
386
  isGroupRowNode(rowNode) {
387
387
  return this._adaptable.isGroupRowNode(rowNode);
388
388
  }
389
+ isGrandTotalRowNode(rowNode) {
390
+ return this._adaptable.isGrandTotalRowNode(rowNode);
391
+ }
389
392
  isVisibleRowNode(rowNode) {
390
393
  return this._adaptable.isRowNodeVisible(rowNode);
391
394
  }
@@ -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;
@@ -22,7 +22,31 @@ class PredicateApiImpl extends ApiBase_1.ApiBase {
22
22
  return AdaptablePredicate_1.SystemPredicateDefs.filter((p) => p.moduleScope.includes(moduleScope));
23
23
  }
24
24
  getCustomPredicateDefs() {
25
- return this.getPredicateOptions().customPredicateDefs;
25
+ const predicateDefsMap = new Map(this.getSystemPredicateDefs().map((p) => [p.id, p]));
26
+ const customPredicateDefs = this.getPredicateOptions().customPredicateDefs || [];
27
+ return customPredicateDefs
28
+ .map((p) => {
29
+ if ('extends' in p) {
30
+ const foundPredicateDef = predicateDefsMap.get(p.extends);
31
+ if (!foundPredicateDef) {
32
+ this.logWarn(`Custom predicate with ID '${p.id}' references a missing 'extends' target '${p.extends}'. No such system or custom predicate found.`);
33
+ return null;
34
+ }
35
+ else {
36
+ const { extends: _, ...rest } = p;
37
+ const result = {
38
+ ...foundPredicateDef,
39
+ ...rest,
40
+ id: rest.id,
41
+ };
42
+ predicateDefsMap.set(result.id, result);
43
+ return result;
44
+ }
45
+ }
46
+ predicateDefsMap.set(p.id, p);
47
+ return p;
48
+ })
49
+ .filter((p) => p !== null);
26
50
  }
27
51
  getPredicateDefsByModuleScope(moduleScope) {
28
52
  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;
@@ -87,6 +87,9 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
87
87
  return customIcon;
88
88
  }
89
89
  showProgressIndicator(config) {
90
+ const close = () => {
91
+ this.hideProgressIndicator();
92
+ };
90
93
  if (config.delay) {
91
94
  this.showProgressIndicatorTimeout = setTimeout(() => {
92
95
  this.dispatchAction((0, PopupRedux_1.ProgressIndicatorShow)(config));
@@ -95,6 +98,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
95
98
  else {
96
99
  this.dispatchAction((0, PopupRedux_1.ProgressIndicatorShow)(config));
97
100
  }
101
+ return { close };
98
102
  }
99
103
  hideProgressIndicator() {
100
104
  if (this.showProgressIndicatorTimeout) {
@@ -115,6 +119,8 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
115
119
  render: config.render,
116
120
  frameworkComponent: config.frameworkComponent,
117
121
  onFrameworkComponentDestroyed: config.onFrameworkComponentDestroyed,
122
+ size: config.size,
123
+ position: config.position,
118
124
  },
119
125
  Icon: config.icon,
120
126
  });
@@ -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
  }
@@ -292,5 +292,8 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
292
292
  .getQueryableColumns()
293
293
  .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn);
294
294
  }
295
+ hasArrayDataType(column) {
296
+ return ['textArray', 'numberArray', 'tupleArray', 'objectArray'].includes(column.dataType);
297
+ }
295
298
  }
296
299
  exports.ColumnInternalApi = ColumnInternalApi;
@@ -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
  /**
@@ -79,7 +79,13 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
79
79
  * @returns list of FormatColumn
80
80
  */
81
81
  getFormatColumnsWithStyleForColumn(column, config) {
82
- const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment().filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
82
+ const formatColumns = this.getAllFormatColumnWithStyleAndCellAlignment()
83
+ .filter((formatColumn) => {
84
+ // FormatColumn default target is 'cell', so if no target is specified, we assume 'cell'
85
+ const fcTarget = formatColumn.Target ?? ['cell'];
86
+ return fcTarget.includes(config.target);
87
+ })
88
+ .filter((formatColumn) => config?.includeSuspended || !formatColumn.IsSuspended);
83
89
  return this.getFormatColumnWithColumnInScope(formatColumns, column);
84
90
  }
85
91
  /**
@@ -214,15 +220,20 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
214
220
  * @param column
215
221
  * @param params
216
222
  */
217
- formatColumnShouldRender(formatColumn, column, rowNode, cellValue) {
223
+ formatColumnShouldRenderInCell(formatColumn, column, rowNode, cellValue) {
218
224
  // suspended is important to be first
219
225
  if (formatColumn.IsSuspended) {
220
226
  return false;
221
227
  }
222
228
  const isSummaryNode = this.getGridApi().isSummaryNode(rowNode);
223
229
  const isGroupedRowNode = this.getGridApi().isGroupRowNode(rowNode);
224
- // For Summary Rows cannot be excluded
225
- if (isSummaryNode) {
230
+ const isGrandTotalRowNode = this.getGridApi().isGrandTotalRowNode(rowNode);
231
+ if (isGrandTotalRowNode) {
232
+ if (formatColumn.RowScope?.ExcludeTotalRows) {
233
+ return false;
234
+ }
235
+ }
236
+ else if (isSummaryNode) {
226
237
  if (formatColumn.RowScope?.ExcludeSummaryRows) {
227
238
  return false;
228
239
  }
@@ -262,6 +273,22 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
262
273
  // nothing has passed then return false
263
274
  return false;
264
275
  }
276
+ /**
277
+ * Checks if format column is relevant for a given Column Header
278
+ *
279
+ * @param formatColumn
280
+ * @param column
281
+ */
282
+ formatColumnShouldRenderInHeader(formatColumn, column) {
283
+ if (formatColumn.IsSuspended) {
284
+ return false;
285
+ }
286
+ if (formatColumn.ColumnGroupScope &&
287
+ !this.getFormatColumnApi().internalApi.formatColumnWithColumnGroupScopeShouldRender(formatColumn, column)) {
288
+ return false;
289
+ }
290
+ return true;
291
+ }
265
292
  evaluatePredicate(formatColumn, predicateDefHandlerContext) {
266
293
  return this.getPredicateApi().handleColumnPredicates(formatColumn.Rule?.Predicates, predicateDefHandlerContext, false);
267
294
  }
@@ -286,7 +313,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
286
313
  * @param params
287
314
  */
288
315
  getFormatColumnsRelevantForColumn(formatColumns, column, params) {
289
- return formatColumns.filter((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
316
+ return formatColumns.filter((formatColumn) => this.formatColumnShouldRenderInCell(formatColumn, column, params.node, params.value));
290
317
  }
291
318
  /**
292
319
  * Extract from the given FormatColumns the one which is the most relevant for a given cell (intersection of given AdaptableColumn and RowNode)
@@ -296,7 +323,7 @@ class FormatColumnInternalApi extends ApiBase_1.ApiBase {
296
323
  * @param params
297
324
  */
298
325
  getMostRelevantFormatColumnForColumn(formatColumns, column, params) {
299
- return formatColumns.find((formatColumn) => this.formatColumnShouldRender(formatColumn, column, params.node, params.value));
326
+ return formatColumns.find((formatColumn) => this.formatColumnShouldRenderInCell(formatColumn, column, params.node, params.value));
300
327
  }
301
328
  /**
302
329
  * 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;
@@ -337,6 +337,7 @@ const PopupReducer = (state = initialState, action) => {
337
337
  text: actionTypedAdd.progressIndicatorConfig.text,
338
338
  render: actionTypedAdd.progressIndicatorConfig.render,
339
339
  frameworkComponent: actionTypedAdd.progressIndicatorConfig.frameworkComponent,
340
+ renderMode: actionTypedAdd.progressIndicatorConfig.renderMode,
340
341
  },
341
342
  };
342
343
  return Object.assign({}, state, updatedState);
@@ -10,6 +10,7 @@ const StyledColumnWizardStyleSection_1 = require("../View/StyledColumn/Wizard/St
10
10
  const ObjectFactory_1 = tslib_1.__importDefault(require("../Utilities/ObjectFactory"));
11
11
  const StyledColumnBadgePreview_1 = require("../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview");
12
12
  const getObjectTagsViewItems_1 = require("../Utilities/getObjectTagsViewItems");
13
+ const StyledColumnBadgeSettings_1 = require("../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings");
13
14
  class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
14
15
  constructor(api) {
15
16
  super(ModuleConstants.StyledColumnModuleId, ModuleConstants.StyledColumnFriendlyName, 'brush', 'StyledColumnPopup', // to change
@@ -147,9 +148,8 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
147
148
  returnColumnMenuItems.push(...[newGrandientButton, newPercentBarButton, newBadgeButton]);
148
149
  break;
149
150
  case 'text':
150
- returnColumnMenuItems.push(newBadgeButton);
151
- break;
152
151
  case 'textArray':
152
+ case 'numberArray':
153
153
  returnColumnMenuItems.push(newBadgeButton);
154
154
  break;
155
155
  }
@@ -192,15 +192,20 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
192
192
  }
193
193
  if (styledColumn.BadgeStyle) {
194
194
  specificTypeItems.push({
195
- name: 'Settings',
195
+ name: 'Rows',
196
196
  values: [
197
197
  `Data Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeDataRows ? 'No' : 'Yes'}`,
198
198
  `Group Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeGroupRows ? 'No' : 'Yes'}`,
199
199
  `Summary Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeSummaryRows ? 'No' : 'Yes'}`,
200
+ `Total Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeTotalRows ? 'No' : 'Yes'}`,
200
201
  ],
201
202
  });
202
203
  }
203
204
  if (styledColumn.BadgeStyle) {
205
+ specificTypeItems.push({
206
+ name: 'Settings',
207
+ view: StyledColumnBadgeSettings_1.StyledColumnBadgeSettings,
208
+ });
204
209
  specificTypeItems.push({
205
210
  name: 'Preview',
206
211
  view: StyledColumnBadgePreview_1.StyledColumnBadgePreview,
@@ -16,6 +16,12 @@ const getFormatColumnSettingsViewItems = (formatColumn) => {
16
16
  if (formatColumn.RowScope.ExcludeSummaryRows) {
17
17
  values.push('Exclude Summary Rows');
18
18
  }
19
+ if (formatColumn.RowScope.ExcludeTotalRows) {
20
+ values.push('Exclude Total Rows');
21
+ }
22
+ }
23
+ if (formatColumn.ColumnGroupScope) {
24
+ values.push(`Column Groups: ${formatColumn.ColumnGroupScope === 'Both' ? 'Always' : formatColumn.ColumnGroupScope}`);
19
25
  }
20
26
  return {
21
27
  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";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LAYOUT_NEW_TABLE_TOOLTIP = exports.THEME_STYLE = exports.SYSTEM_EXPORT_DESTINATIONS = exports.CLIPBOARD_EXPORT_DESTINATION = exports.DOWNLOAD_EXPORT_DESTINATION = exports.SELECT_REPORT_FORMAT_STRING = exports.SELECT_REPORT_STRING = exports.SYSTEM_REPORT_FORMATS = exports.JSON_FORMAT_REPORT = exports.CSV_FORMAT_REPORT = exports.VISUAL_EXCEL_FORMAT_REPORT = exports.EXCEL_FORMAT_REPORT = exports.SYSTEM_REPORT_NAMES = exports.SELECTED_DATA_REPORT = exports.CURRENT_LAYOUT_REPORT = exports.ALL_DATA_REPORT = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.MENU_SEPARATOR = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_GRAND_TOTAL_COLUMN = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_SELECTION_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.QUARTER_SECOND = exports.HALF_SECOND = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.READ_ONLY_STYLE = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE_ID = exports.ADAPTABLE = exports.ERROR_LAYOUT = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
- exports.OBSERVABLE_EXPRESSION_ROW_REMOVED = exports.OBSERVABLE_EXPRESSION_ROW_ADDED = exports.STANDALONE_MODULE_POPUPS = exports.LAYOUT_DELETE_TOOLTIP = exports.LAYOUT_CLONE_TOOLTIP = exports.LAYOUT_EDIT_TOOLTIP = exports.LAYOUT_SAVE_TOOLTIP = exports.LAYOUT_NEW_TABLE_OR_PIVOT_TOOLTIP = exports.LAYOUT_NEW_PIVOT_TOOLTIP = void 0;
3
+ exports.THEME_STYLE = exports.SYSTEM_EXPORT_DESTINATIONS = exports.CLIPBOARD_EXPORT_DESTINATION = exports.DOWNLOAD_EXPORT_DESTINATION = exports.SELECT_REPORT_FORMAT_STRING = exports.SELECT_REPORT_STRING = exports.SYSTEM_REPORT_FORMATS = exports.JSON_FORMAT_REPORT = exports.CSV_FORMAT_REPORT = exports.VISUAL_EXCEL_FORMAT_REPORT = exports.EXCEL_FORMAT_REPORT = exports.SYSTEM_REPORT_NAMES = exports.SELECTED_DATA_REPORT = exports.CURRENT_LAYOUT_REPORT = exports.ALL_DATA_REPORT = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.MENU_SEPARATOR = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.AG_GRID_GRAND_TOTAL_ROW_ID = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_GRAND_TOTAL_COLUMN = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_SELECTION_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.QUARTER_SECOND = exports.HALF_SECOND = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.READ_ONLY_STYLE = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE_ID = exports.ADAPTABLE = exports.ERROR_LAYOUT = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
4
+ exports.OBSERVABLE_EXPRESSION_ROW_REMOVED = exports.OBSERVABLE_EXPRESSION_ROW_ADDED = exports.STANDALONE_MODULE_POPUPS = exports.LAYOUT_DELETE_TOOLTIP = exports.LAYOUT_CLONE_TOOLTIP = exports.LAYOUT_EDIT_TOOLTIP = exports.LAYOUT_SAVE_TOOLTIP = exports.LAYOUT_NEW_TABLE_OR_PIVOT_TOOLTIP = exports.LAYOUT_NEW_PIVOT_TOOLTIP = exports.LAYOUT_NEW_TABLE_TOOLTIP = void 0;
5
5
  const normalizeLayoutModel_1 = require("../../layout-manager/src/normalizeLayoutModel");
6
6
  exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
7
7
  exports.MISSING_COLUMN = ' [MISSING]';
@@ -30,6 +30,7 @@ exports.AG_GRID_SELECTION_COLUMN = 'ag-Grid-SelectionColumn';
30
30
  exports.AG_GRID_PIVOT_COLUMN = 'pivot_';
31
31
  exports.AG_GRID_PIVOT_GRAND_TOTAL_COLUMN = 'PivotRowTotal_pivot_';
32
32
  exports.AG_GRID_CHART_WINDOW = 'AG Grid Window';
33
+ exports.AG_GRID_GRAND_TOTAL_ROW_ID = 'rowGroupFooter_ROOT_NODE_ID';
33
34
  exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = '(FDC3ActionColumn)';
34
35
  // FIXME AFL - load this from DateInputOptions
35
36
  exports.DEFAULT_DATE_FORMAT_PATTERN = 'dd-MM-yyyy';
@@ -64,6 +64,9 @@ function NumberFormatter(input, options = {}, rowNode, column, api) {
64
64
  if (options.Floor) {
65
65
  n = Math.floor(n);
66
66
  }
67
+ if (options.Empty) {
68
+ return ' ';
69
+ }
67
70
  let s;
68
71
  let digitsToUse;
69
72
  if (options.Truncate || options.Ceiling || options.Round || options.Floor) {
@@ -17,7 +17,7 @@ const getScopeViewItems = (scope, api) => {
17
17
  values = scope.ColumnTypes;
18
18
  }
19
19
  return {
20
- label: 'Target',
20
+ label: 'Scope & Target',
21
21
  name: 'Target',
22
22
  values,
23
23
  };
@@ -18,10 +18,15 @@ dataType) => {
18
18
  const inputs = (adaptablePredicateDef?.inputs ?? [])?.map((input) => {
19
19
  return input.type;
20
20
  });
21
- if ((adaptablePredicateDef.id === 'In' || adaptablePredicateDef.id === 'NotIn') &&
22
- ['text', 'number', 'date'].includes(dataType)) {
23
- // add array type
24
- inputs.push(`${dataType}[]`);
21
+ if (adaptablePredicateDef.id === 'In' || adaptablePredicateDef.id === 'NotIn') {
22
+ if (['text', 'number', 'date'].includes(dataType)) {
23
+ // add array type
24
+ inputs.push(`${dataType}[]`);
25
+ }
26
+ if (['text[]', 'number[]'].includes(dataType)) {
27
+ // add array type
28
+ inputs.push(dataType);
29
+ }
25
30
  }
26
31
  const qlPredicateDef = {
27
32
  operator: adaptablePredicateDef.id,
@@ -57,9 +57,8 @@ const AdaptablePopupConfirmation = (props) => {
57
57
  props.showInputBox && (React.createElement(rebass_1.Box, { padding: 2, "data-name": "body" },
58
58
  React.createElement("p", null, "Please enter a comment to confirm"),
59
59
  React.createElement(Input_1.default, { marginTop: 2, width: '100%', value: promptText, type: "string", placeholder: "Enter text", onChange: (e) => changeContent(e) }))),
60
- React.createElement(rebass_1.Flex, { marginTop: 3, padding: 2, "data-name": "footer" },
61
- React.createElement(SimpleButton_1.default, { tone: "error", "data-name": "delete", variant: "raised", disabled: !canConfirm(), onClick: () => onConfirmmForm() }, props.confirmButtonText),
62
- React.createElement("div", { style: { flex: 1 } }),
63
- props.cancelButtonText != null ? (React.createElement(SimpleButton_1.default, { "data-name": "cancel", tone: "neutral", variant: "raised", onClick: () => onCancelForm() }, props.cancelButtonText)) : null)))));
60
+ React.createElement(rebass_1.Flex, { marginTop: 3, padding: 2, "data-name": "footer", justifyContent: "space-between" },
61
+ props.cancelButtonText != null ? (React.createElement(SimpleButton_1.default, { "data-name": "cancel", tone: "neutral", variant: "raised", onClick: () => onCancelForm() }, props.cancelButtonText)) : (React.createElement("div", null)),
62
+ React.createElement(SimpleButton_1.default, { tone: "error", "data-name": "delete", variant: "raised", disabled: !canConfirm(), onClick: () => onConfirmmForm() }, props.confirmButtonText))))));
64
63
  };
65
64
  exports.AdaptablePopupConfirmation = AdaptablePopupConfirmation;
@@ -40,9 +40,8 @@ const AdaptablePopupPrompt = (props) => {
40
40
  })))),
41
41
  React.createElement(Input_1.default, { autoFocus: true, marginTop: 3, mx: 3, value: promptText, type: "string", placeholder: "Enter text", onChange: (e) => changeContent(e) }),
42
42
  React.createElement(rebass_1.Box, { marginTop: 3 },
43
- React.createElement(rebass_1.Flex, { padding: 2 },
44
- React.createElement(SimpleButton_1.default, { tone: "accent", "data-name": "ok", variant: "raised", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(promptText), onClick: () => onConfirmForm() }, "OK"),
45
- React.createElement("div", { style: { flex: 1 } }),
46
- React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "raised", onClick: () => onCloseForm(), "data-name": "cancel" }, "Cancel"))))));
43
+ React.createElement(rebass_1.Flex, { padding: 2, "data-name": "footer", justifyContent: "space-between" },
44
+ React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "raised", onClick: () => onCloseForm(), "data-name": "cancel" }, "Cancel"),
45
+ React.createElement(SimpleButton_1.default, { tone: "accent", "data-name": "ok", variant: "raised", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(promptText), onClick: () => onConfirmForm() }, "OK"))))));
47
46
  };
48
47
  exports.AdaptablePopupPrompt = AdaptablePopupPrompt;
@@ -35,11 +35,7 @@ const WindowPopups = () => {
35
35
  let componentNode = null;
36
36
  if (!Component &&
37
37
  (windowItem.PopupProps.render || windowItem.PopupProps.frameworkComponent)) {
38
- componentNode = (React.createElement(ExternalRenderer_1.ExternalRenderer
39
- // TODO AFL: add configurable width&height for custom popups
40
- , {
41
- // TODO AFL: add configurable width&height for custom popups
42
- style: { height: '100%' }, render: windowItem.PopupProps.render, frameworkComponent: windowItem.PopupProps.frameworkComponent, onDestroy: windowItem.PopupProps.onFrameworkComponentDestroyed }));
38
+ componentNode = (React.createElement(ExternalRenderer_1.ExternalRenderer, { style: { height: '100%' }, render: windowItem.PopupProps.render, frameworkComponent: windowItem.PopupProps.frameworkComponent, onDestroy: windowItem.PopupProps.onFrameworkComponentDestroyed }));
43
39
  }
44
40
  else {
45
41
  Component = Component ?? NoopComponent;
@@ -102,6 +102,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, adaptableContainerId, agGr
102
102
  rowScope: {
103
103
  ExcludeGroupRows: true,
104
104
  ExcludeSummaryRows: true,
105
+ ExcludeTotalRows: true,
105
106
  },
106
107
  actionColumnSettings: { suppressMenu: true, suppressMovable: true },
107
108
  actionColumnButton,
@@ -34,7 +34,7 @@ const renderReportColumnsSummary = (report) => {
34
34
  exports.renderReportColumnsSummary = renderReportColumnsSummary;
35
35
  const ReportColumnsWizardSection = (props) => {
36
36
  const { api, data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
37
- return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
37
+ return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' } },
38
38
  React.createElement(Tabs_1.Tabs, { m: 2, value: data.ReportColumnScope, onValueChange: (ReportColumnScope) => {
39
39
  const report = {
40
40
  ...data,
@@ -24,6 +24,7 @@ const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstant
24
24
  const Textarea_1 = tslib_1.__importDefault(require("../../../components/Textarea"));
25
25
  const ButtonInfo_1 = require("../../Components/Buttons/ButtonInfo");
26
26
  const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/DocumentationLinkConstants");
27
+ const AdaptableColumn_1 = require("../../../AdaptableState/Common/AdaptableColumn");
27
28
  const DOLLAR_OPTIONS = {
28
29
  FractionDigits: 2,
29
30
  FractionSeparator: '.',
@@ -149,6 +150,18 @@ const getFormatDisplayTypeForScope = (scope, api) => {
149
150
  return 'text';
150
151
  }
151
152
  if ('ColumnTypes' in scope && scope.ColumnTypes.length) {
153
+ // if a Pivot Total Column Type is specified, we can safely assume that the data type is number
154
+ const pivotTotalTypes = [
155
+ AdaptableColumn_1.PIVOT_ANY_TOTAL_COLUMN_TYPE,
156
+ AdaptableColumn_1.PIVOT_GRAND_TOTAL_COLUMN_TYPE,
157
+ AdaptableColumn_1.PIVOT_COLUMN_TOTAL_COLUMN_TYPE,
158
+ AdaptableColumn_1.PIVOT_AGGREGATION_TOTAL_COLUMN_TYPE,
159
+ ];
160
+ // if all column types are pivot total types, we can safely assume that the data type is number
161
+ if (scope.ColumnTypes.length > 0 &&
162
+ scope.ColumnTypes.every((type) => pivotTotalTypes.includes(type))) {
163
+ return 'number';
164
+ }
152
165
  // need to check if all column with this column type has the same data type and return that particular one
153
166
  const columns = scope.ColumnTypes.flatMap((columnType) => {
154
167
  return api.columnApi.getColumnsByColumnType(columnType);
@@ -302,7 +315,9 @@ const renderNumberFormat = (data, onChange, setFormatOption, scopedCustomFormatt
302
315
  React.createElement(FormLayout_1.FormRow, { label: "Floor" },
303
316
  React.createElement(CheckBox_1.CheckBox, { "data-name": "floor-checkbox", checked: data.DisplayFormat.Options.Floor, onChange: (checked) => setFormatOption('Floor', checked) })),
304
317
  React.createElement(FormLayout_1.FormRow, { label: "Round" },
305
- React.createElement(CheckBox_1.CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) })))))),
318
+ React.createElement(CheckBox_1.CheckBox, { "data-name": "round-checkbox", checked: data.DisplayFormat.Options.Round, onChange: (checked) => setFormatOption('Round', checked) })),
319
+ React.createElement(FormLayout_1.FormRow, { label: "Empty" },
320
+ React.createElement(CheckBox_1.CheckBox, { "data-name": "empty-checkbox", checked: data.DisplayFormat.Options.Empty, onChange: (checked) => setFormatOption('Empty', checked) })))))),
306
321
  scopedCustomFormatters.length > 0 && (React.createElement(Tabs_1.Tabs, { marginTop: 2, keyboardNavigation: false },
307
322
  React.createElement(Tabs_1.Tabs.Tab, null, "Custom Formats"),
308
323
  React.createElement(Tabs_1.Tabs.Content, null,