@adaptabletools/adaptable 18.0.0-canary.12 → 18.0.0-canary.14

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 (115) hide show
  1. package/base.css +1 -1
  2. package/base.css.map +1 -1
  3. package/index.css +1 -1
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -2
  7. package/src/AdaptableOptions/MenuOptions.d.ts +1 -53
  8. package/src/AdaptableOptions/MenuOptions.js +3 -3
  9. package/src/Api/AdaptableApi.d.ts +2 -2
  10. package/src/Api/ConfigApi.d.ts +2 -3
  11. package/src/Api/GridApi.d.ts +2 -1
  12. package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
  13. package/src/Api/Implementation/ConfigApiImpl.js +7 -7
  14. package/src/Api/Implementation/GridApiImpl.d.ts +2 -1
  15. package/src/Api/Implementation/GridApiImpl.js +8 -1
  16. package/src/Api/Implementation/NoteApiImpl.d.ts +2 -2
  17. package/src/Api/Implementation/NoteApiImpl.js +8 -8
  18. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
  19. package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
  20. package/src/Api/Internal/ActionRowInternalApi.js +1 -1
  21. package/src/Api/Internal/AdaptableInternalApi.d.ts +4 -2
  22. package/src/Api/Internal/AdaptableInternalApi.js +14 -11
  23. package/src/Api/Internal/CalculatedColumnInternalApi.js +3 -2
  24. package/src/Api/Internal/Fdc3InternalApi.js +2 -2
  25. package/src/Api/Internal/FreeTextColumnInternalApi.js +3 -2
  26. package/src/Api/Internal/GridInternalApi.d.ts +2 -0
  27. package/src/Api/Internal/GridInternalApi.js +15 -0
  28. package/src/Api/NoteApi.d.ts +5 -5
  29. package/src/Api/OptionsApi.d.ts +2 -2
  30. package/src/Api/UserInterfaceApi.d.ts +0 -11
  31. package/src/PredefinedConfig/AdaptableState.d.ts +1 -1
  32. package/src/PredefinedConfig/CommentState.d.ts +16 -12
  33. package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -1
  34. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +25 -0
  35. package/src/PredefinedConfig/Common/TransposeConfig.js +1 -0
  36. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  37. package/src/PredefinedConfig/Common/Types.js +4 -1
  38. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  39. package/src/PredefinedConfig/NoteState.d.ts +1 -1
  40. package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
  41. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  42. package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +20 -20
  43. package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
  44. package/src/Redux/Store/AdaptableStore.js +7 -7
  45. package/src/Strategy/CellSummaryModule.js +2 -1
  46. package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +1 -5
  47. package/src/Strategy/{CommentsModule.js → CommentModule.js} +5 -6
  48. package/src/Strategy/LayoutModule.d.ts +1 -0
  49. package/src/Strategy/LayoutModule.js +17 -1
  50. package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
  51. package/src/Strategy/{NotesModule.js → NoteModule.js} +7 -3
  52. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  53. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  54. package/src/Utilities/Constants/ModuleConstants.js +6 -6
  55. package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
  56. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +15 -2
  57. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  58. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  59. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  60. package/src/Utilities/ObjectFactory.d.ts +3 -3
  61. package/src/Utilities/ObjectFactory.js +4 -24
  62. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +1 -0
  63. package/src/Utilities/Services/AggregatedScalarLiveValue.js +12 -10
  64. package/src/Utilities/Services/CellPopupService.js +2 -2
  65. package/src/Utilities/Services/Interface/ISummaryService.d.ts +17 -0
  66. package/src/Utilities/Services/Interface/ISummaryService.js +12 -0
  67. package/src/Utilities/Services/ModuleService.js +4 -0
  68. package/src/Utilities/Services/QueryLanguageService.js +2 -2
  69. package/src/Utilities/Services/SummaryService.d.ts +5 -14
  70. package/src/Utilities/Services/SummaryService.js +0 -12
  71. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  72. package/src/Utilities/adaptableQlUtils.js +14 -0
  73. package/src/View/AdaptableViewFactory.js +2 -2
  74. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  75. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
  76. package/src/View/Comments/CommentsEditor.js +1 -1
  77. package/src/View/Comments/CommentsPopup.js +8 -4
  78. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +5 -5
  79. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  80. package/src/View/Components/ValueSelector/index.js +1 -1
  81. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -1
  82. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  83. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  84. package/src/View/Layout/TransposedPopup.js +19 -18
  85. package/src/View/Layout/Wizard/LayoutWizard.js +8 -0
  86. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +8 -0
  87. package/src/View/Layout/Wizard/sections/RowSummarySection.js +150 -0
  88. package/src/View/Note/NotePopup.d.ts +2 -0
  89. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +3 -3
  90. package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
  91. package/src/agGrid/AdaptableAgGrid.js +7 -5
  92. package/src/agGrid/AgGridAdapter.d.ts +1 -0
  93. package/src/agGrid/AgGridAdapter.js +5 -0
  94. package/src/agGrid/AgGridColumnAdapter.js +3 -3
  95. package/src/agGrid/AgGridMenuAdapter.js +10 -6
  96. package/src/agGrid/defaultAdaptableOptions.js +0 -7
  97. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  98. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  99. package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -14
  100. package/src/components/icons/note.js +2 -2
  101. package/src/env.js +2 -2
  102. package/src/metamodel/adaptable.metamodel.d.ts +61 -11
  103. package/src/metamodel/adaptable.metamodel.js +1 -1
  104. package/src/parser/src/parser.js +117 -1257
  105. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  106. package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
  107. package/src/parser/src/types.d.ts +2 -2
  108. package/src/types.d.ts +5 -4
  109. package/tsconfig.esm.tsbuildinfo +1 -1
  110. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
  111. package/src/View/Notes/NotesPopup.d.ts +0 -2
  112. /package/src/Api/Internal/{NotesInternalApi.d.ts → NoteInternalApi.d.ts} +0 -0
  113. /package/src/Api/Internal/{NotesInternalApi.js → NoteInternalApi.js} +0 -0
  114. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  115. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -113,6 +113,7 @@ export const aggregatedScalarExpressionFunctions = {
113
113
  ],
114
114
  examples: ['SUM([colA])', 'SUM([colA], GROUP_BY([colB]))'],
115
115
  category: 'aggregation',
116
+ inputs: ['number'],
116
117
  },
117
118
  PERCENTAGE: {
118
119
  handler(args, context) {
@@ -256,6 +257,7 @@ export const aggregatedScalarExpressionFunctions = {
256
257
  ],
257
258
  examples: ['AVG([colA])', 'AVG([colA], GROUP_BY([colB]))', 'AVG([colA], WEIGHT([colB]))'],
258
259
  category: 'aggregation',
260
+ inputs: ['number'],
259
261
  },
260
262
  MEDIAN: {
261
263
  handler(args, context) {
@@ -320,12 +322,13 @@ export const aggregatedScalarExpressionFunctions = {
320
322
  ],
321
323
  examples: ['MEDIAN([colA])', 'MEDIAN([colA], GROUP_BY([colB]))'],
322
324
  category: 'aggregation',
325
+ inputs: ['number'],
323
326
  },
324
327
  MODE: {
325
328
  handler(args, context) {
326
329
  const modeColumnParameter = extractColumnParameter('mode', args);
327
330
  const modeColumnName = modeColumnParameter.value;
328
- validateColumnType(modeColumnName, ['Number'], 'mode', context.adaptableApi);
331
+ validateColumnType(modeColumnName, ['Number', 'String'], 'mode', context.adaptableApi);
329
332
  const groupByParameter = extractParameter('MODE', 'operand', ['GROUP_BY'], args, {
330
333
  isOptional: true,
331
334
  });
@@ -339,7 +342,10 @@ export const aggregatedScalarExpressionFunctions = {
339
342
  reducer: (aggregatedValue, rowValue, rowNode) => {
340
343
  var _a;
341
344
  if (typeof rowValue !== 'number' && typeof rowValue !== 'string') {
342
- return;
345
+ return aggregatedValue;
346
+ }
347
+ if (!aggregatedValue) {
348
+ return new Map();
343
349
  }
344
350
  aggregatedValue.set(rowValue, ((_a = aggregatedValue.get(rowValue)) !== null && _a !== void 0 ? _a : 0) + 1);
345
351
  return aggregatedValue;
@@ -381,6 +387,7 @@ export const aggregatedScalarExpressionFunctions = {
381
387
  ],
382
388
  examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
383
389
  category: 'aggregation',
390
+ inputs: [['number'], ['text']],
384
391
  },
385
392
  DISTINCT: {
386
393
  handler(args, context) {
@@ -428,6 +435,7 @@ export const aggregatedScalarExpressionFunctions = {
428
435
  ],
429
436
  examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
430
437
  category: 'aggregation',
438
+ inputs: [['number'], ['text']],
431
439
  },
432
440
  ONLY: {
433
441
  handler(args, context) {
@@ -477,6 +485,7 @@ export const aggregatedScalarExpressionFunctions = {
477
485
  ],
478
486
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
479
487
  category: 'aggregation',
488
+ inputs: [['number'], ['text']],
480
489
  },
481
490
  STD_DEVIATION: {
482
491
  handler(args, context) {
@@ -534,6 +543,7 @@ export const aggregatedScalarExpressionFunctions = {
534
543
  ],
535
544
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
536
545
  category: 'aggregation',
546
+ inputs: ['number'],
537
547
  },
538
548
  MIN: {
539
549
  handler(args, context) {
@@ -585,6 +595,7 @@ export const aggregatedScalarExpressionFunctions = {
585
595
  ],
586
596
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
587
597
  category: 'aggregation',
598
+ inputs: ['number'],
588
599
  },
589
600
  MAX: {
590
601
  handler(args, context) {
@@ -636,6 +647,7 @@ export const aggregatedScalarExpressionFunctions = {
636
647
  ],
637
648
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
638
649
  category: 'aggregation',
650
+ inputs: ['number'],
639
651
  },
640
652
  QUANT: {
641
653
  handler(args, context) {
@@ -834,6 +846,7 @@ export const aggregatedScalarExpressionFunctions = {
834
846
  ],
835
847
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
836
848
  category: 'aggregation',
849
+ inputs: [['number'], ['text']],
837
850
  },
838
851
  OVER: {
839
852
  handler(args, context) {
@@ -275,10 +275,10 @@ const isLastElementMinValue = (values) => {
275
275
  };
276
276
  // useful for functions which do NOT have an initial change (ex. GRID_CHANGE NONE)
277
277
  const getDataChangedInfoStub = (context) => {
278
- var _a;
278
+ var _a, _b;
279
279
  let rowNodeStub;
280
280
  if (!context.filterFn) {
281
- rowNodeStub = context.adaptableApi.gridApi.getFirstRowNode();
281
+ rowNodeStub = (_a = context.node) !== null && _a !== void 0 ? _a : context.adaptableApi.gridApi.getFirstRowNode();
282
282
  }
283
283
  else {
284
284
  // if there is a WHERE clause defined, find the first rowNode which satisfies the condition
@@ -293,7 +293,7 @@ const getDataChangedInfoStub = (context) => {
293
293
  const rowNode = rowNodeStub;
294
294
  if (rowNode) {
295
295
  const primaryKeyValue = context.adaptableApi.gridApi.getPrimaryKeyValueForRowNode(rowNode);
296
- const columnId = (_a = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _a === void 0 ? void 0 : _a.columnId;
296
+ const columnId = (_b = context.adaptableApi.columnApi.getQueryableColumns()[0]) === null || _b === void 0 ? void 0 : _b.columnId;
297
297
  const oldValue = context.adaptableApi.gridApi.getCellRawValue(primaryKeyValue, columnId);
298
298
  const column = context.adaptableApi.columnApi.getColumnWithColumnId(columnId);
299
299
  const newValue = oldValue;
@@ -2,6 +2,6 @@ import { ExpressionFunction } from '../../parser/src/types';
2
2
  /**
3
3
  * List of all the Scalar Functions available in AdaptableQL
4
4
  */
5
- export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
5
+ export type ScalarFunctionName = 'ADD' | 'SUB' | 'MUL' | 'DIV' | 'MOD' | 'POW' | 'ABS' | 'CEILING' | 'FLOOR' | 'ROUND' | 'MIN' | 'MAX' | 'AVG' | 'DATE' | 'NOW' | 'CURRENT_DAY' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'ADD_DAYS' | 'ADD_WEEKS' | 'ADD_MONTHS' | 'ADD_YEARS' | 'DIFF_DAYS' | 'DIFF_WEEKS' | 'DIFF_MONTHS' | 'DIFF_YEARS' | 'SUB_STRING' | 'REPLACE' | 'COALESCE' | 'NULL' | 'LEN' | 'UPPER' | 'LOWER' | 'CONCAT' | 'IF' | 'CASE' | 'COL' | 'FIELD' | 'VAR' | 'TO_ARRAY' | 'QUERY' | 'IS_BLANK' | 'IS_NOT_BLANK';
6
6
  export declare const scalarExpressionFunctions: Record<ScalarFunctionName, ExpressionFunction>;
7
7
  export declare const scalarExpressionFunctionNames: ScalarFunctionName[];
@@ -68,6 +68,21 @@ export const scalarExpressionFunctions = {
68
68
  category: 'special',
69
69
  returnType: 'any',
70
70
  },
71
+ FIELD: {
72
+ handler(args, context) {
73
+ var _a, _b;
74
+ const fieldName = args[0];
75
+ if (StringExtensions.IsNullOrEmpty(fieldName)) {
76
+ throw new ExpressionEvaluationError('FIELD', 'requires a field name');
77
+ }
78
+ return (_a = context.adaptableApi) === null || _a === void 0 ? void 0 : _a.internalApi.getValueUsingField((_b = context.node) === null || _b === void 0 ? void 0 : _b.data, fieldName);
79
+ },
80
+ description: 'Returns the value of a row field (not necessarily mapped to a column). If the field is nested, use dot notation (e.g. "nested.fieldName")',
81
+ signatures: ['FIELD(fieldName:string)'],
82
+ examples: ['FIELD("fieldName")', 'FIELD("nested.fieldName")'],
83
+ category: 'special',
84
+ returnType: 'any',
85
+ },
71
86
  QUERY: {
72
87
  handler(args, context) {
73
88
  var _a, _b;
@@ -21,14 +21,14 @@ import { Shortcut } from '../PredefinedConfig/ShortcutState';
21
21
  import { IPushPullReport } from '../PredefinedConfig/SystemState';
22
22
  import { NotificationsOptions } from '../AdaptableOptions/NotificationsOptions';
23
23
  import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
24
- import { AdaptableTheme, BaseContext, ChartDefinition, ColumnFilter, CommentThread, CustomDisplayFormatterContext, FlashingCellDefinition, GridDataChangedInfo, SystemFilterPredicateId } from '../types';
24
+ import { AdaptableTheme, BaseContext, ChartDefinition, ColumnFilter, CommentThread, CustomDisplayFormatterContext, FlashingCellDefinition, GridDataChangedInfo, SpecialColumnSettings, SystemFilterPredicateId } from '../types';
25
25
  import { IRowNode } from '@ag-grid-community/core';
26
26
  import { AdaptableApi, AdaptableComment, BadgeStyleDefinition, CellAddress, NamedQuery } from '../../types';
27
27
  import { ToastOptions } from '../components/Toastify';
28
28
  import { StyledColumn } from '../PredefinedConfig/StyledColumnState';
29
29
  export declare function CreateEmptyCustomSort(): CustomSort;
30
30
  export declare function CreateAdaptableComment(text: string, api: AdaptableApi): AdaptableComment;
31
- export declare function CreateEmptyCalculatedColumn(): CalculatedColumn;
31
+ export declare function CreateEmptyCalculatedColumn(defaultSpecialColumnSettings: Partial<SpecialColumnSettings>): CalculatedColumn;
32
32
  export declare function CreateEmptyNamedQuery(expression?: string): NamedQuery;
33
33
  export declare function CreateEmptyPlusMinusNudge(): PlusMinusNudge;
34
34
  export declare function CreateGenericAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition): AdaptableGenericAlert;
@@ -51,7 +51,7 @@ export declare function CreateReportSchedule(reportName: string): ReportSchedule
51
51
  export declare function CreateEmptySchedule(): Schedule;
52
52
  export declare function CreateEmptyShortcut(): Shortcut;
53
53
  export declare function CreateEmptyFormatColumn(): FormatColumn;
54
- export declare function CreateEmptyFreeTextColumn(): FreeTextColumn;
54
+ export declare function CreateEmptyFreeTextColumn(defaultSpecialColumnSettings: Partial<SpecialColumnSettings>): FreeTextColumn;
55
55
  export declare function CreateEmptyLayout(layout?: Partial<Layout> & {
56
56
  Name: string;
57
57
  }, adaptableColumns?: AdaptableColumn[]): Layout;
@@ -18,7 +18,7 @@ export function CreateAdaptableComment(text, api) {
18
18
  };
19
19
  return comment;
20
20
  }
21
- export function CreateEmptyCalculatedColumn() {
21
+ export function CreateEmptyCalculatedColumn(defaultSpecialColumnSettings) {
22
22
  return {
23
23
  Uuid: createUuid(),
24
24
  ColumnId: EMPTY_STRING,
@@ -26,17 +26,7 @@ export function CreateEmptyCalculatedColumn() {
26
26
  ScalarExpression: EMPTY_STRING,
27
27
  },
28
28
  // need to create some defaults - which we will change later
29
- CalculatedColumnSettings: {
30
- DataType: undefined,
31
- Filterable: true,
32
- Resizable: true,
33
- Groupable: false,
34
- Sortable: true,
35
- Pivotable: false,
36
- Aggregatable: false,
37
- SuppressMenu: false,
38
- SuppressMovable: false,
39
- },
29
+ CalculatedColumnSettings: Object.assign(Object.assign({}, defaultSpecialColumnSettings), { DataType: undefined }),
40
30
  };
41
31
  }
42
32
  export function CreateEmptyNamedQuery(expression) {
@@ -245,24 +235,14 @@ export function CreateEmptyFormatColumn() {
245
235
  CellAlignment: undefined,
246
236
  };
247
237
  }
248
- export function CreateEmptyFreeTextColumn() {
238
+ export function CreateEmptyFreeTextColumn(defaultSpecialColumnSettings) {
249
239
  return {
250
240
  Uuid: createUuid(),
251
241
  ColumnId: EMPTY_STRING,
252
242
  DefaultValue: EMPTY_STRING,
253
243
  FreeTextStoredValues: [],
254
244
  TextEditor: 'Inline',
255
- FreeTextColumnSettings: {
256
- DataType: 'String',
257
- Filterable: true,
258
- Resizable: true,
259
- Groupable: false,
260
- Sortable: true,
261
- Pivotable: false,
262
- Aggregatable: false,
263
- SuppressMenu: false,
264
- SuppressMovable: false,
265
- },
245
+ FreeTextColumnSettings: Object.assign(Object.assign({}, defaultSpecialColumnSettings), { DataType: 'String' }),
266
246
  };
267
247
  }
268
248
  export function CreateEmptyLayout(layout, adaptableColumns) {
@@ -22,5 +22,6 @@ export declare class AggregatedScalarLiveValue {
22
22
  getAllAggregationValues(): number[];
23
23
  private getAggregationValue;
24
24
  getGlobalAggregatedValue(): any;
25
+ private getRowNodeValueForColumnId;
25
26
  private computeAggregatedValue;
26
27
  }
@@ -60,7 +60,7 @@ export class AggregatedScalarLiveValue {
60
60
  var _a, _b;
61
61
  if ((_a = this.expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.length) {
62
62
  const groupColumns = this.expressionEvaluation.aggregationParams.groupBy.map((groupByParam) => groupByParam.field);
63
- const groupKeys = groupColumns.map((groupColumnName) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, groupColumnName));
63
+ const groupKeys = groupColumns.map((groupColumnName) => this.getRowNodeValueForColumnId(rowNode, groupColumnName));
64
64
  return (_b = this.aggregationResult.deepMap.get(groupKeys)) === null || _b === void 0 ? void 0 : _b.reducerResults[this.aggregationReducerName];
65
65
  }
66
66
  return this.getGlobalAggregatedValue();
@@ -68,6 +68,11 @@ export class AggregatedScalarLiveValue {
68
68
  getGlobalAggregatedValue() {
69
69
  return this.aggregationResult.reducerResults[this.aggregationReducerName];
70
70
  }
71
+ getRowNodeValueForColumnId(rowNode, columnId) {
72
+ const rawValue = this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
73
+ // we need to convert the Date object to a number, otherwise the grouping will not work (each Date instance is unique)
74
+ return rawValue instanceof Date ? rawValue.getTime() : rawValue;
75
+ }
71
76
  computeAggregatedValue(expressionEvaluation) {
72
77
  var _a;
73
78
  const gridRowNodes = expressionEvaluation.getRowNodes
@@ -77,18 +82,16 @@ export class AggregatedScalarLiveValue {
77
82
  });
78
83
  // we iterate over the RowNode list (we need this to handle complex column values (nested values, valueGetters etc)
79
84
  // so we will map the fieldNames to RowNode.data
80
- const mapReducerValueGetter = (fieldName) => {
81
- return (rowNode) => {
82
- return this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, fieldName);
83
- };
85
+ const mapReducerValueGetter = (columnId) => {
86
+ return (rowNode) => this.getRowNodeValueForColumnId(rowNode, columnId);
84
87
  };
85
88
  Object.values(expressionEvaluation.aggregationParams.reducers).forEach((aggregationReducer) => {
86
89
  aggregationReducer.getter = mapReducerValueGetter(aggregationReducer.field);
87
90
  // nullify the field to force the fallback on the getter fn
88
91
  aggregationReducer.field = null;
89
92
  });
90
- const mapGroupByToKey = (fieldName) => {
91
- return (_unusableProperty, rowNode) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, fieldName);
93
+ const mapGroupByToKey = (columnId) => {
94
+ return (_unusableProperty, rowNode) => this.getRowNodeValueForColumnId(rowNode, columnId);
92
95
  };
93
96
  (_a = expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.forEach((groupByDef) => {
94
97
  groupByDef.toKey = mapGroupByToKey(groupByDef.field);
@@ -96,11 +99,10 @@ export class AggregatedScalarLiveValue {
96
99
  let aggregatedRowNodes = gridRowNodes;
97
100
  if (expressionEvaluation.sortByColumn) {
98
101
  const sortByColumn = expressionEvaluation.sortByColumn;
99
- const getRowNodeValue = (rowNode, columnId) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, columnId);
100
102
  // currently, we support only ascending sorting
101
103
  aggregatedRowNodes.sort((first, second) => {
102
- const firstValue = getRowNodeValue(first, sortByColumn);
103
- const secondValue = getRowNodeValue(second, sortByColumn);
104
+ const firstValue = this.getRowNodeValueForColumnId(first, sortByColumn);
105
+ const secondValue = this.getRowNodeValueForColumnId(second, sortByColumn);
104
106
  if (firstValue < secondValue) {
105
107
  return -1;
106
108
  }
@@ -74,7 +74,7 @@ export class CellPopupService {
74
74
  this.hidePopup();
75
75
  return;
76
76
  }
77
- const cellNotes = this.adaptable.api.noteApi.getCellNotes(cellPosition);
77
+ const cellNotes = this.adaptable.api.noteApi.getNotesForCell(cellPosition);
78
78
  const cellComments = this.adaptable.api.commentApi.getCommentThread(cellPosition);
79
79
  const hasNotesOrComments = (cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length) || cellComments;
80
80
  // call only if it is different
@@ -92,7 +92,7 @@ export class CellPopupService {
92
92
  return;
93
93
  }
94
94
  // if open but this has no note, close
95
- const cellNotes = this.adaptable.api.noteApi.getCellNotes(cellAddress);
95
+ const cellNotes = this.adaptable.api.noteApi.getNotesForCell(cellAddress);
96
96
  const cellComments = this.adaptable.api.commentApi.getCommentThread(cellAddress);
97
97
  const hasNotesOrComments = (cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length) || cellComments;
98
98
  if (openCellAddress && !hasNotesOrComments) {
@@ -0,0 +1,17 @@
1
+ import { IAdaptableService } from './IAdaptableService';
2
+ import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
3
+ import { IRowNode } from '@ag-grid-community/core/dist/esm/es6/interfaces/iRowNode';
4
+ import { AggregatedScalarLiveValue } from '../AggregatedScalarLiveValue';
5
+ export declare const summarySupportedExpressions: readonly ["SUM", "AVG", "MIN", "MAX", "COUNT", "MEDIAN", "MODE", "DISTINCT", "ONLY", "STD_DEVIATION"];
6
+ export type SummaryConfig = {
7
+ expression: {
8
+ function: SummarySupportedExpression;
9
+ };
10
+ columnId: string;
11
+ getRowNodes?: () => IRowNode[];
12
+ };
13
+ export type SummarySupportedExpression = (typeof summarySupportedExpressions)[number];
14
+ export interface ISummaryService extends IAdaptableService {
15
+ evaluateExpressionValue(config: SummaryConfig, moduleId: AdaptableModule): any;
16
+ evaluateScalarLiveValue(config: SummaryConfig, moduleId: AdaptableModule): AggregatedScalarLiveValue;
17
+ }
@@ -0,0 +1,12 @@
1
+ export const summarySupportedExpressions = [
2
+ 'SUM',
3
+ 'AVG',
4
+ 'MIN',
5
+ 'MAX',
6
+ 'COUNT',
7
+ 'MEDIAN',
8
+ 'MODE',
9
+ 'DISTINCT',
10
+ 'ONLY',
11
+ 'STD_DEVIATION',
12
+ ];
@@ -101,6 +101,8 @@ export class ModuleService {
101
101
  return learnUrl + 'handbook-exporting';
102
102
  case 'ColumnFilter':
103
103
  return learnUrl + 'handbook-column-filter';
104
+ case 'Comment':
105
+ return learnUrl + 'handbook-comments';
104
106
  case 'GridFilter':
105
107
  return learnUrl + 'handbook-grid-filter';
106
108
  case 'FlashingCell':
@@ -113,6 +115,8 @@ export class ModuleService {
113
115
  return learnUrl + 'handbook-monitoring-grid-info';
114
116
  case 'Layout':
115
117
  return learnUrl + 'handbook-layouts';
118
+ case 'Note':
119
+ return learnUrl + 'handbook-notes';
116
120
  case 'PlusMinus':
117
121
  return learnUrl + 'handbook-editing-plus-minus';
118
122
  case 'NamedQuery':
@@ -48,7 +48,7 @@ export class QueryLanguageService {
48
48
  const moduleExpressionFunctions = this.getModuleExpressionFunctionsMap(module);
49
49
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
50
50
  const reactiveExpression$ = parser.evaluate(reactiveExpression, {
51
- node: reactiveExpression,
51
+ node: this.adaptableApi.gridApi.getFirstRowNode(),
52
52
  adaptableApi: this.adaptableApi,
53
53
  userName: this.adaptableApi.optionsApi.getUserName(),
54
54
  adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
@@ -62,7 +62,7 @@ export class QueryLanguageService {
62
62
  const moduleExpressionFunctionsMap = this.getModuleExpressionFunctionsMap(module);
63
63
  const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctionsMap);
64
64
  const aggregationEvaluation = parser.evaluate(aggregationExpression, {
65
- node: aggregationExpression,
65
+ node: this.adaptableApi.gridApi.getFirstRowNode(),
66
66
  adaptableApi: this.adaptableApi,
67
67
  userName: this.adaptableApi.optionsApi.getUserName(),
68
68
  adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
@@ -1,19 +1,10 @@
1
- import { IRowNode } from '@ag-grid-community/core';
2
- import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
3
1
  import { AdaptableApi, AdaptableModule } from '../../types';
4
- export declare const summarySupportedExpressions: readonly ["SUM", "AVG", "MIN", "MAX", "COUNT", "MEDIAN", "MODE", "DISTINCT", "ONLY", "STD_DEVIATION"];
5
- export type SummarySupportedExpression = (typeof summarySupportedExpressions)[number];
6
- export type SumaryConfig = {
7
- expression: {
8
- function: SummarySupportedExpression;
9
- };
10
- columnId: string;
11
- getRowNodes?: () => IRowNode[];
12
- };
13
- export declare class SummaryService {
2
+ import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
3
+ import { ISummaryService, SummaryConfig } from './Interface/ISummaryService';
4
+ export declare class SummaryService implements ISummaryService {
14
5
  private adaptableApi;
15
6
  constructor(adaptableApi: AdaptableApi);
16
- evaluateExpressionValue(config: SumaryConfig, moduleId: AdaptableModule): any;
17
- evaluateScalarLiveValue(config: SumaryConfig, moduleId: AdaptableModule): AggregatedScalarLiveValue;
7
+ evaluateExpressionValue(config: SummaryConfig, moduleId: AdaptableModule): any;
8
+ evaluateScalarLiveValue(config: SummaryConfig, moduleId: AdaptableModule): AggregatedScalarLiveValue;
18
9
  destroy(): void;
19
10
  }
@@ -1,16 +1,4 @@
1
1
  import { AggregatedScalarLiveValue } from './AggregatedScalarLiveValue';
2
- export const summarySupportedExpressions = [
3
- 'SUM',
4
- 'AVG',
5
- 'MIN',
6
- 'MAX',
7
- 'COUNT',
8
- 'MEDIAN',
9
- 'MODE',
10
- 'DISTINCT',
11
- 'ONLY',
12
- 'STD_DEVIATION',
13
- ];
14
2
  export class SummaryService {
15
3
  constructor(adaptableApi) {
16
4
  this.adaptableApi = adaptableApi;
@@ -0,0 +1,2 @@
1
+ import { AdaptableColumnDataType, ExpressionFunctionInputType } from '../types';
2
+ export declare const mapColumnDataTypeToExpressionFunctionType: (dataType: AdaptableColumnDataType) => ExpressionFunctionInputType;
@@ -0,0 +1,14 @@
1
+ export const mapColumnDataTypeToExpressionFunctionType = (dataType) => {
2
+ if (dataType === 'Number') {
3
+ return 'number';
4
+ }
5
+ if (dataType === 'Boolean') {
6
+ return 'boolean';
7
+ }
8
+ if (dataType === 'String') {
9
+ return 'text';
10
+ }
11
+ if (dataType === 'Date') {
12
+ return 'date';
13
+ }
14
+ };
@@ -29,7 +29,7 @@ import { StatusBarPopup } from './StatusBar/StatusBarPopup';
29
29
  import { ChartingViewPanel } from './Charting/ChartingViewPanel';
30
30
  import { GridFilterPopup } from './GridFilter/GridFilterPopup';
31
31
  import { ColumnInfoPopup } from './ColumnInfo/ColumnInfoPopup';
32
- import { NotesPopup } from './Notes/NotesPopup';
32
+ import { NotePopup } from './Note/NotePopup';
33
33
  import { CommentsPopup } from './Comments/CommentsPopup';
34
34
  import { DataImportPopup } from './DataImport/DataImportPopup';
35
35
  export const AdaptableViewFactory = {
@@ -46,7 +46,7 @@ export const AdaptableViewFactory = {
46
46
  ToolPanelPopup,
47
47
  SystemStatusPopup,
48
48
  DataChangeHistoryPopup,
49
- NotesPopup,
49
+ NotePopup,
50
50
  CommentsPopup,
51
51
  DataImportPopup,
52
52
  GridFilterPopup,
@@ -2,7 +2,7 @@
2
2
  import { CalculatedColumn } from '../../../types';
3
3
  import { AdaptableOnePageWizardProps } from '../../Wizard/Interface/IAdaptableWizard';
4
4
  export declare const calculatedColumnTypes: readonly ["ScalarExpression", "AggregatedScalarExpression", "CumulativeAggregatedExpression", "QuantileAggregatedExpression"];
5
- export type ExpressionType = (typeof calculatedColumnTypes)[number];
5
+ export type ExpressionType = typeof calculatedColumnTypes[number];
6
6
  export interface CalculatedColumnWizardProps extends AdaptableOnePageWizardProps<CalculatedColumn> {
7
7
  }
8
8
  export declare const CalculatedColumnWizard: (props: CalculatedColumnWizardProps) => JSX.Element;
@@ -36,7 +36,7 @@ export const CalculatedColumnWizard = (props) => {
36
36
  return cloneObject(calculatedColumn);
37
37
  }
38
38
  }
39
- return ObjectFactory.CreateEmptyCalculatedColumn();
39
+ return ObjectFactory.CreateEmptyCalculatedColumn(adaptable.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
40
40
  });
41
41
  const dispatch = useDispatch();
42
42
  const isEdit = Boolean(props.data) || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
@@ -85,7 +85,7 @@ export const CommentsEditor = (props) => {
85
85
  }
86
86
  }, mt: 2, mb: "2", width: "100%", placeholder: "Write new comment" }),
87
87
  React.createElement(SimpleButton, { width: "100%", variant: "raised", onClick: () => {
88
- adaptable.api.settingsPanelApi.openSettingsPanel('Comments');
88
+ adaptable.api.settingsPanelApi.openSettingsPanel('Comment');
89
89
  adaptable.api.internalApi.getCellPopupService().hidePopup();
90
90
  } },
91
91
  React.createElement(Box, { mr: 2 },
@@ -45,14 +45,18 @@ const CellComments = (props) => {
45
45
  const columnFriendlyName = adaptable.api.columnApi.getFriendlyNameForColumnId(props.commentThread.ColumnId);
46
46
  return (React.createElement(Panel, { mb: 2, header: React.createElement(Flex, { width: "100%", alignItems: "center" },
47
47
  React.createElement(Box, { mr: 2 },
48
- "Cell Value: ",
48
+ React.createElement("b", null, "Cell Value:"),
49
+ " ",
49
50
  cellValue),
50
51
  React.createElement(Box, { mr: 2 },
51
- primaryKeyHeader,
52
- ": ",
52
+ React.createElement("b", null,
53
+ primaryKeyHeader,
54
+ ":"),
55
+ " ",
53
56
  props.commentThread.PrimaryKeyValue),
54
57
  React.createElement(Box, null,
55
- "Column: ",
58
+ React.createElement("b", null, "Column:"),
59
+ " ",
56
60
  columnFriendlyName),
57
61
  React.createElement(Box, { flex: 1 }),
58
62
  React.createElement(AdaptableButtonComponent, { mr: 1, variant: "text", icon: "visibility-on", onClick: () => {
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { useSelector } from 'react-redux';
3
3
  import { Flex } from 'rebass';
4
- import { GetNotesSelector } from '../../../../Redux/ActionsReducers/NotesRedux';
4
+ import { GetNotesSelector } from '../../../../Redux/ActionsReducers/NoteRedux';
5
5
  import { SystemCommentsAndNotesEditModeSelector, SystemCommentsAndNotesFocusedEntitySelector, SystemCommentsAndNotesSelector, } from '../../../../Redux/ActionsReducers/SystemRedux';
6
6
  import { useAdaptable } from '../../../AdaptableContext';
7
7
  import { CommentsEditor } from '../../../Comments/CommentsEditor';
8
- import { NoteEditor } from '../../../Notes/NoteEditor';
8
+ import { NoteEditor } from '../../../Note/NoteEditor';
9
9
  import { CellPopup } from '../../CellPopup';
10
10
  const ConnectedNoteEditor = ({ enableEditMode }) => {
11
11
  const { api } = useAdaptable();
12
- const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('Notes');
12
+ const isReadonly = api.entitlementApi.isModuleReadOnlyEntitlement('Note');
13
13
  const editMode = useSelector((state) => SystemCommentsAndNotesEditModeSelector(state.System));
14
14
  const cellPopupService = api.internalApi.getCellPopupService();
15
15
  const cellAddress = useSelector((state) => SystemCommentsAndNotesSelector(state.System));
@@ -17,12 +17,12 @@ const ConnectedNoteEditor = ({ enableEditMode }) => {
17
17
  // Only handle first note for now
18
18
  // Later we can handle multiple notes
19
19
  note,] = useSelector((state) => {
20
- return cellAddress ? GetNotesSelector(state.Notes, cellAddress) : [];
20
+ return cellAddress ? GetNotesSelector(state.Note, cellAddress) : [];
21
21
  });
22
22
  const handleNoteChange = React.useCallback((value) => {
23
23
  api.noteApi.updateNoteText(value, note);
24
24
  }, [note]);
25
- return (React.createElement(Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotesPopup" },
25
+ return (React.createElement(Flex, { onClick: () => enableEditMode(), flexDirection: "column", className: "ab-NotePopup" },
26
26
  React.createElement(NoteEditor, { isReadonly: isReadonly, editMode: editMode, key: note === null || note === void 0 ? void 0 : note.Uuid, onClose: () => cellPopupService.hidePopup(), note: note === null || note === void 0 ? void 0 : note.Text, onNoteChange: (value) => handleNoteChange(value) })));
27
27
  };
28
28
  export const GridCellPopup = (props) => {
@@ -26,6 +26,7 @@ export type ValueSelectorProps<OPTION_TYPE, ID_TYPE extends number | string> = {
26
26
  onShowSelectedOnlyChange?: (selectedOnly: boolean) => void;
27
27
  isOptionDisabled?: (option: OPTION_TYPE) => boolean;
28
28
  disabled?: boolean;
29
+ style?: React.CSSProperties;
29
30
  };
30
31
  export declare function ValueSelector<OPTION_TYPE, ID_TYPE extends number | string>(props: ValueSelectorProps<OPTION_TYPE, ID_TYPE>): JSX.Element;
31
32
  export declare namespace ValueSelector {
@@ -111,7 +111,7 @@ export function ValueSelector(props) {
111
111
  };
112
112
  const showOnlySelectedCheckbox = (React.createElement(CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show Selected Only'));
113
113
  const showSelectedOnlyPosition = (_a = props.showSelectedOnlyPosition) !== null && _a !== void 0 ? _a : 'floating';
114
- return (React.createElement(Flex, { className: baseClassName, flexDirection: "column", flex: 1 },
114
+ return (React.createElement(Flex, { style: props.style, className: baseClassName, flexDirection: "column", flex: 1 },
115
115
  React.createElement(Flex, { mb: 1 },
116
116
  showFilterInput && filter ? (React.createElement(AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", style: { flex: 1, border: 0, margin: 3 } })) : (React.createElement(Box, { flex: 1 })),
117
117
  showSelectedOnlyPosition === 'top' && React.createElement(Box, { ml: 20 }, showOnlySelectedCheckbox)),
@@ -208,7 +208,6 @@ const buildGridOptions = (mainAdaptableInstance, changeHistoryLog) => {
208
208
  },
209
209
  autoGroupColumnDef: {
210
210
  sortable: true,
211
- // suppressMenu: true,
212
211
  },
213
212
  columnDefs: [
214
213
  {
@@ -45,7 +45,7 @@ export class FreeTextColumnSummaryComponent extends React.Component {
45
45
  this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
46
46
  }
47
47
  onNew() {
48
- let configEntity = ObjectFactory.CreateEmptyFreeTextColumn();
48
+ let configEntity = ObjectFactory.CreateEmptyFreeTextColumn(this.props.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
49
49
  configEntity.ColumnId = this.props.summarisedColumn.columnId;
50
50
  this.setState({
51
51
  editedAdaptableObject: configEntity,
@@ -8,8 +8,10 @@ import ObjectFactory from '../../../Utilities/ObjectFactory';
8
8
  import * as FreeTextColumnRedux from '../../../Redux/ActionsReducers/FreeTextColumnRedux';
9
9
  import { useDispatch, useSelector } from 'react-redux';
10
10
  import { ObjectTagsWizardSection, renderObjectTagsSummary, } from '../../Wizard/ObjectTagsWizardSection';
11
+ import { useAdaptable } from '../../AdaptableContext';
11
12
  export const FreeTextColumnWizard = (props) => {
12
13
  var _a;
14
+ const adaptable = useAdaptable();
13
15
  const allFreeTextColumns = useSelector((state) => state.FreeTextColumn.FreeTextColumns);
14
16
  const [freeTextColumn, setFreeTextColumn] = useState(() => {
15
17
  var _a, _b;
@@ -19,7 +21,7 @@ export const FreeTextColumnWizard = (props) => {
19
21
  if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
20
22
  return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
21
23
  }
22
- return ObjectFactory.CreateEmptyFreeTextColumn();
24
+ return ObjectFactory.CreateEmptyFreeTextColumn(adaptable.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
23
25
  });
24
26
  const dispatch = useDispatch();
25
27
  const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';