@adaptabletools/adaptable 11.0.7 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/base.css +19 -11
  2. package/bundle.cjs.js +100 -100
  3. package/index.css +23 -11
  4. package/package.json +2 -2
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
  9. package/src/Api/AlertApi.d.ts +3 -2
  10. package/src/Api/BulkUpdateApi.d.ts +6 -1
  11. package/src/Api/CalculatedColumnApi.d.ts +1 -1
  12. package/src/Api/CellSummaryApi.d.ts +1 -1
  13. package/src/Api/ConditionalStyleApi.d.ts +1 -1
  14. package/src/Api/ConfigApi.d.ts +1 -1
  15. package/src/Api/CustomSortApi.d.ts +1 -1
  16. package/src/Api/DashboardApi.d.ts +1 -1
  17. package/src/Api/DataSourceApi.d.ts +1 -1
  18. package/src/Api/EventApi.d.ts +1 -1
  19. package/src/Api/Events/GridDataChanged.d.ts +5 -1
  20. package/src/Api/ExportApi.d.ts +7 -2
  21. package/src/Api/FormatColumnApi.d.ts +1 -1
  22. package/src/Api/FreeTextColumnApi.d.ts +1 -1
  23. package/src/Api/GridApi.d.ts +24 -3
  24. package/src/Api/Implementation/AlertApiImpl.d.ts +4 -1
  25. package/src/Api/Implementation/AlertApiImpl.js +79 -52
  26. package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
  27. package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
  28. package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
  29. package/src/Api/Implementation/ConfigApiImpl.js +7 -2
  30. package/src/Api/Implementation/ExportApiImpl.d.ts +2 -1
  31. package/src/Api/Implementation/ExportApiImpl.js +14 -1
  32. package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
  33. package/src/Api/Implementation/GridApiImpl.js +24 -3
  34. package/src/Api/Implementation/InternalApiImpl.d.ts +9 -2
  35. package/src/Api/Implementation/InternalApiImpl.js +37 -1
  36. package/src/Api/Implementation/LayoutApiImpl.d.ts +6 -0
  37. package/src/Api/Implementation/LayoutApiImpl.js +48 -0
  38. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  39. package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
  40. package/src/Api/InternalApi.d.ts +9 -2
  41. package/src/Api/LayoutApi.d.ts +38 -1
  42. package/src/Api/PlusMinusApi.d.ts +1 -1
  43. package/src/Api/QueryApi.d.ts +1 -1
  44. package/src/Api/QuickSearchApi.d.ts +1 -1
  45. package/src/Api/ScheduleApi.d.ts +1 -1
  46. package/src/Api/ShortcutApi.d.ts +1 -1
  47. package/src/Api/SmartEditApi.d.ts +1 -1
  48. package/src/Api/TeamSharingApi.d.ts +1 -1
  49. package/src/Api/ThemeApi.d.ts +1 -1
  50. package/src/PredefinedConfig/AlertState.d.ts +7 -3
  51. package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
  52. package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
  53. package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
  54. package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
  55. package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
  56. package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
  57. package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
  58. package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
  59. package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
  60. package/src/PredefinedConfig/ConfigState.d.ts +4 -1
  61. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  62. package/src/PredefinedConfig/PopupState.d.ts +2 -1
  63. package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
  64. package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
  65. package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
  66. package/src/Redux/ActionsReducers/SystemRedux.d.ts +11 -0
  67. package/src/Redux/ActionsReducers/SystemRedux.js +32 -1
  68. package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
  69. package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
  70. package/src/Redux/Store/AdaptableStore.js +69 -27
  71. package/src/Strategy/AlertModule.d.ts +5 -3
  72. package/src/Strategy/AlertModule.js +60 -16
  73. package/src/Strategy/BulkUpdateModule.js +5 -0
  74. package/src/Strategy/ExportModule.js +1 -0
  75. package/src/Strategy/SmartEditModule.js +6 -0
  76. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
  77. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
  78. package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
  79. package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
  80. package/src/Utilities/ObjectFactory.d.ts +8 -6
  81. package/src/Utilities/ObjectFactory.js +26 -12
  82. package/src/Utilities/Services/LicenseService.js +1 -1
  83. package/src/Utilities/Services/ModuleService.js +1 -1
  84. package/src/Utilities/Services/ValidationService.js +1 -0
  85. package/src/View/AdaptableView.js +2 -0
  86. package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
  87. package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
  88. package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
  89. package/src/View/Alert/Wizard/AlertWizard.js +83 -1
  90. package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
  91. package/src/View/Components/FilterForm/FilterForm.js +2 -2
  92. package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
  93. package/src/View/Components/Panels/PanelFooter.js +14 -0
  94. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
  95. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
  96. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
  97. package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
  98. package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
  99. package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
  100. package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
  101. package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
  102. package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
  103. package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
  104. package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
  105. package/src/View/Layout/LayoutPopup.js +3 -24
  106. package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
  107. package/src/View/Layout/LayoutViewPanel.js +5 -18
  108. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
  109. package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
  110. package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
  111. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
  112. package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
  113. package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
  114. package/src/agGrid/Adaptable.d.ts +4 -2
  115. package/src/agGrid/Adaptable.js +65 -69
  116. package/src/agGrid/PercentBarRenderer.js +2 -1
  117. package/src/agGrid/agGridHelper.d.ts +1 -1
  118. package/src/agGrid/agGridHelper.js +23 -8
  119. package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
  120. package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
  121. package/src/components/Dialog/index.js +1 -1
  122. package/src/components/Modal/index.js +1 -1
  123. package/src/components/WindowModal/WindowModal.d.ts +10 -8
  124. package/src/components/WindowModal/WindowModal.js +4 -2
  125. package/src/components/WindowModal/useStacking.d.ts +9 -0
  126. package/src/components/WindowModal/useStacking.js +45 -0
  127. package/src/env.js +3 -3
  128. package/src/metamodel/adaptable.metamodel.d.ts +51 -11
  129. package/src/metamodel/adaptable.metamodel.js +183 -40
  130. package/src/types.d.ts +3 -2
  131. package/version.d.ts +1 -1
  132. package/version.js +1 -1
@@ -45,7 +45,7 @@ export declare class ConfigApiImpl extends ApiBase implements ConfigApi {
45
45
  getDescriptionForModule(module: AdaptableModule): string;
46
46
  getHelpPageForModule(module: AdaptableModule): string;
47
47
  getUserStateByStateKey(stateKey: AdaptableStateKey, returnJson?: boolean): ConfigState | string;
48
- incrementUerStateRevision(stateKey: AdaptableStateKey): void;
48
+ incrementUserStateRevision(stateKey: AdaptableStateKey): void;
49
49
  getAlertState(returnJson?: boolean): AlertState;
50
50
  getApplicationState(returnJson?: boolean): ApplicationState;
51
51
  getCalculatedColumnState(returnJson?: boolean): CalculatedColumnState;
@@ -242,9 +242,14 @@ class ConfigApiImpl extends ApiBase_1.ApiBase {
242
242
  : this.getAdaptableState().ToolPanel;
243
243
  }
244
244
  }
245
- incrementUerStateRevision(stateKey) {
245
+ incrementUserStateRevision(stateKey) {
246
246
  let state = this.getUserStateByStateKey(stateKey);
247
- state.Revision += 1;
247
+ if (typeof state.Revision === 'number') {
248
+ state.Revision += 1;
249
+ }
250
+ else {
251
+ state.Revision.Key += 1;
252
+ }
248
253
  // need to save it...
249
254
  }
250
255
  getAlertState(returnJson = false) {
@@ -27,5 +27,6 @@ export declare class ExportApiImpl extends ApiBase implements ExportApi {
27
27
  editReports(reports: Report[]): Report[];
28
28
  isDataChangeInReport(dataChangedInfo: DataChangedInfo, report: Report): boolean;
29
29
  exportVisualDataToExcel(): void;
30
- runCustomReport(customReportName: string): ReportData;
30
+ runCustomReport(customReportName: string): ReportData | undefined;
31
+ getReportDataForReport(reportName: string): ReportData | undefined;
31
32
  }
@@ -6,6 +6,7 @@ const ExportRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/Ex
6
6
  const ApiBase_1 = require("./ApiBase");
7
7
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
8
8
  const Enums_1 = require("../../PredefinedConfig/Common/Enums");
9
+ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
9
10
  class ExportApiImpl extends ApiBase_1.ApiBase {
10
11
  getExportState() {
11
12
  return this.getAdaptableState().Export;
@@ -162,7 +163,19 @@ class ExportApiImpl extends ApiBase_1.ApiBase {
162
163
  runCustomReport(customReportName) {
163
164
  var _a;
164
165
  const customReport = (_a = this.getExportOptions().customReports) === null || _a === void 0 ? void 0 : _a.find((cr) => cr.name == customReportName);
165
- return customReport ? customReport.onRunReport() : undefined;
166
+ if (!customReport) {
167
+ LoggingHelper_1.LogAdaptableWarning(`Custom Report '${customReportName}' not found!`);
168
+ return undefined;
169
+ }
170
+ return customReport.onRunReport();
171
+ }
172
+ getReportDataForReport(reportName) {
173
+ const report = this.getReportByName(reportName);
174
+ if (!report) {
175
+ LoggingHelper_1.LogAdaptableWarning(`Report '${reportName}' not found!`);
176
+ return undefined;
177
+ }
178
+ return this.adaptable.api.internalApi.getReportService().getReportData(report);
166
179
  }
167
180
  }
168
181
  exports.ExportApiImpl = ExportApiImpl;
@@ -6,11 +6,14 @@ import { SelectedRowInfo } from '../../PredefinedConfig/Selection/SelectedRowInf
6
6
  import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
7
7
  import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
8
8
  import { DataUpdateConfig } from '../../PredefinedConfig/Common/DataUpdateConfig';
9
- import { DataChangedInfo, AccessLevel, AdaptableModule } from '../../types';
10
9
  import { CellHighlightInfo } from '../../PredefinedConfig/Common/CellHighlightInfo';
11
10
  import { RowHighlightInfo } from '../../PredefinedConfig/Common/RowHighlightInfo';
12
11
  import { GridOptions, RowNode } from '@ag-grid-community/all-modules';
13
12
  import { GridCellRange } from '../../PredefinedConfig/Selection/GridCellRange';
13
+ import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
14
+ import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
15
+ import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
16
+ import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
14
17
  export declare class GridApiImpl extends ApiBase implements GridApi {
15
18
  getGridState(): GridState;
16
19
  setGridData(dataSource: any): void;
@@ -64,6 +67,7 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
64
67
  getRowNodesForPrimaryKeys(primaryKeyValues: any[]): RowNode[];
65
68
  getRowNodeForPrimaryKey(primaryKeyValue: any): RowNode;
66
69
  getPrimaryKeyValueForRowNode(rowNode: RowNode): any;
70
+ getPrimaryKeyValuesForRowNodes(rowNodes: RowNode[]): any[];
67
71
  setRowGroupColumns(columnIds: string[]): void;
68
72
  clearRowGroupColumns(): void;
69
73
  expandAllRowGroups(): void;
@@ -87,14 +91,18 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
87
91
  unHighlightCell(primaryKeyValue: CellHighlightInfo['primaryKeyValue'], columnId: CellHighlightInfo['columnId']): void;
88
92
  unHighlightAllCells(): void;
89
93
  highlightRow(rowHighlightInfo: RowHighlightInfo): void;
94
+ highlightRows(rowHighlightInfos: RowsHighlightInfo): void;
90
95
  unHighlightRow(primaryKeyValue: RowHighlightInfo['primaryKeyValue']): void;
96
+ unHighlightRows(primaryKeyValues: RowsHighlightInfo['primaryKeyValues']): void;
91
97
  unHighlightAllRows(): void;
92
98
  refreshCells(rowNodes: RowNode[], columnIds: string[]): void;
93
99
  refreshRowByPrimaryKey(primaryKey: any): void;
94
100
  refreshRowNode(rowNode: RowNode): void;
101
+ refreshRowNodes(rowNodes: RowNode[]): void;
95
102
  areCellsEditable(gridCells: GridCell[]): boolean;
96
103
  getRowCount(): number;
97
104
  getVisibleRowCount(): number;
105
+ getRowsInViewport(): RowNode[];
98
106
  getColumnCount(): number;
99
107
  getVisibleColumnCount(): number;
100
108
  getEntitlementAccessLevelForModule(adaptableModule: AdaptableModule): AccessLevel;
@@ -220,6 +220,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
220
220
  getPrimaryKeyValueForRowNode(rowNode) {
221
221
  return this.adaptable.getPrimaryKeyValueFromRowNode(rowNode);
222
222
  }
223
+ getPrimaryKeyValuesForRowNodes(rowNodes) {
224
+ return rowNodes.map((rowNode) => this.getPrimaryKeyValueForRowNode(rowNode));
225
+ }
223
226
  setRowGroupColumns(columnIds) {
224
227
  this.adaptable.setRowGroupColumns(columnIds);
225
228
  }
@@ -282,12 +285,13 @@ class GridApiImpl extends ApiBase_1.ApiBase {
282
285
  this.adaptable.api.eventApi.emit('CellChanged', cellChangedInfo);
283
286
  }
284
287
  }
285
- fireGridDataChangedEvent(dataRows, rowNodes, rowTrigger) {
288
+ fireGridDataChangedEvent(dataRows, rowNodes = [], rowTrigger) {
286
289
  if (this.adaptable.isInitialised) {
287
290
  const gridDataChangedInfo = {
291
+ changedAt: Date.now(),
288
292
  adaptableApi: this.adaptable.api,
289
- rowTrigger: rowTrigger,
290
- dataRows: dataRows,
293
+ rowTrigger,
294
+ dataRows,
291
295
  rowNodes,
292
296
  };
293
297
  this.adaptable.api.eventApi.emit('GridDataChanged', gridDataChangedInfo);
@@ -326,9 +330,20 @@ class GridApiImpl extends ApiBase_1.ApiBase {
326
330
  }, rowHighlightInfo.timeout);
327
331
  }
328
332
  }
333
+ highlightRows(rowHighlightInfos) {
334
+ this.dispatchAction(SystemRedux_1.SystemHighlightRowsAdd(rowHighlightInfos));
335
+ if (rowHighlightInfos.timeout) {
336
+ setTimeout(() => {
337
+ this.unHighlightRows(rowHighlightInfos.primaryKeyValues);
338
+ }, rowHighlightInfos.timeout);
339
+ }
340
+ }
329
341
  unHighlightRow(primaryKeyValue) {
330
342
  this.dispatchAction(SystemRedux_1.SystemHighlightRowDelete(primaryKeyValue));
331
343
  }
344
+ unHighlightRows(primaryKeyValues) {
345
+ this.dispatchAction(SystemRedux_1.SystemHighlightRowsDelete(primaryKeyValues));
346
+ }
332
347
  unHighlightAllRows() {
333
348
  this.dispatchAction(SystemRedux_1.SystemHighlightRowDeleteAll());
334
349
  }
@@ -342,6 +357,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
342
357
  refreshRowNode(rowNode) {
343
358
  this.adaptable.redrawRow(rowNode);
344
359
  }
360
+ refreshRowNodes(rowNodes) {
361
+ this.adaptable.redrawRows(rowNodes);
362
+ }
345
363
  areCellsEditable(gridCells) {
346
364
  for (let gridCell of gridCells) {
347
365
  if (!gridCell.column) {
@@ -364,6 +382,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
364
382
  getVisibleRowCount() {
365
383
  return this.adaptable.getVisibleRowCount();
366
384
  }
385
+ getRowsInViewport() {
386
+ return this.adaptable.getRowsInViewport();
387
+ }
367
388
  getColumnCount() {
368
389
  return this.adaptable.getColumnCount();
369
390
  }
@@ -11,7 +11,7 @@ import { SelectedRowInfo } from '../../PredefinedConfig/Selection/SelectedRowInf
11
11
  import { AdaptableModule, AdaptableQLModule } from '../../PredefinedConfig/Common/Types';
12
12
  import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
13
13
  import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
14
- import { AdaptableOptions, AdaptableState, AlertButtonContext, Layout, SystemStatusMessageInfo } from '../../types';
14
+ import { AdaptableCellChangedAlert, AdaptableOptions, AdaptableRowChangedAlert, AdaptableState, AlertButtonContext, Layout, SystemStatusMessageInfo } from '../../types';
15
15
  import { IValidationService } from '../../Utilities/Services/Interface/IValidationService';
16
16
  import { IModuleService } from '../../Utilities/Services/Interface/IModuleService';
17
17
  import { IReportService } from '../../Utilities/Services/Interface/IReportService';
@@ -23,12 +23,13 @@ import { IEntitlementService } from '../../Utilities/Services/Interface/IEntitle
23
23
  import { IQueryLanguageService } from '../../Utilities/Services/Interface/IQueryLanguageService';
24
24
  import { IAlertService } from '../../Utilities/Services/Interface/IAlertService';
25
25
  import { AdaptableFlashingCell } from '../../PredefinedConfig/Common/AdaptableFlashingCell';
26
+ import { RowNode } from '@ag-grid-community/all-modules';
26
27
  import { ITeamSharingService } from '../../Utilities/Services/Interface/ITeamSharingService';
27
28
  import { ColumnValuesComparer } from '../../AdaptableOptions/GeneralOptions';
28
29
  import { ButtonStyle } from '../../PredefinedConfig/Common/ButtonStyle';
29
30
  import { AdaptableButton, ButtonContext } from '../../PredefinedConfig/Common/AdaptableButton';
30
31
  import { AdaptableForm } from '../../PredefinedConfig/Common/AdaptableForm';
31
- import { AlertButtonForm } from '../../PredefinedConfig/AlertState';
32
+ import { AlertButtonForm, AlertDefinition } from '../../PredefinedConfig/AlertState';
32
33
  import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
33
34
  import { AdaptableFrameworkComponent } from '../../AdaptableOptions/AdaptableFrameworkComponent';
34
35
  import { IMetamodelService } from '../../Utilities/Services/Interface/IMetamodelService';
@@ -40,6 +41,12 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
40
41
  })[];
41
42
  }) | undefined;
42
43
  getAdaptableAlerts(): AdaptableAlert[];
44
+ getAdaptableCellChangedAlerts(): AdaptableCellChangedAlert[];
45
+ getAdaptableRowChangedAlerts(): AdaptableRowChangedAlert[];
46
+ getAdaptableAlertWithHighlightCell(columnId: string, rowNode: RowNode): AdaptableAlert | undefined;
47
+ getAdaptableAlertWithHighlightRow(rowNode: RowNode): AdaptableAlert | undefined;
48
+ isAlertDefinitionForAddedRowChangeEvent(alertDefinition: AlertDefinition): boolean;
49
+ isAlertDefinitionForRemovedRowChangeEvent(alertDefinition: AlertDefinition): boolean;
43
50
  getAdaptableFlashingCellFor(primaryKey: string, columnId?: string): AdaptableFlashingCell | null;
44
51
  addSystemStatusMessageInfo(systemStatusMessageInfo: SystemStatusMessageInfo): void;
45
52
  getSystemStatusMessageInfos(): SystemStatusMessageInfo[];
@@ -14,6 +14,7 @@ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Exte
14
14
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
15
15
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
16
16
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
17
+ const AdaptableAlert_1 = require("../../PredefinedConfig/Common/AdaptableAlert");
17
18
  const waitForCondition_1 = require("../../Utilities/waitForCondition");
18
19
  class InternalApiImpl extends ApiBase_1.ApiBase {
19
20
  getSystemState() {
@@ -60,7 +61,42 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
60
61
  return adaptableAlertForm;
61
62
  }
62
63
  getAdaptableAlerts() {
63
- return this.getSystemState().AdaptableAlerts;
64
+ var _a;
65
+ return (_a = this.getSystemState().AdaptableAlerts) !== null && _a !== void 0 ? _a : [];
66
+ }
67
+ getAdaptableCellChangedAlerts() {
68
+ return this.getAdaptableAlerts().filter(AdaptableAlert_1.isAdaptableCellChangedAlert);
69
+ }
70
+ getAdaptableRowChangedAlerts() {
71
+ return this.getAdaptableAlerts().filter(AdaptableAlert_1.isAdaptableRowChangedAlert);
72
+ }
73
+ getAdaptableAlertWithHighlightCell(columnId, rowNode) {
74
+ // only alerts triggered by cell changes are relevant for HighlightCell actions
75
+ return this.getAdaptableCellChangedAlerts().find((alert) => {
76
+ var _a, _b, _c, _d;
77
+ return ((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
78
+ ((_c = (_b = alert.dataChangedInfo) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c.columnId) === columnId &&
79
+ ((_d = alert.dataChangedInfo) === null || _d === void 0 ? void 0 : _d.rowNode) === rowNode;
80
+ });
81
+ }
82
+ getAdaptableAlertWithHighlightRow(rowNode) {
83
+ // only alerts triggered by row changes are relevant for HighlightRow actions
84
+ return this.getAdaptableRowChangedAlerts().find((alert) => {
85
+ var _a;
86
+ if (((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightRow) && alert.gridDataChangedInfo) {
87
+ return alert.gridDataChangedInfo.rowNodes.map((rowNode) => rowNode.id).includes(rowNode.id);
88
+ }
89
+ });
90
+ }
91
+ isAlertDefinitionForAddedRowChangeEvent(alertDefinition) {
92
+ var _a, _b;
93
+ const addedRowPredicate = 'AddedRow';
94
+ return ((_b = (_a = alertDefinition === null || alertDefinition === void 0 ? void 0 : alertDefinition.Rule) === null || _a === void 0 ? void 0 : _a.Predicate) === null || _b === void 0 ? void 0 : _b.PredicateId) === addedRowPredicate;
95
+ }
96
+ isAlertDefinitionForRemovedRowChangeEvent(alertDefinition) {
97
+ var _a, _b;
98
+ const removedRowPredicate = 'RemovedRow';
99
+ return ((_b = (_a = alertDefinition === null || alertDefinition === void 0 ? void 0 : alertDefinition.Rule) === null || _a === void 0 ? void 0 : _a.Predicate) === null || _b === void 0 ? void 0 : _b.PredicateId) === removedRowPredicate;
64
100
  }
65
101
  getAdaptableFlashingCellFor(primaryKey, columnId) {
66
102
  var _a;
@@ -32,5 +32,11 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
32
32
  createDefaultLayoutIfNeeded(): Layout | null;
33
33
  showChangeColumnCaption(column: AdaptableColumn): void;
34
34
  showLayoutPopup(): void;
35
+ showLayoutEditor(layoutName?: string, action?: string): void;
35
36
  isCurrentLayoutReadOnly(): boolean;
37
+ deleteLayout(layout: Layout): void;
38
+ deleteLayoutByName(layoutName: string): void;
39
+ isDefaultLayout(layout: Layout): boolean;
40
+ isCurrentLayoutDefault(): boolean;
41
+ areExpandedRowGroupsSavedInLayouts(): boolean;
36
42
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const LayoutRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/LayoutRedux"));
6
6
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
7
7
  const ApiBase_1 = require("./ApiBase");
8
+ const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
8
9
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
9
10
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
10
11
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
@@ -16,6 +17,7 @@ const Enums_1 = require("../../PredefinedConfig/Common/Enums");
16
17
  const ArrayExtensions_1 = require("../../Utilities/Extensions/ArrayExtensions");
17
18
  const PopupRedux_1 = require("../../Redux/ActionsReducers/PopupRedux");
18
19
  const LayoutRedux_1 = require("../../Redux/ActionsReducers/LayoutRedux");
20
+ const windowFactory_1 = require("../../View/Components/Popups/WindowPopups/windowFactory");
19
21
  class LayoutApiImpl extends ApiBase_1.ApiBase {
20
22
  constructor() {
21
23
  super(...arguments);
@@ -248,6 +250,22 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
248
250
  showLayoutPopup() {
249
251
  this.showModulePopup(ModuleConstants.LayoutModuleId);
250
252
  }
253
+ showLayoutEditor(layoutName, action = 'Edit') {
254
+ const layout = layoutName ? this.getLayoutByName(layoutName) : this.getCurrentLayout();
255
+ let preparedAction = action;
256
+ if (!['Edit', 'New', 'Clone'].includes(action)) {
257
+ preparedAction = 'Edit';
258
+ LoggingHelper_1.LogAdaptableError(`When opening the layout editor the action must be one of: New, Clone, Edit; given: ${action}`);
259
+ }
260
+ this.dispatchAction(PopupRedux.PopupShowWindow({
261
+ Id: windowFactory_1.WINDOW_LAYOUT_EDITOR,
262
+ Title: `Edit Layout: ${layout.Name}`,
263
+ PopupProps: {
264
+ action: preparedAction,
265
+ layout,
266
+ },
267
+ }));
268
+ }
251
269
  isCurrentLayoutReadOnly() {
252
270
  const currentLayout = this.getCurrentLayout();
253
271
  if (currentLayout) {
@@ -255,5 +273,35 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
255
273
  }
256
274
  return true;
257
275
  }
276
+ deleteLayout(layout) {
277
+ if (layout.Name === GeneralConstants_1.DEFAULT_LAYOUT) {
278
+ LoggingHelper_1.LogAdaptableWarning('The Default Layout cannot be deleted');
279
+ return;
280
+ }
281
+ const layoutCount = this.getAllLayout().length;
282
+ if (layoutCount === 1) {
283
+ LoggingHelper_1.LogAdaptableWarning('You cannot delete the only Layout. AdapTable always requires one layout');
284
+ return;
285
+ }
286
+ this.dispatchAction(LayoutRedux.LayoutDelete(layout));
287
+ }
288
+ deleteLayoutByName(layoutName) {
289
+ const layout = this.getLayoutByName(layoutName);
290
+ if (!layout) {
291
+ LoggingHelper_1.LogAdaptableWarning('No Layout exists with that name');
292
+ return;
293
+ }
294
+ return this.deleteLayout(layout);
295
+ }
296
+ isDefaultLayout(layout) {
297
+ return layout.Name === GeneralConstants_1.DEFAULT_LAYOUT;
298
+ }
299
+ isCurrentLayoutDefault() {
300
+ return this.isDefaultLayout(this.getCurrentLayout());
301
+ }
302
+ areExpandedRowGroupsSavedInLayouts() {
303
+ return (this.getLayoutOptions().includeExpandedRowGroups ||
304
+ this.getLayoutOptions().displayRowGroups === 'dynamic');
305
+ }
258
306
  }
259
307
  exports.LayoutApiImpl = LayoutApiImpl;
@@ -167,6 +167,7 @@ class ScheduleApiImpl extends ApiBase_1.ApiBase {
167
167
  const reminderSchedule = schedule;
168
168
  // const reminder: Reminder = reminderSchedule.Reminder;
169
169
  const alert = {
170
+ alertType: 'generic',
170
171
  header: reminderSchedule.Header,
171
172
  message: reminderSchedule.Message,
172
173
  alertDefinition: {
@@ -4,9 +4,15 @@ exports.SettingsPanelApiImpl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
7
+ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
7
8
  class SettingsPanelApiImpl extends ApiBase_1.ApiBase {
8
9
  showSettingsPanel(moduleName) {
9
- this.dispatchAction(PopupRedux.PopupShowScreen(moduleName));
10
+ const moduleInfo = this.adaptable.ModuleService.getModuleInfoByModule(moduleName);
11
+ if (!moduleInfo) {
12
+ LoggingHelper_1.LogAdaptableError(`${moduleName} module does not exist`);
13
+ return;
14
+ }
15
+ this.dispatchAction(PopupRedux.PopupShowScreen(moduleName, moduleInfo.Popup));
10
16
  }
11
17
  showCustomSettingsPanel(name) {
12
18
  this.dispatchAction(PopupRedux.PopupShowScreen(null, name));
@@ -15,9 +15,9 @@ import { IReportService } from '../Utilities/Services/Interface/IReportService';
15
15
  import { ICalculatedColumnExpressionService } from '../Utilities/Services/Interface/ICalculatedColumnExpressionService';
16
16
  import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
17
17
  import { Layout } from '../PredefinedConfig/LayoutState';
18
- import { AdaptableAlert } from '../PredefinedConfig/Common/AdaptableAlert';
18
+ import { AdaptableAlert, AdaptableCellChangedAlert, AdaptableRowChangedAlert } from '../PredefinedConfig/Common/AdaptableAlert';
19
19
  import { IDataService } from '../Utilities/Services/Interface/IDataService';
20
- import { AdaptableMessageType, DataChangedInfo, SystemStatusMessageInfo } from '../types';
20
+ import { AdaptableMessageType, AlertDefinition, DataChangedInfo, SystemStatusMessageInfo } from '../types';
21
21
  import { IEntitlementService } from '../Utilities/Services/Interface/IEntitlementService';
22
22
  import { AdaptableFlashingCell } from '../PredefinedConfig/Common/AdaptableFlashingCell';
23
23
  import { IQueryLanguageService } from '../Utilities/Services/Interface/IQueryLanguageService';
@@ -31,6 +31,7 @@ import { AdaptableForm } from '../PredefinedConfig/Common/AdaptableForm';
31
31
  import { AlertButtonForm } from '../PredefinedConfig/AlertState';
32
32
  import { AdaptableFrameworkComponent } from '../AdaptableOptions/AdaptableFrameworkComponent';
33
33
  import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelService';
34
+ import { RowNode } from '@ag-grid-community/all-modules';
34
35
  /**
35
36
  * This set of api methods is designed for **internal use of Adaptable** only.
36
37
  *
@@ -44,6 +45,12 @@ export interface InternalApi {
44
45
  })[];
45
46
  };
46
47
  getAdaptableAlerts(): AdaptableAlert[];
48
+ getAdaptableCellChangedAlerts(): AdaptableCellChangedAlert[];
49
+ getAdaptableRowChangedAlerts(): AdaptableRowChangedAlert[];
50
+ getAdaptableAlertWithHighlightCell(columnId: string, rowNode: RowNode): AdaptableAlert | undefined;
51
+ getAdaptableAlertWithHighlightRow(rowNode: RowNode): AdaptableAlert | undefined;
52
+ isAlertDefinitionForAddedRowChangeEvent(alertDefinition: AlertDefinition): boolean;
53
+ isAlertDefinitionForRemovedRowChangeEvent(alertDefinition: AlertDefinition): boolean;
47
54
  showPopupConfirmation(confirmation: UIConfirmation): void;
48
55
  getAdaptableFlashingCellFor(primaryKey: string, columnId?: string): AdaptableFlashingCell | null;
49
56
  addSystemStatusMessageInfo(systemStatusMessageInfo: SystemStatusMessageInfo): void;
@@ -124,15 +124,39 @@ export interface LayoutApi {
124
124
  */
125
125
  createDefaultLayoutIfNeeded(): Layout | null;
126
126
  /**
127
- * Opens Layout popup screen
127
+ * Opens Settings Panel with Layout section selected
128
128
  */
129
129
  showLayoutPopup(): void;
130
+ /**
131
+ * Opens Layout Editor - for Current or a named Layout
132
+ *
133
+ * @param layoutName Name of Layout to be edited or cloned; if not specified, uses Current Layout
134
+ * @param action Whether to edit/clone, or create a new, Layout
135
+ */
136
+ showLayoutEditor(layoutName?: string,
137
+ /**
138
+ * @defaultValue 'Edit'
139
+ */
140
+ action?: 'New' | 'Clone' | 'Edit'): void;
130
141
  /**
131
142
  * Sets a new Caption / Header for a Column (this Layout only)
132
143
  * @param columnId Column to Update
133
144
  * @param caption New Caption to display
134
145
  */
135
146
  setColumnCaption(columnId: string, caption: string): void;
147
+ /**
148
+ * Deletes an existing Layout (if not Default or only existing Layout)
149
+ * @param layout The Layout to delete
150
+ */
151
+ deleteLayout(layout: Layout): void;
152
+ /**
153
+ * Deletes an existing Layout provided by Name (if not Default or only existing Layout)
154
+ * @param layout Name of the Layout to delete
155
+ */
156
+ deleteLayoutByName(layoutName: string): void;
157
+ /**
158
+ * Specifies where Current Layout is editable
159
+ */
136
160
  isCurrentLayoutReadOnly(): boolean;
137
161
  /**
138
162
  * Opens change column caption popup
@@ -140,4 +164,17 @@ export interface LayoutApi {
140
164
  * @param column AdaptableColumn
141
165
  */
142
166
  showChangeColumnCaption(column: AdaptableColumn): void;
167
+ /**
168
+ * Checks if the given Layout is Default Layout
169
+ * @param layout Layout to Check
170
+ */
171
+ isDefaultLayout(layout: Layout): boolean;
172
+ /**
173
+ * Checks if the Current Layout is Default Layout
174
+ */
175
+ isCurrentLayoutDefault(): boolean;
176
+ /**
177
+ * Returns true if Layouts will contain Expanded Row Groups information
178
+ */
179
+ areExpandedRowGroupsSavedInLayouts(): boolean;
143
180
  }
@@ -42,7 +42,7 @@ export interface PlusMinusApi {
42
42
  */
43
43
  applyPlusMinus(cells: GridCell[]): void;
44
44
  /**
45
- * Opens Plus Minus popup screen
45
+ * Opens Settings Panel with Plus Minus section selected and visible
46
46
  */
47
47
  showPlusMinusPopup(): void;
48
48
  /**
@@ -36,7 +36,7 @@ export interface QueryApi {
36
36
  */
37
37
  getNamedQueryModuleReferences(namedQueryName: string): string[];
38
38
  /**
39
- * Opens Query Popup screen
39
+ * Opens Settings Panel with Query section selected and visible
40
40
  */
41
41
  showQueryPopup(): void;
42
42
  /**
@@ -31,7 +31,7 @@ export interface QuickSearchApi {
31
31
  */
32
32
  setQuickSearchStyle(style: AdaptableStyle): void;
33
33
  /**
34
- * Opens Quick Search popup screen
34
+ * Opens Settings Panel with Quick Search section selected and visible
35
35
  */
36
36
  showQuickSearchPopup(): void;
37
37
  }
@@ -247,7 +247,7 @@ export interface ScheduleApi {
247
247
  */
248
248
  applySchedule(schedule: BaseSchedule, scheduleType: 'Report' | 'ipushpull' | 'Glue42' | 'Reminder' | 'OpenFin'): void;
249
249
  /**
250
- * Opens Schedule popup screen
250
+ * Opens Settings Panel with Schedule section selected and visible
251
251
  */
252
252
  showSchedulePopup(): void;
253
253
  }
@@ -56,7 +56,7 @@ export interface ShortcutApi {
56
56
  */
57
57
  unSuspendShortcut(shortcut: Shortcut): Shortcut;
58
58
  /**
59
- * Opens Shortcut popup screen
59
+ * Opens Settings Panel with Shortcut section selected and visible
60
60
  */
61
61
  showShortcutPopup(): void;
62
62
  }
@@ -22,7 +22,7 @@ export interface SmartEditApi {
22
22
  */
23
23
  getSmartEditValue(): number;
24
24
  /**
25
- * Opens Smart Edit popup screen
25
+ * Opens Settings Panel with Smart Edit section selected and visible
26
26
  */
27
27
  showSmartEditPopup(): void;
28
28
  /**
@@ -20,7 +20,7 @@ export interface TeamSharingApi {
20
20
  */
21
21
  hasTeamSharingFullRights(): boolean;
22
22
  /**
23
- * Opens Team Sharing popup screen
23
+ * Opens Settings Panel with Team Sharing section selected and visible
24
24
  */
25
25
  showTeamSharingPopup(): void;
26
26
  /**
@@ -53,7 +53,7 @@ export interface ThemeApi {
53
53
  */
54
54
  getAllTheme(): AdaptableTheme[];
55
55
  /**
56
- * Opens Theme popup screen
56
+ * Opens Settings Panel with Theme section selected and visible
57
57
  */
58
58
  showThemePopup(): void;
59
59
  }
@@ -65,7 +65,7 @@ export declare type AlertRule = XOR<{
65
65
  * Alert Query which may be either a Boolean, Observable or AggregatedBoolean Expression
66
66
  */
67
67
  export declare type AdaptableAlertQuery = XOR<AdaptableBooleanQuery, XOR<AdaptableObservableQuery, AdaptableAggregatedBooleanQuery>>;
68
- export declare type AdaptableAlertAction = 'highlight-cell' | 'jump-to-cell' | 'jump-to-row' | 'jump-to-column' | 'suspend' | 'undo';
68
+ export declare type AdaptableAlertAction = 'highlight-cell' | 'highlight-row' | 'jump-to-cell' | 'jump-to-row' | 'jump-to-column' | 'suspend' | 'undo';
69
69
  /**
70
70
  * Defines a button that appears in an Alert Form
71
71
  */
@@ -105,9 +105,13 @@ export interface AlertProperties {
105
105
  */
106
106
  HighlightRow?: boolean | AdaptableStyle;
107
107
  /**
108
- * Grid will 'jump' to the cell which triggered the Alert
108
+ * Grid will 'jump' to the changed cell which triggered the Alert
109
109
  */
110
110
  JumpToCell?: boolean;
111
+ /**
112
+ * Grid will 'jump' to the newly added row which triggered the Alert
113
+ */
114
+ JumpToRow?: boolean;
111
115
  /**
112
116
  * Shows Alert text in the div specificed in `alertContainer` property of Container Options
113
117
  */
@@ -122,4 +126,4 @@ export interface AlertProperties {
122
126
  */
123
127
  PreventEdit?: boolean;
124
128
  }
125
- export declare type SystemAlertPredicateId = 'Blanks' | 'NonBlanks' | 'Equals' | 'NotEquals' | 'GreaterThan' | 'LessThan' | 'Positive' | 'Negative' | 'Zero' | 'Between' | 'NotBetween' | 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'Today' | 'Yesterday' | 'Tomorrow' | 'ThisWeek' | 'ThisMonth' | 'ThisQuarter' | 'ThisYear' | 'InPast' | 'InFuture' | 'Before' | 'After' | 'On' | 'NotOn' | 'NextWorkDay' | 'LastWorkDay' | 'True' | 'False' | 'PercentChange' | 'PrimaryKeyDuplicate' | 'ExistingValuesOnly' | 'NoDuplicateValues' | 'IsNumeric' | 'Any';
129
+ export declare type SystemAlertPredicateId = 'Blanks' | 'NonBlanks' | 'Equals' | 'NotEquals' | 'GreaterThan' | 'LessThan' | 'Positive' | 'Negative' | 'Zero' | 'Between' | 'NotBetween' | 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'Today' | 'Yesterday' | 'Tomorrow' | 'ThisWeek' | 'ThisMonth' | 'ThisQuarter' | 'ThisYear' | 'InPast' | 'InFuture' | 'Before' | 'After' | 'On' | 'NotOn' | 'NextWorkDay' | 'LastWorkDay' | 'True' | 'False' | 'PercentChange' | 'PrimaryKeyDuplicate' | 'ExistingValuesOnly' | 'NoDuplicateValues' | 'IsNumeric' | 'AddedRow' | 'RemovedRow' | 'Any';
@@ -1,9 +1,40 @@
1
1
  import { AdaptableObject } from './AdaptableObject';
2
- import { AlertDefinition, DataChangedInfo } from '../../types';
2
+ import { DataChangedInfo } from './DataChangedInfo';
3
+ import { GridDataChangedInfo } from '../../Api/Events/GridDataChanged';
4
+ import { AlertDefinition } from '../AlertState';
3
5
  /**
4
6
  * Defines an Alert fired by AdapTable
5
7
  */
6
- export interface AdaptableAlert extends AdaptableObject {
8
+ export declare type AdaptableAlert = AdaptableCellChangedAlert | AdaptableRowChangedAlert | AdaptableGenericAlert;
9
+ export declare type AdaptableAlertType = 'generic' | 'cellChange' | 'rowChange';
10
+ export interface AdaptableGenericAlert extends AdaptableAlertBase<'generic'> {
11
+ }
12
+ /**
13
+ * Defines an Alert fired by AdapTable when a cell is changed
14
+ */
15
+ export interface AdaptableCellChangedAlert extends AdaptableAlertBase<'cellChanged'> {
16
+ /**
17
+ * Cell DataChange which triggered Alert
18
+ */
19
+ dataChangedInfo: DataChangedInfo;
20
+ }
21
+ /**
22
+ * Defines an Alert fired by AdapTable when a row is changed
23
+ */
24
+ export interface AdaptableRowChangedAlert extends AdaptableAlertBase<'rowChanged'> {
25
+ /**
26
+ * Row DataChange which triggered Alert
27
+ */
28
+ gridDataChangedInfo: GridDataChangedInfo;
29
+ }
30
+ /**
31
+ * Defines the base(common) properties of an Alert fired by AdapTable, regardless of the type of change
32
+ */
33
+ export interface AdaptableAlertBase<T> extends AdaptableObject {
34
+ /**
35
+ * The type of Alert
36
+ */
37
+ alertType: T;
7
38
  /**
8
39
  * Alert Header text
9
40
  */
@@ -16,8 +47,6 @@ export interface AdaptableAlert extends AdaptableObject {
16
47
  * Rule that caused Alert to fire
17
48
  */
18
49
  alertDefinition: AlertDefinition;
19
- /**
20
- * DataChange which triggered Alert
21
- */
22
- dataChangedInfo?: DataChangedInfo;
23
50
  }
51
+ export declare const isAdaptableCellChangedAlert: (alert: AdaptableAlert) => alert is AdaptableCellChangedAlert;
52
+ export declare const isAdaptableRowChangedAlert: (alert: AdaptableAlert) => alert is AdaptableRowChangedAlert;