@adaptabletools/adaptable 18.0.0-canary.11 → 18.0.0-canary.13

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 (147) hide show
  1. package/base.css +5 -1
  2. package/base.css.map +1 -1
  3. package/index.css +7 -1
  4. package/index.css.map +1 -1
  5. package/package.json +1 -1
  6. package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -2
  7. package/src/AdaptableOptions/ColumnOptions.d.ts +7 -4
  8. package/src/AdaptableOptions/CommentOptions.d.ts +9 -7
  9. package/src/AdaptableOptions/MenuOptions.d.ts +1 -53
  10. package/src/AdaptableOptions/MenuOptions.js +3 -3
  11. package/src/AdaptableOptions/NoteOptions.d.ts +4 -1
  12. package/src/Api/AdaptableApi.d.ts +4 -4
  13. package/src/Api/ColumnApi.d.ts +4 -0
  14. package/src/Api/CommentApi.d.ts +11 -12
  15. package/src/Api/ConfigApi.d.ts +3 -4
  16. package/src/Api/EventApi.d.ts +7 -9
  17. package/src/Api/Events/CommentChanged.d.ts +11 -0
  18. package/src/Api/GridApi.d.ts +6 -1
  19. package/src/Api/Implementation/ActionColumnApiImpl.js +3 -6
  20. package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
  21. package/src/Api/Implementation/AdaptableApiImpl.js +2 -2
  22. package/src/Api/Implementation/ApiBase.d.ts +2 -2
  23. package/src/Api/Implementation/ApiBase.js +1 -1
  24. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  25. package/src/Api/Implementation/ColumnApiImpl.js +10 -0
  26. package/src/Api/Implementation/CommentsApiImpl.d.ts +1 -2
  27. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -2
  28. package/src/Api/Implementation/ConfigApiImpl.js +8 -8
  29. package/src/Api/Implementation/GridApiImpl.d.ts +3 -1
  30. package/src/Api/Implementation/GridApiImpl.js +17 -1
  31. package/src/Api/Implementation/{NotesApiImpl.d.ts → NoteApiImpl.d.ts} +8 -8
  32. package/src/Api/Implementation/{NotesApiImpl.js → NoteApiImpl.js} +12 -12
  33. package/src/Api/Implementation/OptionsApiImpl.d.ts +4 -5
  34. package/src/Api/Implementation/OptionsApiImpl.js +2 -12
  35. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -3
  36. package/src/Api/Implementation/UserInterfaceApiImpl.js +0 -8
  37. package/src/Api/Internal/ActionRowInternalApi.js +1 -1
  38. package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -3
  39. package/src/Api/Internal/AdaptableInternalApi.js +11 -11
  40. package/src/Api/Internal/CalculatedColumnInternalApi.js +3 -2
  41. package/src/Api/Internal/ExportInternalApi.d.ts +2 -1
  42. package/src/Api/Internal/ExportInternalApi.js +4 -1
  43. package/src/Api/Internal/Fdc3InternalApi.js +2 -2
  44. package/src/Api/Internal/FreeTextColumnInternalApi.js +3 -2
  45. package/src/Api/Internal/GridInternalApi.d.ts +2 -0
  46. package/src/Api/Internal/GridInternalApi.js +15 -0
  47. package/src/Api/Internal/{NotesInternalApi.d.ts → NoteInternalApi.d.ts} +1 -1
  48. package/src/Api/Internal/{NotesInternalApi.js → NoteInternalApi.js} +1 -1
  49. package/src/Api/NoteApi.d.ts +48 -0
  50. package/src/Api/OptionsApi.d.ts +8 -12
  51. package/src/Api/UserInterfaceApi.d.ts +0 -11
  52. package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
  53. package/src/PredefinedConfig/CommentState.d.ts +27 -23
  54. package/src/PredefinedConfig/Common/RowSummary.d.ts +6 -0
  55. package/src/PredefinedConfig/Common/TransposeConfig.d.ts +6 -0
  56. package/src/PredefinedConfig/Common/Types.d.ts +4 -4
  57. package/src/PredefinedConfig/Common/Types.js +4 -1
  58. package/src/PredefinedConfig/{NotesState.d.ts → NoteState.d.ts} +3 -3
  59. package/src/PredefinedConfig/NoteState.js +1 -0
  60. package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -2
  61. package/src/PredefinedConfig/Selection/GridCell.d.ts +13 -0
  62. package/src/PredefinedConfig/SystemState.d.ts +2 -3
  63. package/src/Redux/ActionsReducers/NoteRedux.d.ts +38 -0
  64. package/src/Redux/ActionsReducers/{NotesRedux.js → NoteRedux.js} +21 -21
  65. package/src/Redux/ActionsReducers/SystemRedux.d.ts +1 -1
  66. package/src/Redux/ActionsReducers/SystemRedux.js +3 -3
  67. package/src/Redux/Store/AdaptableStore.js +11 -17
  68. package/src/Strategy/{CommentsModule.d.ts → CommentModule.d.ts} +1 -5
  69. package/src/Strategy/{CommentsModule.js → CommentModule.js} +9 -10
  70. package/src/Strategy/LayoutModule.d.ts +1 -0
  71. package/src/Strategy/LayoutModule.js +17 -1
  72. package/src/Strategy/{NotesModule.d.ts → NoteModule.d.ts} +2 -1
  73. package/src/Strategy/{NotesModule.js → NoteModule.js} +11 -7
  74. package/src/Strategy/Utilities/getScopeViewItems.js +3 -0
  75. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  76. package/src/Utilities/Constants/ModuleConstants.js +6 -6
  77. package/src/Utilities/Defaults/DefaultSettingsPanel.js +2 -2
  78. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +10 -0
  79. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -3
  80. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  81. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +15 -0
  82. package/src/Utilities/ObjectFactory.d.ts +3 -3
  83. package/src/Utilities/ObjectFactory.js +4 -24
  84. package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +1 -0
  85. package/src/Utilities/Services/AggregatedScalarLiveValue.js +12 -10
  86. package/src/Utilities/Services/CellPopupService.js +2 -2
  87. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -4
  88. package/src/Utilities/Services/ModuleService.js +4 -0
  89. package/src/Utilities/Services/QueryLanguageService.js +2 -2
  90. package/src/Utilities/Services/ReportService.d.ts +7 -5
  91. package/src/Utilities/Services/ReportService.js +238 -22
  92. package/src/Utilities/Services/SummaryService.d.ts +1 -1
  93. package/src/Utilities/adaptableQlUtils.d.ts +2 -0
  94. package/src/Utilities/adaptableQlUtils.js +14 -0
  95. package/src/View/AdaptableViewFactory.js +2 -2
  96. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
  97. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
  98. package/src/View/Comments/CommentsEditor.js +1 -1
  99. package/src/View/Comments/CommentsPopup.js +8 -4
  100. package/src/View/Components/NewScopeComponent.js +2 -2
  101. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +6 -6
  102. package/src/View/Components/ValueSelector/index.d.ts +1 -0
  103. package/src/View/Components/ValueSelector/index.js +1 -1
  104. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +0 -1
  105. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +1 -1
  106. package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +3 -1
  107. package/src/View/Layout/LayoutViewPanel.js +2 -1
  108. package/src/View/Layout/TransposedPopup.js +19 -18
  109. package/src/View/Layout/Wizard/LayoutWizard.js +11 -2
  110. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +8 -0
  111. package/src/View/Layout/Wizard/sections/RowSummarySection.js +140 -0
  112. package/src/View/Note/NotePopup.d.ts +2 -0
  113. package/src/View/{Notes/NotesPopup.js → Note/NotePopup.js} +6 -6
  114. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  115. package/src/agGrid/AdaptableAgGrid.d.ts +2 -0
  116. package/src/agGrid/AdaptableAgGrid.js +97 -58
  117. package/src/agGrid/AgGridAdapter.d.ts +2 -0
  118. package/src/agGrid/AgGridAdapter.js +8 -0
  119. package/src/agGrid/AgGridColumnAdapter.d.ts +1 -1
  120. package/src/agGrid/AgGridColumnAdapter.js +4 -4
  121. package/src/agGrid/AgGridOptionsService.d.ts +4 -1
  122. package/src/agGrid/AgGridOptionsService.js +22 -0
  123. package/src/agGrid/defaultAdaptableOptions.js +0 -7
  124. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +2 -1
  125. package/src/components/ExpressionEditor/QueryBuilder/utils.d.ts +0 -1
  126. package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -14
  127. package/src/components/icons/note.js +2 -2
  128. package/src/env.js +2 -2
  129. package/src/metamodel/adaptable.metamodel.d.ts +77 -14
  130. package/src/metamodel/adaptable.metamodel.js +1 -1
  131. package/src/parser/src/parser.js +117 -1257
  132. package/src/parser/src/predicate/mapExpressionToQlPredicate.js +1 -1
  133. package/src/parser/src/predicate/mapQlPredicateToExpression.js +2 -1
  134. package/src/parser/src/types.d.ts +2 -2
  135. package/src/types.d.ts +23 -20
  136. package/tsconfig.esm.tsbuildinfo +1 -1
  137. package/src/Api/Events/CommentsChangedInfo.d.ts +0 -5
  138. package/src/Api/NotesApi.d.ts +0 -48
  139. package/src/PredefinedConfig/CellAddress.d.ts +0 -13
  140. package/src/PredefinedConfig/CellAddress.js +0 -4
  141. package/src/Redux/ActionsReducers/NotesRedux.d.ts +0 -38
  142. package/src/View/Notes/NotesPopup.d.ts +0 -2
  143. /package/src/Api/Events/{CommentsChangedInfo.js → CommentChanged.js} +0 -0
  144. /package/src/Api/{NotesApi.js → NoteApi.js} +0 -0
  145. /package/src/PredefinedConfig/{NotesState.js → Common/TransposeConfig.js} +0 -0
  146. /package/src/View/{Notes → Note}/NoteEditor.d.ts +0 -0
  147. /package/src/View/{Notes → Note}/NoteEditor.js +0 -0
@@ -1,17 +1,21 @@
1
1
  import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
2
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
3
- export class NotesModule extends AdaptableModuleBase {
3
+ export class NoteModule extends AdaptableModuleBase {
4
4
  constructor(api) {
5
- super(ModuleConstants.NotesModuleId, ModuleConstants.NotesFriendlyName, 'note', 'NotesPopup', 'Notes', api);
5
+ super(ModuleConstants.NoteModuleId, ModuleConstants.NoteFriendlyName, 'note', 'NotePopup', 'Notes', api);
6
6
  this.adaptable = api.internalApi.getAdaptableInstance();
7
7
  }
8
+ isModuleAvailable() {
9
+ // Note module doesn't support autogenerated primary keys
10
+ return super.isModuleAvailable() && !this.api.optionsApi.getAutogeneratePrimaryKey();
11
+ }
8
12
  addContextMenuItems(menuContext) {
9
13
  var _a, _b;
10
14
  if (!this.isModuleAvailable()) {
11
15
  return undefined;
12
16
  }
13
17
  const items = [];
14
- const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNotesOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
18
+ const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
15
19
  if (!isCellNotable ||
16
20
  isCellNotable({
17
21
  adaptableApi: this.adaptable.api,
@@ -28,23 +32,23 @@ export class NotesModule extends AdaptableModuleBase {
28
32
  getAddRemoveNoteMenuItems(menuContext) {
29
33
  var _a;
30
34
  const items = [];
31
- if (!this.api.notesApi.internalApi.areNotesAvailable()) {
35
+ if (!this.api.noteApi.internalApi.areNotesAvailable()) {
32
36
  return items;
33
37
  }
34
38
  // does not have note
35
- const [note] = (_a = this.adaptable.api.notesApi.getCellNotes({
39
+ const [note] = (_a = this.adaptable.api.noteApi.getNotesForCell({
36
40
  PrimaryKeyValue: menuContext.primaryKeyValue,
37
41
  ColumnId: menuContext.adaptableColumn.columnId,
38
42
  })) !== null && _a !== void 0 ? _a : [];
39
43
  if (note) {
40
44
  items.push(this.createColumnMenuItemClickFunction('Remove Note', this.moduleInfo.Glyph, () => {
41
- this.api.notesApi.deleteNote(note);
45
+ this.api.noteApi.deleteNote(note);
42
46
  }));
43
47
  }
44
48
  else {
45
49
  items.push(this.createColumnMenuItemClickFunction('Add Note', this.moduleInfo.Glyph, () => {
46
50
  // add an empty one
47
- this.api.notesApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
51
+ this.api.noteApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
48
52
  this.api.internalApi.getCellPopupService().showPopup({
49
53
  PrimaryKeyValue: menuContext.primaryKeyValue,
50
54
  ColumnId: menuContext.adaptableColumn.columnId,
@@ -10,6 +10,9 @@ export const getScopeViewItems = (scope, api) => {
10
10
  if ('All' in scope) {
11
11
  values = ['All Columns'];
12
12
  }
13
+ if ('ColumnTypes' in scope) {
14
+ values = scope.ColumnTypes;
15
+ }
13
16
  return {
14
17
  label: 'Target',
15
18
  name: 'Target',
@@ -37,10 +37,10 @@ export declare const GridInfoModuleId: ModuleConstants;
37
37
  export declare const GridInfoFriendlyName = "Grid Info";
38
38
  export declare const ColumnInfoModuleId: ModuleConstants;
39
39
  export declare const ColumnInfoFriendlyName = "Column Info";
40
- export declare const NotesModuleId: ModuleConstants;
41
- export declare const NotesFriendlyName = "Notes";
42
- export declare const CommentsModuleId: ModuleConstants;
43
- export declare const CommentsFriendlyName = "Comments";
40
+ export declare const NoteModuleId: ModuleConstants;
41
+ export declare const NoteFriendlyName = "Note";
42
+ export declare const CommentModuleId: ModuleConstants;
43
+ export declare const CommentFriendlyName = "Comment";
44
44
  export declare const IPushPullModuleId: ModuleConstants;
45
45
  export declare const IPushPullFriendlyName = "IPushPull";
46
46
  export declare const LayoutModuleId: ModuleConstants;
@@ -108,12 +108,12 @@ export declare const ADAPTABLE_MODULE_MAP: {
108
108
  ToolPanel: string;
109
109
  SettingsPanel: string;
110
110
  StatusBar: string;
111
- Notes: string;
111
+ Note: string;
112
112
  ColumnInfo: string;
113
113
  DataImport: string;
114
114
  NamedQuery: string;
115
115
  GridFilter: string;
116
- Comments: string;
116
+ Comment: string;
117
117
  Query: string;
118
118
  Filter: string;
119
119
  };
@@ -36,10 +36,10 @@ export const GridInfoModuleId = 'GridInfo';
36
36
  export const GridInfoFriendlyName = 'Grid Info';
37
37
  export const ColumnInfoModuleId = 'ColumnInfo';
38
38
  export const ColumnInfoFriendlyName = 'Column Info';
39
- export const NotesModuleId = 'Notes';
40
- export const NotesFriendlyName = 'Notes';
41
- export const CommentsModuleId = 'Comments';
42
- export const CommentsFriendlyName = 'Comments';
39
+ export const NoteModuleId = 'Note';
40
+ export const NoteFriendlyName = 'Note';
41
+ export const CommentModuleId = 'Comment';
42
+ export const CommentFriendlyName = 'Comment';
43
43
  export const IPushPullModuleId = 'IPushPull';
44
44
  export const IPushPullFriendlyName = 'IPushPull';
45
45
  export const LayoutModuleId = 'Layout';
@@ -107,12 +107,12 @@ export const ADAPTABLE_MODULE_MAP = {
107
107
  [ToolPanelModuleId]: ToolPanelFriendlyName,
108
108
  [SettingsPanelModuleId]: SettingsPanelFriendlyName,
109
109
  [StatusBarModuleId]: StatusBarFriendlyName,
110
- [NotesModuleId]: NotesFriendlyName,
110
+ [NoteModuleId]: NoteFriendlyName,
111
111
  [ColumnInfoModuleId]: ColumnInfoFriendlyName,
112
112
  [DataImportModuleId]: DataImportFriendyName,
113
113
  [NamedQueryModuleId]: NamedQueryFriendlyName,
114
114
  [GridFilterModuleId]: GridFilterFriendlyName,
115
- [CommentsModuleId]: CommentsFriendlyName,
115
+ [CommentModuleId]: CommentFriendlyName,
116
116
  // Remove next version
117
117
  ['Query']: 'Query',
118
118
  ['Filter']: 'Filter',
@@ -41,7 +41,7 @@ export const DEFAULT_SETTINGS_PANEL_NAVIGATION_ITEMS = [
41
41
  'Charting',
42
42
  'Schedule',
43
43
  'TeamSharing',
44
- 'Notes',
45
- 'Comments',
44
+ 'Note',
45
+ 'Comment',
46
46
  'StateManagement',
47
47
  ];
@@ -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,6 +322,7 @@ 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) {
@@ -381,6 +384,7 @@ export const aggregatedScalarExpressionFunctions = {
381
384
  ],
382
385
  examples: ['MODE([colA])', 'MODE([colA], GROUP_BY([colB]))'],
383
386
  category: 'aggregation',
387
+ inputs: [['number'], ['text']],
384
388
  },
385
389
  DISTINCT: {
386
390
  handler(args, context) {
@@ -428,6 +432,7 @@ export const aggregatedScalarExpressionFunctions = {
428
432
  ],
429
433
  examples: ['DISTINCT([colA])', 'DISTINCT([colA], GROUP_BY([colB]))'],
430
434
  category: 'aggregation',
435
+ inputs: [['number'], ['text']],
431
436
  },
432
437
  ONLY: {
433
438
  handler(args, context) {
@@ -477,6 +482,7 @@ export const aggregatedScalarExpressionFunctions = {
477
482
  ],
478
483
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
479
484
  category: 'aggregation',
485
+ inputs: [['number'], ['text']],
480
486
  },
481
487
  STD_DEVIATION: {
482
488
  handler(args, context) {
@@ -534,6 +540,7 @@ export const aggregatedScalarExpressionFunctions = {
534
540
  ],
535
541
  examples: ['ONLY([colA])', 'ONLY([colA], GROUP_BY([colB]))'],
536
542
  category: 'aggregation',
543
+ inputs: ['number'],
537
544
  },
538
545
  MIN: {
539
546
  handler(args, context) {
@@ -585,6 +592,7 @@ export const aggregatedScalarExpressionFunctions = {
585
592
  ],
586
593
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
587
594
  category: 'aggregation',
595
+ inputs: ['number'],
588
596
  },
589
597
  MAX: {
590
598
  handler(args, context) {
@@ -636,6 +644,7 @@ export const aggregatedScalarExpressionFunctions = {
636
644
  ],
637
645
  examples: ['MIN([colA])', 'MIN([colA], GROUP_BY([colB]))'],
638
646
  category: 'aggregation',
647
+ inputs: ['number'],
639
648
  },
640
649
  QUANT: {
641
650
  handler(args, context) {
@@ -834,6 +843,7 @@ export const aggregatedScalarExpressionFunctions = {
834
843
  ],
835
844
  examples: ['COUNT([colA])', 'COUNT([colA], GROUP_BY([colB]))'],
836
845
  category: 'aggregation',
846
+ inputs: [['number'], ['text']],
837
847
  },
838
848
  OVER: {
839
849
  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.notesApi.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.notesApi.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) {
@@ -4,11 +4,8 @@ import { IAdaptableService } from './IAdaptableService';
4
4
  import { ExcelStyle, IRowNode } from '@ag-grid-community/core';
5
5
  import { CustomDestination, SystemExportDestination } from '../../../types';
6
6
  export interface IReportService extends IAdaptableService {
7
- resetExcelStyleMemoization(): void;
8
- registerExcelStyle(excelStyle: Partial<ExcelStyle>, cellClassKey: string): void;
9
- getRegisteredExcelStyles(): ExcelStyle[];
7
+ buildExcelStylesForVisualReports(): ExcelStyle[];
10
8
  getExcelStyleIdForCellClassKey(cellClassKey: string): string;
11
- registerExcelStyleWithFormattedDate(cellClassId: string, isoFormattedValue: string): void;
12
9
  getExcelStyleWithFormattedDate(cellClassId: string): string;
13
10
  CreateSystemReport(systemReportName: SystemReportName): Report;
14
11
  IsSystemReport(reportName: string): boolean;
@@ -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(),
@@ -10,11 +10,8 @@ export declare class ReportService implements IReportService {
10
10
  private cellClassKey2excelStyleIdMap;
11
11
  private excelStylesWithFormattedDate;
12
12
  constructor(adaptableApi: AdaptableApi);
13
- resetExcelStyleMemoization(): void;
14
- registerExcelStyle(excelStyle: Partial<ExcelStyle>, cellClassKey: string): void;
15
- getRegisteredExcelStyles(): ExcelStyle[];
13
+ destroy(): void;
16
14
  getExcelStyleIdForCellClassKey(cellClassKey: string): string;
17
- registerExcelStyleWithFormattedDate(cellClassId: string, isoFormattedValue: string): void;
18
15
  getExcelStyleWithFormattedDate(cellClassId: string): string;
19
16
  CreateSystemReport(systemReportName: SystemReportName): Report;
20
17
  IsSystemReport(reportName: string): boolean;
@@ -33,7 +30,12 @@ export declare class ReportService implements IReportService {
33
30
  getCellExportValueFromRowNode(rowNode: IRowNode, columnId: string): any;
34
31
  getCellExportValueFromRawValue(rowNode: IRowNode, cellRawValue: any, columnId: string): any;
35
32
  getReportFileName(reportName: string, destination: SystemExportDestination | CustomDestination): string;
36
- destroy(): void;
37
33
  private getCustomExportDateFormat;
38
34
  private getCellExportValueFromRawValueByType;
35
+ buildExcelStylesForVisualReports(): ExcelStyle[];
36
+ createExcelStyleMemoization(): void;
37
+ private convertCSSToExcelStyle;
38
+ private resetExcelStyleMemoization;
39
+ private registerExcelStyle;
40
+ private registerExcelStyleWithFormattedDate;
39
41
  }