@adaptabletools/adaptable-cjs 18.0.0-canary.4 → 18.0.0-canary.5

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 (169) hide show
  1. package/agGrid.d.ts +4 -21
  2. package/agGrid.js +5 -21
  3. package/base.css +1 -1
  4. package/base.css.map +1 -1
  5. package/index.css +74 -68
  6. package/index.css.map +1 -1
  7. package/package.json +3 -4
  8. package/src/AdaptableInterfaces/IAdaptable.d.ts +55 -109
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +6 -0
  10. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
  11. package/src/Api/AdaptableApi.d.ts +5 -0
  12. package/src/Api/ColumnFilterApi.d.ts +0 -5
  13. package/src/Api/Events/AdaptableReady.d.ts +3 -3
  14. package/src/Api/Events/GridDataChanged.d.ts +4 -4
  15. package/src/Api/GridApi.d.ts +14 -13
  16. package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
  17. package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
  18. package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
  19. package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
  20. package/src/Api/Implementation/ApiBase.d.ts +2 -1
  21. package/src/Api/Implementation/ApiBase.js +3 -0
  22. package/src/Api/Implementation/ColumnFilterApiImpl.d.ts +0 -1
  23. package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -10
  24. package/src/Api/Implementation/CommentsApiImpl.js +2 -1
  25. package/src/Api/Implementation/ConfigApiImpl.js +8 -3
  26. package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
  27. package/src/Api/Implementation/GridApiImpl.js +20 -14
  28. package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
  29. package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
  30. package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
  31. package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
  32. package/src/Api/Internal/ActionRowInternalApi.js +107 -0
  33. package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
  34. package/src/Api/Internal/AdaptableInternalApi.js +10 -8
  35. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
  36. package/src/Api/Internal/CalculatedColumnInternalApi.js +71 -0
  37. package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
  38. package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
  39. package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
  40. package/src/Api/Internal/ColumnInternalApi.js +12 -0
  41. package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
  42. package/src/Api/Internal/CustomSortInternalApi.js +32 -1
  43. package/src/Api/Internal/DataSetInternalApi.js +1 -1
  44. package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
  45. package/src/Api/Internal/FreeTextColumnInternalApi.js +60 -0
  46. package/src/Api/Internal/GridFilterInternalApi.js +1 -1
  47. package/src/Api/Internal/GridInternalApi.d.ts +21 -3
  48. package/src/Api/Internal/GridInternalApi.js +126 -7
  49. package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
  50. package/src/EnvVars.d.ts +3 -0
  51. package/src/EnvVars.js +8 -0
  52. package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
  53. package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
  54. package/src/Redux/Store/AdaptableStore.d.ts +4 -6
  55. package/src/Redux/Store/AdaptableStore.js +22 -50
  56. package/src/Redux/Store/Interface/IAdaptableStore.d.ts +7 -1
  57. package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
  58. package/src/Strategy/AdaptableModuleBase.js +4 -7
  59. package/src/Strategy/AlertModule.d.ts +1 -2
  60. package/src/Strategy/AlertModule.js +2 -55
  61. package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
  62. package/src/Strategy/CalculatedColumnModule.js +5 -25
  63. package/src/Strategy/ChartingModule.d.ts +0 -1
  64. package/src/Strategy/ChartingModule.js +0 -21
  65. package/src/Strategy/ColumnFilterModule.d.ts +1 -2
  66. package/src/Strategy/ColumnFilterModule.js +1 -64
  67. package/src/Strategy/CommentsModule.d.ts +1 -0
  68. package/src/Strategy/CommentsModule.js +2 -1
  69. package/src/Strategy/CustomSortModule.js +1 -1
  70. package/src/Strategy/DashboardModule.d.ts +1 -2
  71. package/src/Strategy/DashboardModule.js +1 -8
  72. package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
  73. package/src/Strategy/DataChangeHistoryModule.js +3 -1
  74. package/src/Strategy/DataSetModule.d.ts +1 -1
  75. package/src/Strategy/DataSetModule.js +1 -1
  76. package/src/Strategy/FlashingCellModule.d.ts +1 -2
  77. package/src/Strategy/FlashingCellModule.js +2 -15
  78. package/src/Strategy/FormatColumnModule.d.ts +0 -2
  79. package/src/Strategy/FormatColumnModule.js +0 -47
  80. package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
  81. package/src/Strategy/FreeTextColumnModule.js +0 -30
  82. package/src/Strategy/GridFilterModule.d.ts +0 -1
  83. package/src/Strategy/GridFilterModule.js +0 -37
  84. package/src/Strategy/Interface/IModule.d.ts +0 -1
  85. package/src/Strategy/LayoutModule.d.ts +1 -3
  86. package/src/Strategy/LayoutModule.js +6 -50
  87. package/src/Strategy/NamedQueryModule.d.ts +0 -1
  88. package/src/Strategy/NamedQueryModule.js +0 -19
  89. package/src/Strategy/PlusMinusModule.d.ts +1 -1
  90. package/src/Strategy/PlusMinusModule.js +1 -1
  91. package/src/Strategy/ScheduleModule.d.ts +1 -1
  92. package/src/Strategy/ScheduleModule.js +1 -1
  93. package/src/Strategy/ShortcutModule.d.ts +1 -1
  94. package/src/Strategy/ShortcutModule.js +1 -1
  95. package/src/Strategy/StyledColumnModule.d.ts +0 -1
  96. package/src/Strategy/StyledColumnModule.js +0 -21
  97. package/src/Strategy/TeamSharingModule.d.ts +1 -0
  98. package/src/Strategy/TeamSharingModule.js +5 -5
  99. package/src/Strategy/ToolPanelModule.d.ts +0 -1
  100. package/src/Strategy/ToolPanelModule.js +0 -23
  101. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  102. package/src/Utilities/Constants/GeneralConstants.js +3 -2
  103. package/src/Utilities/Helpers/AdaptableHelper.d.ts +0 -3
  104. package/src/Utilities/Helpers/AdaptableHelper.js +1 -60
  105. package/src/Utilities/Services/CellPopupService.js +0 -1
  106. package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
  107. package/src/Utilities/Services/LicenseService/index.js +10 -3
  108. package/src/Utilities/Services/MetamodelService.d.ts +1 -1
  109. package/src/Utilities/Services/MetamodelService.js +6 -3
  110. package/src/Utilities/Services/RowEditService.d.ts +3 -2
  111. package/src/Utilities/Services/RowEditService.js +3 -1
  112. package/src/View/AdaptableView.js +0 -2
  113. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
  114. package/src/View/CalculatedColumn/utils.d.ts +1 -1
  115. package/src/View/CellSummary/CellSummaryPopup.js +1 -1
  116. package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
  117. package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
  118. package/src/View/CustomSort/CustomSortSummary.js +1 -1
  119. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
  120. package/src/View/GridFilter/GridFilterViewPanel.js +6 -2
  121. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
  122. package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
  123. package/src/agGrid/ActionColumnRenderer.js +4 -4
  124. package/src/agGrid/Adaptable.d.ts +3 -455
  125. package/src/agGrid/Adaptable.js +7 -5291
  126. package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
  127. package/src/agGrid/AdaptableAgGrid.js +3785 -0
  128. package/src/agGrid/AdaptableLogger.js +78 -13
  129. package/src/agGrid/AgGridAdapter.d.ts +54 -0
  130. package/src/agGrid/AgGridAdapter.js +554 -0
  131. package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
  132. package/src/agGrid/AgGridColumnAdapter.js +818 -0
  133. package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
  134. package/src/agGrid/AgGridMenuAdapter.js +276 -0
  135. package/src/agGrid/AgGridOptionsService.d.ts +11 -0
  136. package/src/agGrid/AgGridOptionsService.js +54 -0
  137. package/src/agGrid/BadgeRenderer.js +1 -1
  138. package/src/agGrid/CheckboxRenderer.js +1 -1
  139. package/src/agGrid/FilterWrapper.d.ts +2 -2
  140. package/src/agGrid/FilterWrapper.js +1 -1
  141. package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
  142. package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
  143. package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +72 -9
  144. package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
  145. package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
  146. package/src/components/Datepicker/index.d.ts +1 -1
  147. package/src/components/InfiniteTable/index.js +2 -2
  148. package/src/components/Modal/index.d.ts +1 -0
  149. package/src/components/Modal/index.js +6 -4
  150. package/src/env.js +2 -2
  151. package/src/metamodel/adaptable.metamodel.d.ts +9 -9
  152. package/src/metamodel/adaptable.metamodel.js +7 -0
  153. package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
  154. package/src/migration/AdaptableUpgradeHelper.js +52 -0
  155. package/src/migration/VersionUpgrade.d.ts +8 -0
  156. package/src/migration/VersionUpgrade.js +15 -0
  157. package/src/migration/VersionUpgrade17.d.ts +18 -0
  158. package/src/migration/VersionUpgrade17.js +347 -0
  159. package/src/migration/VersionUpgrade18.d.ts +5 -0
  160. package/src/migration/VersionUpgrade18.js +10 -0
  161. package/src/types.d.ts +5 -4
  162. package/tsconfig.cjs.tsbuildinfo +1 -1
  163. package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
  164. package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
  165. package/src/Utilities/Services/Interface/IRowEditService.js +0 -2
  166. package/src/agGrid/agGridHelper.d.ts +0 -57
  167. package/src/agGrid/agGridHelper.js +0 -691
  168. package/src/agGrid/agGridMenuHelper.d.ts +0 -46
  169. package/src/agGrid/agGridMenuHelper.js +0 -673
@@ -8,7 +8,7 @@ import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
8
8
  import { DataUpdateConfig } from '../../PredefinedConfig/Common/DataUpdateConfig';
9
9
  import { CellHighlightInfo } from '../../PredefinedConfig/Common/CellHighlightInfo';
10
10
  import { RowHighlightInfo } from '../../PredefinedConfig/Common/RowHighlightInfo';
11
- import { GridOptions, IRowNode, RowModelType } from '@ag-grid-community/core';
11
+ import { IRowNode, RowModelType } from '@ag-grid-community/core';
12
12
  import { GridCellRange } from '../../PredefinedConfig/Selection/GridCellRange';
13
13
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
14
14
  import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
@@ -18,6 +18,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
18
18
  internalApi: GridInternalApi;
19
19
  constructor(adaptable: IAdaptable);
20
20
  getGridState(): GridState;
21
+ loadGridData(dataSource: any): void;
21
22
  resetGridData(dataSource: any[]): void;
22
23
  setInitialGridData(data: any): void;
23
24
  getGridData(): any[];
@@ -40,7 +41,6 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
40
41
  hideFilterForm(): void;
41
42
  applyGridFiltering(): void;
42
43
  clearGridFiltering(): void;
43
- getAgGridInstance(): GridOptions;
44
44
  getColumnSorts(): ColumnSort[];
45
45
  getColumnSortForColumn(columnId: string): ColumnSort | undefined;
46
46
  setAdaptableSorting(columnSorts: ColumnSort[]): void;
@@ -120,7 +120,6 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
120
120
  isCellEditable(gridCell: GridCell): boolean;
121
121
  isEveryCellEditable(gridCells: GridCell[]): boolean;
122
122
  getRowCount(): number;
123
- getVisibleRowCount(): number;
124
123
  getRowsInViewport(): IRowNode[];
125
124
  getColumnCount(): number;
126
125
  getVisibleColumnCount(): number;
@@ -130,4 +129,5 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
130
129
  getGridContainerElement(): HTMLElement | null;
131
130
  openGridInfoSettingsPanel(): void;
132
131
  getAgGridRowModelType(): RowModelType;
132
+ getVisibleRowCount(): number;
133
133
  }
@@ -8,6 +8,7 @@ const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
8
8
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
9
9
  const GridInternalApi_1 = require("../Internal/GridInternalApi");
10
10
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
11
+ const logDeprecation_1 = require("../../Utilities/logDeprecation");
11
12
  class GridApiImpl extends ApiBase_1.ApiBase {
12
13
  constructor(adaptable) {
13
14
  super(adaptable);
@@ -16,13 +17,18 @@ class GridApiImpl extends ApiBase_1.ApiBase {
16
17
  getGridState() {
17
18
  return this.getAdaptableState().Grid;
18
19
  }
19
- resetGridData(dataSource) {
20
+ loadGridData(dataSource) {
20
21
  this.adaptable.setGridData(dataSource);
21
22
  const allRowNodes = this.getAllRowNodes();
22
- this.internalApi.fireGridDataChangedEvent(dataSource, allRowNodes, 'Add');
23
+ this.internalApi.fireGridDataChangedEvent(dataSource, allRowNodes, 'Load');
24
+ }
25
+ resetGridData(dataSource) {
26
+ (0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'GridApi', 'resetGridData', 'loadGridData');
27
+ this.loadGridData(dataSource);
23
28
  }
24
29
  setInitialGridData(data) {
25
- this.adaptable.setGridData(data);
30
+ (0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'GridApi', 'setInitialGridData', 'loadGridData');
31
+ this.loadGridData(data);
26
32
  }
27
33
  getGridData() {
28
34
  return this.adaptable.getGridData();
@@ -118,9 +124,6 @@ class GridApiImpl extends ApiBase_1.ApiBase {
118
124
  // slightly round the houses but we have to call ColumnFilterAPI as it does it properly
119
125
  this.adaptable.api.columnFilterApi.clearColumnFilters();
120
126
  }
121
- getAgGridInstance() {
122
- return this.adaptable.gridOptions;
123
- }
124
127
  getColumnSorts() {
125
128
  return this.getAdaptableState().Grid.ColumnSorts;
126
129
  }
@@ -275,7 +278,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
275
278
  return this.adaptable.getFirstDisplayedRowNode();
276
279
  }
277
280
  getVisibleRowNodes(config) {
278
- return this.adaptable.getVisibleRowNodes();
281
+ const rowNodes = [];
282
+ this.adaptable.forAllVisibleRowNodesDo((rowNode) => rowNodes.push(rowNode), config);
283
+ return rowNodes;
279
284
  }
280
285
  getAllRowNodes(config) {
281
286
  return this.adaptable.getAllRowNodes(config);
@@ -334,10 +339,10 @@ class GridApiImpl extends ApiBase_1.ApiBase {
334
339
  this.adaptable.expandRowGroupsForValues(columnValues);
335
340
  }
336
341
  isGridPivotable() {
337
- return this.adaptable.isGridPivotable();
342
+ return !this.getAdaptableApi().internalApi.isGridInTreeMode();
338
343
  }
339
344
  isGridGroupable() {
340
- return this.adaptable.isGridGroupable();
345
+ return !this.getAdaptableApi().internalApi.isGridInTreeMode();
341
346
  }
342
347
  isGridSelectable() {
343
348
  return this.adaptable.isGridSelectable();
@@ -353,7 +358,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
353
358
  }
354
359
  redrawGrid() {
355
360
  this.adaptable.redrawBody();
356
- this.adaptable.redrawHeader();
361
+ this.adaptable.refreshHeader();
357
362
  }
358
363
  getGridCellsForRawValue(columnId, rawValue) {
359
364
  const gridCells = this.adaptable.getGridCellsForColumn(columnId);
@@ -456,7 +461,7 @@ class GridApiImpl extends ApiBase_1.ApiBase {
456
461
  }
457
462
  refreshGroupRowNodes() {
458
463
  // see https://www.ag-grid.com/javascript-data-grid/client-side-row-stages/#refreshing-the-client-side-model
459
- this.getAgGridInstance().api.refreshClientSideRowModel('group');
464
+ this.getAdaptableApi().agGridApi.refreshClientSideRowModel('group');
460
465
  this.adaptable.updateRowGroupsExpandedState();
461
466
  }
462
467
  isCellEditable(gridCell) {
@@ -483,9 +488,6 @@ class GridApiImpl extends ApiBase_1.ApiBase {
483
488
  getRowCount() {
484
489
  return this.adaptable.getRowCount();
485
490
  }
486
- getVisibleRowCount() {
487
- return this.adaptable.getVisibleRowCount();
488
- }
489
491
  getRowsInViewport() {
490
492
  return this.adaptable.getRowsInViewport();
491
493
  }
@@ -513,5 +515,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
513
515
  getAgGridRowModelType() {
514
516
  return this.adaptable.getAgGridRowModelType();
515
517
  }
518
+ getVisibleRowCount() {
519
+ (0, logDeprecation_1.logDeprecation)(this.adaptable.logger, 'GridApi', 'getVisibleRowCount', 'getRowCount');
520
+ return this.getRowCount();
521
+ }
516
522
  }
517
523
  exports.GridApiImpl = GridApiImpl;
@@ -5,6 +5,5 @@ import { StatusPanelDef } from '@ag-grid-community/core';
5
5
  export declare class StatusBarApiImpl extends ApiBase implements StatusBarApi {
6
6
  getAdaptableStatusBars(): AdaptableStatusBar[];
7
7
  getAgGridStatusPanels(): StatusPanelDef[];
8
- getAgGridStatusBar(): StatusPanelDef[];
9
8
  setStatusBarPanels(statusPanels: AdaptableStatusBar[]): void;
10
9
  }
@@ -10,9 +10,6 @@ class StatusBarApiImpl extends ApiBase_1.ApiBase {
10
10
  getAgGridStatusPanels() {
11
11
  return this.adaptable.getAgGridStatusPanels();
12
12
  }
13
- getAgGridStatusBar() {
14
- return this.adaptable.getAgGridStatusPanels();
15
- }
16
13
  setStatusBarPanels(statusPanels) {
17
14
  this.dispatchAction((0, StatusBarRedux_1.StatusBarSetPanels)(statusPanels));
18
15
  }
@@ -14,15 +14,15 @@ class ToolPanelApiImpl extends ApiBase_1.ApiBase {
14
14
  this.showModulePopup(ModuleConstants.ToolPanelModuleId);
15
15
  }
16
16
  openAdapTableToolPanel() {
17
- let gridOptions = this.getGridApi().getAgGridInstance();
18
- if (gridOptions) {
19
- gridOptions.api.openToolPanel('adaptable');
17
+ const agGridApi = this.getAdaptableApi().agGridApi;
18
+ if (agGridApi) {
19
+ agGridApi.openToolPanel('adaptable');
20
20
  }
21
21
  }
22
22
  closeAdapTableToolPanel() {
23
- let gridOptions = this.getGridApi().getAgGridInstance();
24
- if (gridOptions) {
25
- gridOptions.api.closeToolPanel();
23
+ const agGridApi = this.getAdaptableApi().agGridApi;
24
+ if (agGridApi) {
25
+ agGridApi.closeToolPanel();
26
26
  }
27
27
  }
28
28
  getCustomToolPanels() {
@@ -1,7 +1,9 @@
1
- import { IRowNode } from '@ag-grid-community/core';
1
+ import { ColDef, IRowNode } from '@ag-grid-community/core';
2
2
  import { AdaptableForm } from '../../PredefinedConfig/Common/AdaptableForm';
3
3
  import { CreateActionRowFormContext, EditActionRowFormContext } from '../../AdaptableOptions/ActionRowOptions';
4
+ import { AdaptableButton } from '../../PredefinedConfig/Common/AdaptableButton';
4
5
  import { ApiBase } from '../Implementation/ApiBase';
6
+ import { ActionColumnContext } from '../../AdaptableOptions/ActionColumnOptions';
5
7
  export declare class ActionRowInternalApi extends ApiBase {
6
8
  buildRowEditForm(rowNode: IRowNode): AdaptableForm<EditActionRowFormContext>;
7
9
  buildRowCreateForm(clonedRowNode?: IRowNode): AdaptableForm<CreateActionRowFormContext>;
@@ -21,4 +23,6 @@ export declare class ActionRowInternalApi extends ApiBase {
21
23
  private buildFormFieldLabelContext;
22
24
  private getFieldTypeFromColumnType;
23
25
  private getFieldValueOptions;
26
+ getColDefsForActionRowColumns(): ColDef[];
27
+ getActionRowButtonDefs(): AdaptableButton<ActionColumnContext<any>>[];
24
28
  }
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActionRowInternalApi = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const ApiBase_1 = require("../Implementation/ApiBase");
6
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
7
+ const UIHelper_1 = tslib_1.__importDefault(require("../../View/UIHelper"));
8
+ const ActionColumnRenderer_1 = require("../../agGrid/ActionColumnRenderer");
5
9
  class ActionRowInternalApi extends ApiBase_1.ApiBase {
6
10
  buildRowEditForm(rowNode) {
7
11
  return this.buildActionRow('rowEdited', rowNode);
@@ -200,5 +204,108 @@ class ActionRowInternalApi extends ApiBase_1.ApiBase {
200
204
  label: value,
201
205
  }));
202
206
  }
207
+ getColDefsForActionRowColumns() {
208
+ const actionButtons = this.getActionRowButtonDefs();
209
+ if (!actionButtons.length) {
210
+ return [];
211
+ }
212
+ return [
213
+ {
214
+ headerName: '',
215
+ colId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
216
+ hide: false,
217
+ editable: false,
218
+ // 15px is the icon width + left&right padding + left&right border
219
+ width: Math.max(actionButtons.length * (UIHelper_1.default.getSimpleButtonPaddingWidth() * 2 + 15) + 2,
220
+ // If the width of the column is to small, the width will not be applied
221
+ // this triggers the setLayout an infinite loop because the width read from the grid is always different
222
+ 40),
223
+ resizable: false,
224
+ lockVisible: true,
225
+ suppressColumnsToolPanel: true,
226
+ suppressFiltersToolPanel: true,
227
+ suppressMenu: true,
228
+ suppressMovable: true,
229
+ filter: false,
230
+ sortable: false,
231
+ enableRowGroup: false,
232
+ pinned: this.getActionRowOptions().actionRowButtonOptions.position === 'pinnedRight'
233
+ ? 'right'
234
+ : 'left',
235
+ cellRenderer: this.getAdaptableVariant() === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
236
+ cellClass: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
237
+ type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
238
+ },
239
+ ];
240
+ }
241
+ getActionRowButtonDefs() {
242
+ const actionRowButtons = this.getActionRowApi().getActionRowButtons();
243
+ if (!(actionRowButtons === null || actionRowButtons === void 0 ? void 0 : actionRowButtons.length)) {
244
+ return [];
245
+ }
246
+ const defaultActionRowButtonConfiguration = {
247
+ create: {
248
+ icon: {
249
+ name: 'add',
250
+ },
251
+ tooltip: 'Create',
252
+ onClick: () => {
253
+ this.getActionRowApi().displayCreateActionRow();
254
+ },
255
+ },
256
+ edit: {
257
+ icon: {
258
+ name: 'edit',
259
+ },
260
+ tooltip: 'Edit',
261
+ onClick: (button, context) => {
262
+ this.getActionRowApi().displayEditActionRow(context.primaryKeyValue);
263
+ },
264
+ },
265
+ clone: {
266
+ icon: {
267
+ name: 'clone',
268
+ },
269
+ tooltip: 'Clone',
270
+ onClick: (button, context) => {
271
+ this.getActionRowApi().displayCloneActionRow(context.primaryKeyValue);
272
+ },
273
+ },
274
+ delete: {
275
+ icon: {
276
+ name: 'delete',
277
+ },
278
+ tooltip: 'Delete',
279
+ onClick: (button, context) => {
280
+ var _a, _b;
281
+ const eventInfo = {
282
+ type: 'rowDeleted',
283
+ rowNode: context.rowNode,
284
+ adaptableApi: context.adaptableApi,
285
+ userName: context.userName,
286
+ adaptableId: context.adaptableId,
287
+ };
288
+ this.getEventApi().emit('ActionRowSubmitted', eventInfo);
289
+ (_b = (_a = this.getActionRowOptions().actionRowFormOptions).onFormSubmit) === null || _b === void 0 ? void 0 : _b.call(_a, eventInfo);
290
+ },
291
+ },
292
+ };
293
+ const actionButtons = actionRowButtons
294
+ .map((actionRowButtonType) => {
295
+ var _a, _b;
296
+ const defaultButtonConfig = defaultActionRowButtonConfiguration[actionRowButtonType];
297
+ if (!defaultButtonConfig) {
298
+ // should NOT happen unless the user sent some invalid button type in the predefined config
299
+ return;
300
+ }
301
+ const customButtonConfig = (_b = (_a = this.getActionRowOptions().actionRowButtonOptions).customConfiguration) === null || _b === void 0 ? void 0 : _b.call(_a, Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { actionRowButtonType }));
302
+ if (!customButtonConfig) {
303
+ return defaultButtonConfig;
304
+ }
305
+ return Object.assign(Object.assign({}, defaultButtonConfig), customButtonConfig);
306
+ })
307
+ .filter(Boolean);
308
+ return actionButtons;
309
+ }
203
310
  }
204
311
  exports.ActionRowInternalApi = ActionRowInternalApi;
@@ -24,9 +24,9 @@ import { AdaptableFrameworkComponent } from '../../AdaptableOptions/AdaptableFra
24
24
  import { IMetamodelService } from '../../Utilities/Services/Interface/IMetamodelService';
25
25
  import { IModuleCollection } from '../../Strategy/Interface/IModule';
26
26
  import { AdaptableObjectTag, AdaptableObjectWithScope } from '../../PredefinedConfig/Common/AdaptableObject';
27
- import { IRowEditService } from '../../Utilities/Services/Interface/IRowEditService';
28
27
  import { Fdc3Service } from '../../Utilities/Services/Fdc3Service';
29
28
  import { CellPopupService } from '../../Utilities/Services/CellPopupService';
29
+ import { RowEditService } from '../../Utilities/Services/RowEditService';
30
30
  export declare class AdaptableInternalApi extends ApiBase {
31
31
  getSystemState(): SystemState;
32
32
  showPopupConfirmation(confirmation: UIConfirmation): void;
@@ -46,8 +46,7 @@ export declare class AdaptableInternalApi extends ApiBase {
46
46
  setPivotModeOn(): void;
47
47
  setPivotModeOff(): void;
48
48
  isGridInPivotMode(): boolean;
49
- setTreeModeOn(): void;
50
- setTreeModeOff(): void;
49
+ setTreeMode(mode: boolean): void;
51
50
  isGridInTreeMode(): boolean;
52
51
  getToolbarTitle(): string;
53
52
  buildDataChangedInfo(config: Pick<CellDataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): CellDataChangedInfo;
@@ -65,7 +64,7 @@ export declare class AdaptableInternalApi extends ApiBase {
65
64
  getAlertService(): IAlertService;
66
65
  getTeamSharingService(): ITeamSharingService;
67
66
  getMetamodelService(): IMetamodelService;
68
- getRowEditService(): IRowEditService;
67
+ getRowEditService(): RowEditService;
69
68
  getFdc3Service(): Fdc3Service;
70
69
  getModules(): IModuleCollection;
71
70
  getModuleFriendlyName(adaptableModule: AdaptableModule): string;
@@ -51,11 +51,13 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
51
51
  isGridInPivotMode() {
52
52
  return this.getAdaptableState().Grid.IsGridInPivotMode;
53
53
  }
54
- setTreeModeOn() {
55
- this.dispatchAction(GridRedux.SetTreeModeOn());
56
- }
57
- setTreeModeOff() {
58
- this.dispatchAction(GridRedux.SetTreeModeOff());
54
+ setTreeMode(mode) {
55
+ if (!!mode) {
56
+ this.dispatchAction(GridRedux.SetTreeModeOn());
57
+ }
58
+ else {
59
+ this.dispatchAction(GridRedux.SetTreeModeOff());
60
+ }
59
61
  }
60
62
  isGridInTreeMode() {
61
63
  return this.getAdaptableState().Grid.IsGridInTreeMode;
@@ -223,13 +225,13 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
223
225
  frameworkComponent,
224
226
  componentType,
225
227
  });
226
- if (this.adaptable.isInitialised) {
228
+ if (this.adaptable.isReady) {
227
229
  createComponentFn();
228
230
  }
229
231
  else {
230
232
  // adaptable may not be initialized yet if the framework component is part of the initial render
231
233
  // AFL 2021.10.14 - not really sure if this is necessary anymore?! (see the other changes in this commit)
232
- (0, waitForCondition_1.waitForCondition)(() => this.adaptable.isInitialised).then(() => {
234
+ (0, waitForCondition_1.waitForCondition)(() => this.adaptable.isReady).then(() => {
233
235
  createComponentFn();
234
236
  });
235
237
  }
@@ -452,7 +454,7 @@ class AdaptableInternalApi extends ApiBase_1.ApiBase {
452
454
  var _a;
453
455
  let actionColumn;
454
456
  if (colDef.colId == GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS) {
455
- const actionButtons = this.adaptable.getActionRowButtonDefs();
457
+ const actionButtons = this.getActionRowApi().internalApi.getActionRowButtonDefs();
456
458
  actionColumn = {
457
459
  columnId: GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS,
458
460
  actionColumnButton: actionButtons,
@@ -1,6 +1,7 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
2
  import { CalculatedColumn } from '../../PredefinedConfig/CalculatedColumnState';
3
3
  import { AdaptableColumn } from '../../types';
4
+ import { ColDef } from '@ag-grid-community/core';
4
5
  export declare class CalculatedColumnInternalApi extends ApiBase {
5
6
  /**
6
7
  * Returns all the references in the AdaptableState of the given CalculatedColumn
@@ -27,4 +28,5 @@ export declare class CalculatedColumnInternalApi extends ApiBase {
27
28
  isQuantileAggregatedExpression(input: string): boolean;
28
29
  getExpressionFromCalculatedColumn(calculatedColumn: CalculatedColumn): string;
29
30
  fireCalculatedColumnChangedEvent(trigger: string, calculatedColumn: CalculatedColumn): void;
31
+ getColDefsForCalculatedColumns(): ColDef[];
30
32
  }
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CalculatedColumnInternalApi = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const ApiBase_1 = require("../Implementation/ApiBase");
6
+ const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
7
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
8
+ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
9
+ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
5
10
  class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
6
11
  /**
7
12
  * Returns all the references in the AdaptableState of the given CalculatedColumn
@@ -90,5 +95,71 @@ class CalculatedColumnInternalApi extends ApiBase_1.ApiBase {
90
95
  };
91
96
  this.adaptable.api.eventApi.emit('CalculatedColumnChanged', calculatedColumnChangedInfo);
92
97
  }
98
+ getColDefsForCalculatedColumns() {
99
+ const defaultCalculatedColumnSettings = (0, ObjectFactory_1.CreateEmptyCalculatedColumn)().CalculatedColumnSettings;
100
+ return this.getCalculatedColumnApi()
101
+ .getCalculatedColumns()
102
+ .map((calculatedColumn) => {
103
+ const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
104
+ if (!calculatedColumnSettings.DataType) {
105
+ calculatedColumnSettings.DataType = this.getAdaptableApi()
106
+ .internalApi.getAdaptableInstance()
107
+ .CalculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumn.Query);
108
+ }
109
+ const columnTypes = [
110
+ GeneralConstants_1.AB_SPECIAL_COLUMN,
111
+ this.getGridApi().internalApi.getAgGridDataType(calculatedColumnSettings.DataType),
112
+ ];
113
+ if (ArrayExtensions_1.default.IsNotNullOrEmpty(calculatedColumnSettings.ColumnTypes)) {
114
+ columnTypes.push(...calculatedColumnSettings.ColumnTypes);
115
+ }
116
+ const isExternalEvaluation = !this.getExpressionApi().internalApi.evaluateExpressionInAdaptableQL('CalculatedColumn', calculatedColumn, this.getExpressionApi().getAdaptableQueryExpression(calculatedColumn.Query));
117
+ const valueGetter = (params) => {
118
+ var _a, _b;
119
+ if (isExternalEvaluation) {
120
+ return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
121
+ }
122
+ // if the grid data is NOT client side, we can aggregate only simple scalar expression (which depend on row data, not on other rows)
123
+ if (this.getGridApi().getAgGridRowModelType() !== 'clientSide' &&
124
+ StringExtensions_1.default.IsNotNullOrEmpty(calculatedColumn.Query.AggregatedScalarExpression)) {
125
+ return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
126
+ }
127
+ return this.getAdaptableApi()
128
+ .internalApi.getAdaptableInstance()
129
+ .CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
130
+ };
131
+ const newColDef = {
132
+ headerName: calculatedColumn.FriendlyName
133
+ ? calculatedColumn.FriendlyName
134
+ : calculatedColumn.ColumnId,
135
+ colId: calculatedColumn.ColumnId,
136
+ hide: true,
137
+ editable: false,
138
+ width: calculatedColumnSettings.Width,
139
+ enableValue: calculatedColumnSettings.Aggregatable,
140
+ filter: calculatedColumnSettings.Filterable,
141
+ floatingFilter: calculatedColumnSettings.Filterable,
142
+ resizable: calculatedColumnSettings.Resizable,
143
+ enableRowGroup: calculatedColumnSettings.Groupable,
144
+ sortable: calculatedColumnSettings.Sortable,
145
+ enablePivot: calculatedColumnSettings.Pivotable,
146
+ suppressMenu: calculatedColumnSettings.SuppressMenu,
147
+ suppressMovable: calculatedColumnSettings.SuppressMovable,
148
+ type: columnTypes,
149
+ valueGetter,
150
+ };
151
+ if (calculatedColumnSettings.ShowToolTip != null &&
152
+ calculatedColumnSettings.ShowToolTip == true) {
153
+ newColDef.tooltipValueGetter = () => {
154
+ return this.getAdaptableApi().internalApi.getAdaptableQueryExpressionText(calculatedColumn.Query);
155
+ };
156
+ }
157
+ if (calculatedColumnSettings.HeaderToolTip) {
158
+ newColDef.headerTooltip = calculatedColumnSettings.HeaderToolTip;
159
+ }
160
+ this.getAdaptableApi().logInfo('Setting up Calculated Column: ' + calculatedColumn.ColumnId);
161
+ return newColDef;
162
+ });
163
+ }
93
164
  }
94
165
  exports.CalculatedColumnInternalApi = CalculatedColumnInternalApi;
@@ -56,4 +56,5 @@ export declare class ColumnFilterInternalApi extends ApiBase {
56
56
  */
57
57
  areColumnFiltersDifferent(oldFilters: ColumnFilter[], newFilters: ColumnFilter[]): boolean;
58
58
  getPredicateDefShortcuts(predicateDef: AdaptablePredicateDef): string[];
59
+ getFilterValuesMaxNumberOfItems(column: AdaptableColumn): number | undefined;
59
60
  }
@@ -175,7 +175,7 @@ class ColumnFilterInternalApi extends ApiBase_1.ApiBase {
175
175
  * Fires Column Filter Applied Event - typically used to enable filtering on the server
176
176
  */
177
177
  fireColumnFilterAppliedEvent() {
178
- if (this.adaptable.isLive) {
178
+ if (this.adaptable.isReady) {
179
179
  const adaptableApi = this.getAdaptableApi();
180
180
  const columnFilterAppliedInfo = {
181
181
  columnFilters: this.getColumnFilterApi().getColumnFilters(),
@@ -206,5 +206,15 @@ class ColumnFilterInternalApi extends ApiBase_1.ApiBase {
206
206
  }
207
207
  return predicateShortcuts;
208
208
  }
209
+ getFilterValuesMaxNumberOfItems(column) {
210
+ const maxFilterValues = this.getColumnFilterOptions().valuesFilterOptions.maxFilterValuesToDisplay;
211
+ if (typeof maxFilterValues === 'function') {
212
+ const columnFilterContext = Object.assign(Object.assign({}, this.getAdaptableApi().internalApi.buildBaseContext()), { column: column });
213
+ return maxFilterValues(columnFilterContext);
214
+ }
215
+ else {
216
+ return maxFilterValues;
217
+ }
218
+ }
209
219
  }
210
220
  exports.ColumnFilterInternalApi = ColumnFilterInternalApi;
@@ -1,5 +1,7 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
- import { Column } from '@ag-grid-community/core';
2
+ import { Column, IRowNode } from '@ag-grid-community/core';
3
+ import { CustomSort } from '../../PredefinedConfig/CustomSortState';
4
+ import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
3
5
  export declare class ColumnInternalApi extends ApiBase {
4
6
  /**
5
7
  * Retrieves 'ColumnType' property for a given Column
@@ -24,4 +26,5 @@ export declare class ColumnInternalApi extends ApiBase {
24
26
  */
25
27
  getAgGridColumnForAdaptableColumn(columnId: string): Column;
26
28
  isActionRowButtonColumn(columnId: string): boolean;
29
+ getActiveColumnComparator(columnId: string, customSort?: CustomSort, customSortComparer?: ColumnValuesComparer): (valueA: any, valueB: any, nodeA?: IRowNode, nodeB?: IRowNode, isInverted?: boolean) => number | undefined;
27
30
  }
@@ -42,5 +42,17 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
42
42
  isActionRowButtonColumn(columnId) {
43
43
  return columnId === GeneralConstants_1.ADAPTABLE_ROW_ACTION_BUTTONS;
44
44
  }
45
+ getActiveColumnComparator(columnId, customSort, customSortComparer) {
46
+ if ((!customSort || (customSort === null || customSort === void 0 ? void 0 : customSort.IsSuspended)) && !customSortComparer) {
47
+ // defaults to AG-Grid column definition comparator if no CustomSort is defined&active
48
+ const colDefComparator = this.adaptable.agGridColumnAdapter.getUserColDefProperty(columnId, 'comparator');
49
+ return colDefComparator;
50
+ }
51
+ // CustomSort Comparer function takes precedence over CustomSort SortedValues
52
+ const comparerFunction = customSortComparer
53
+ ? customSortComparer.comparer
54
+ : this.getCustomSortApi().internalApi.getDefaultCustomSortComparer(customSort.ColumnId, customSort.SortedValues);
55
+ return comparerFunction;
56
+ }
45
57
  }
46
58
  exports.ColumnInternalApi = ColumnInternalApi;
@@ -1,6 +1,7 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
- import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
3
2
  import { ColumnValuesComparer } from '../../AdaptableOptions/CustomSortOptions';
3
+ import { AdaptableComparerFunction } from '../../PredefinedConfig/Common/AdaptableComparerFunction';
4
4
  export declare class CustomSortInternalApi extends ApiBase {
5
- getCustomSortComparer(column: AdaptableColumn): ColumnValuesComparer | undefined;
5
+ getCustomSortComparer(columnId: string): ColumnValuesComparer | undefined;
6
+ getDefaultCustomSortComparer(columnId: string, columnValues: any[]): AdaptableComparerFunction;
6
7
  }
@@ -3,9 +3,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CustomSortInternalApi = void 0;
4
4
  const ApiBase_1 = require("../Implementation/ApiBase");
5
5
  class CustomSortInternalApi extends ApiBase_1.ApiBase {
6
- getCustomSortComparer(column) {
6
+ getCustomSortComparer(columnId) {
7
7
  var _a;
8
+ const column = this.getColumnApi().getColumnWithColumnId(columnId);
8
9
  return (_a = this.getCustomSortOptions().customSortComparers) === null || _a === void 0 ? void 0 : _a.find((csc) => this.adaptable.api.scopeApi.isColumnInScope(column, csc.scope));
9
10
  }
11
+ getDefaultCustomSortComparer(columnId, columnValues) {
12
+ // have to return a function that may not have access to this
13
+ const adaptable = this.adaptable;
14
+ return function compareItemsOfCustomSort(valueA, valueB, nodeA, nodeB) {
15
+ var _a, _b;
16
+ let firstElementValueString = (_a = (nodeA && adaptable.getDisplayValueFromRowNode(nodeA, columnId))) !== null && _a !== void 0 ? _a : valueA;
17
+ let secondElementValueString = (_b = (nodeB && adaptable.getDisplayValueFromRowNode(nodeB, columnId))) !== null && _b !== void 0 ? _b : valueB;
18
+ let indexFirstElement = columnValues.indexOf(firstElementValueString);
19
+ let containsFirstElement = indexFirstElement >= 0;
20
+ let indexSecondElement = columnValues.indexOf(secondElementValueString);
21
+ let containsSecondElement = indexSecondElement >= 0;
22
+ //if none of the element are in the list we jsut return normal compare
23
+ if (!containsFirstElement && !containsSecondElement) {
24
+ if (valueA == valueB) {
25
+ return 0;
26
+ }
27
+ return valueA < valueB ? -1 : 1;
28
+ }
29
+ //if first item not in the list make sure we put it after the second item
30
+ if (!containsFirstElement) {
31
+ return 1;
32
+ }
33
+ //if second item not in the list make sure we put it after the first item
34
+ if (!containsSecondElement) {
35
+ return -1;
36
+ }
37
+ //return the comparison from the list if the two items are in the list
38
+ return indexFirstElement - indexSecondElement;
39
+ };
40
+ }
10
41
  }
11
42
  exports.CustomSortInternalApi = CustomSortInternalApi;
@@ -8,7 +8,7 @@ class DataSetInternalApi extends ApiBase_1.ApiBase {
8
8
  * @param dataSet Data Set which has been selected
9
9
  */
10
10
  fireDataSetSelectedEvent(dataSet) {
11
- if (this.adaptable.isLive) {
11
+ if (this.adaptable.isReady) {
12
12
  const dataSetSelectedInfo = {
13
13
  adaptableApi: this.adaptable.api,
14
14
  dataSet,
@@ -1,6 +1,7 @@
1
1
  import { ApiBase } from '../Implementation/ApiBase';
2
2
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
3
3
  import { FreeTextColumn } from '../../PredefinedConfig/FreeTextColumnState';
4
+ import { ColDef } from '@ag-grid-community/core';
4
5
  export declare class FreeTextColumnInternalApi extends ApiBase {
5
6
  /**
6
7
  * Checks if a User Edit was in a Free Text Column
@@ -12,4 +13,5 @@ export declare class FreeTextColumnInternalApi extends ApiBase {
12
13
  * @param freeTextColumn FreeTextColumn to be checked
13
14
  */
14
15
  getFreeTextColumnModuleReferences(freeTextColumn: FreeTextColumn): string[];
16
+ getColDefsForFreeTextColumns(): ColDef<any, any>[];
15
17
  }