@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
package/index.css CHANGED
@@ -2139,8 +2139,12 @@ template {
2139
2139
  overflow: auto;
2140
2140
  display: grid;
2141
2141
  padding: var(--ab-space-2);
2142
- grid-template-rows: 1fr 1fr;
2143
- grid-template-columns: 28rem 1fr 1fr;
2142
+ flex: 1 1 0;
2143
+ min-height: 0;
2144
+ grid-template-columns: 28rem 1fr;
2145
+ grid-template-rows: repeat(3, 1fr);
2146
+ grid-column-gap: 0px;
2147
+ grid-row-gap: 0px;
2144
2148
  row-gap: var(--ab-space-2);
2145
2149
  column-gap: var(--ab-space-2);
2146
2150
  grid-gap: var(--ab-space-2); }
@@ -2153,21 +2157,16 @@ template {
2153
2157
  overflow: auto; }
2154
2158
 
2155
2159
  .ab-LayoutEditor__ColumnListPanel {
2156
- grid-row: 1 /3;
2157
- grid-column: 1 /1;
2158
- max-height: initial; }
2160
+ grid-area: 1 / 1 / 4 / 2; }
2159
2161
 
2160
2162
  .ab-LayoutEditor__ColumnSortListPanel {
2161
- grid-row: 1 /1;
2162
- grid-column: 2 /2; }
2163
+ grid-area: 1 / 2 / 2 / 3; }
2163
2164
 
2164
2165
  .ab-LayoutEditor__RowGroupsListPanel {
2165
- grid-row: 2 / 2;
2166
- grid-column: 2 /2; }
2166
+ grid-area: 2 / 2 / 3 / 3; }
2167
2167
 
2168
2168
  .ab-LayoutEditor__PivotListPanel {
2169
- grid-row: 2 / 2;
2170
- grid-column: 3 /3; }
2169
+ grid-area: 3 / 2 / 4 / 3; }
2171
2170
 
2172
2171
  .ab-LayoutEditor__PivotList--empty,
2173
2172
  .ab-LayoutEditor__RowGroupsList--empty,
@@ -2274,6 +2273,9 @@ template {
2274
2273
  --ab-cmp-adaptable-popup-panel-title__font-size: var(--ab-font-size-5);
2275
2274
  --ab-cmp-adaptable-popup-panel-body__padding: var(--ab-space-2); }
2276
2275
 
2276
+ :root {
2277
+ --ab-cmp-adaptable-window-popup__box-shadow: var(--ab-cmp-adaptable-popup__box-shadow); }
2278
+
2277
2279
  :root {
2278
2280
  --ab-cmp-adaptable-object-list-tag__margin-right: var(--ab-space-2);
2279
2281
  --ab-cmp-adaptable-object-list-tag__margin-top: var(--ab-space-2);
@@ -3636,6 +3638,16 @@ html.ab--theme-dark .ab-ListBoxFilterForm--aggrid-style {
3636
3638
  .ab-Adaptable-Popup--window.ab-Adaptable-Popup--action-popup .ab-Panel__header {
3637
3639
  cursor: move; }
3638
3640
 
3641
+ .ab-Window-Modal .ab-Panel__header {
3642
+ cursor: move; }
3643
+
3644
+ .ab-Window-Modal {
3645
+ max-height: 100%;
3646
+ box-shadow: var(--ab-cmp-adaptable-window-popup__box-shadow); }
3647
+
3648
+ .ab-Window-Modal .ab-Panel {
3649
+ max-height: initial; }
3650
+
3639
3651
  .ab-Adaptable-Object-List {
3640
3652
  list-style: none;
3641
3653
  padding: 0; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.0.7",
3
+ "version": "11.1.0",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -56,6 +56,6 @@
56
56
  "uuid": "^3.3.2"
57
57
  },
58
58
  "peerDependencies": {
59
- "@ag-grid-community/all-modules": ">=27.0.0"
59
+ "@ag-grid-community/all-modules": ">=27.1.0"
60
60
  }
61
61
  }
@@ -1,2 +1,2 @@
1
- declare const _default: 1647406497522;
1
+ declare const _default: 1648197112850;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1647406497522;
3
+ exports.default = 1648197112850;
@@ -109,6 +109,7 @@ export interface IAdaptable {
109
109
  redrawBody(): void;
110
110
  redrawHeader(): void;
111
111
  redrawRow(rowNode: RowNode): void;
112
+ redrawRows(rowNodes: RowNode[]): void;
112
113
  refreshCells(rowNodes: RowNode[], columns: (string | any)[], forceUpdate: boolean, suppressFlash?: boolean): void;
113
114
  setSelectedCells(): SelectedCellInfo | undefined;
114
115
  setSelectedRows(): SelectedRowInfo | undefined;
@@ -171,6 +172,7 @@ export interface IAdaptable {
171
172
  forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
172
173
  forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
173
174
  getVisibleRowNodes(): RowNode[];
175
+ getRowsInViewport(): RowNode[];
174
176
  isGroupRowNode(rowNode: RowNode): boolean;
175
177
  isVisibleNode(rowNode: RowNode): boolean;
176
178
  selectNodes(rowNodes: RowNode[], clearSelection: boolean): void;
@@ -5,11 +5,15 @@
5
5
  export interface LayoutOptions {
6
6
  /**
7
7
  * Layouts will include details of expanded grouped rows; if true these will be re-applied at start-up
8
- *
8
+ * @deprecated use displayRowGroups instead
9
9
  * @defaultValue false
10
10
  * @gridInfoItem
11
11
  */
12
12
  includeExpandedRowGroups?: boolean;
13
+ /**
14
+ * Whether RowGroups display all as expanded, all as closed or dynamically (i.e. saved in Layout)
15
+ */
16
+ displayRowGroups?: 'dynamic' | 'expanded' | 'closed';
13
17
  /**
14
18
  * Layouts save whenever Grid's column / sort info changes; if false, a Save button will display
15
19
  *
@@ -4,7 +4,7 @@ import { AdaptableScope } from '../PredefinedConfig/Common/AdaptableScope';
4
4
  import { AdaptablePredicateDef } from '../PredefinedConfig/Common/AdaptablePredicate';
5
5
  import { AdaptableAlert } from '../PredefinedConfig/Common/AdaptableAlert';
6
6
  import { AdaptableForm, AdaptableFormData } from '../PredefinedConfig/Common/AdaptableForm';
7
- import { AdaptableMessageType, AlertButtonContext, AlertProperties } from '../types';
7
+ import { AdaptableMessageType, AlertButtonContext, AlertProperties, GridDataChangedInfo } from '../types';
8
8
  /**
9
9
  * Provides run-time access to Alert function and associated State
10
10
  */
@@ -96,6 +96,7 @@ export interface AlertApi {
96
96
  executeAlertAction(actionName: AdaptableAlertAction | string, details: {
97
97
  alertDefinition: AlertDefinition;
98
98
  dataChangedInfo?: DataChangedInfo;
99
+ gridDataChangedInfo?: GridDataChangedInfo;
99
100
  formData?: AdaptableFormData;
100
101
  }): void;
101
102
  /**
@@ -131,7 +132,7 @@ export interface AlertApi {
131
132
  */
132
133
  showAlertError(alertHeader: string, alertMessage: string): void;
133
134
  /**
134
- * Opens the Alert popup screen
135
+ * Opens Settings Panel with Alert section selected and visible
135
136
  */
136
137
  showAlertPopup(): void;
137
138
  /**
@@ -8,7 +8,7 @@ export interface BulkUpdateApi {
8
8
  */
9
9
  getBulkUpdateValue(): string;
10
10
  /**
11
- * Opens Bulk Update popup screen
11
+ * Opens Settings Panel with Bulk Update section selected and visible
12
12
  */
13
13
  showBulkUpdatePopup(): void;
14
14
  /**
@@ -16,4 +16,9 @@ export interface BulkUpdateApi {
16
16
  * @param gridCells Cells to apply the Bulk Update
17
17
  */
18
18
  applyBulkUpdate(gridCells: GridCell[]): void;
19
+ /**
20
+ * Sets Bulk Update value
21
+ * @param bulkUpdateValue the value to use in Bulk Update Operation
22
+ */
23
+ setBulkUpdateValue(bulkUpdateValue: string): void;
19
24
  }
@@ -48,7 +48,7 @@ export interface CalculatedColumnApi {
48
48
  */
49
49
  deleteCalculatedColumn(calcColumn: string): void;
50
50
  /**
51
- * Opens Calculated Column popup screen
51
+ * Opens Settings Panel with Calculated Column section selected and visible
52
52
  */
53
53
  showCalculatedColumnPopup(): void;
54
54
  /**
@@ -16,7 +16,7 @@ export interface CellSummaryApi {
16
16
  */
17
17
  getCellSummaryOperationDefinitions(): CellSummaryOperation[];
18
18
  /**
19
- * Opens Cell Summary popup screen
19
+ * Opens Settings Panel with Cell Summary section selected and visible
20
20
  */
21
21
  showCellSummaryPopup(): void;
22
22
  }
@@ -30,7 +30,7 @@ export interface ConditionalStyleApi {
30
30
  */
31
31
  getAllSuspendedConditionalStyle(): ConditionalStyle[];
32
32
  /**
33
- * Opens Conditional Style popup screen
33
+ * Opens Settings Panel with Conditional Style section selected and visible
34
34
  */
35
35
  showConditionalStylePopup(): void;
36
36
  /**
@@ -96,7 +96,7 @@ export interface ConfigApi {
96
96
  * Adds '1' to current revision number of State element
97
97
  * @param stateKey Adaptable State Key to update
98
98
  */
99
- incrementUerStateRevision(stateKey: AdaptableStateKey): void;
99
+ incrementUserStateRevision(stateKey: AdaptableStateKey): void;
100
100
  /**
101
101
  * Returns Alert section of Adaptable State
102
102
  * @param returnJson return as JSON rather than object
@@ -71,7 +71,7 @@ export interface CustomSortApi {
71
71
  */
72
72
  unSuspendCustomSort(customSort: CustomSort): CustomSort;
73
73
  /**
74
- * Opens Custom Sort popup screen
74
+ * Opens Settings Panel with Custom Sort section selected and visible
75
75
  */
76
76
  showCustomSortPopup(): void;
77
77
  }
@@ -119,7 +119,7 @@ export interface DashboardApi {
119
119
  */
120
120
  isToolbarVisible(toolbar: AdaptableDashboardToolbar | string): boolean;
121
121
  /**
122
- * Opens the Dashboard popup screen
122
+ * Opens Settings Panel with Dashboard section selected and visible
123
123
  */
124
124
  showDashboardPopup(): void;
125
125
  /**
@@ -52,7 +52,7 @@ export interface DataSourceApi {
52
52
  */
53
53
  clearDataSource(): void;
54
54
  /**
55
- * Opens Data Source popup screen
55
+ * Opens Settings Panel with Data Source section selected and visible
56
56
  */
57
57
  showDataSourcePopup(): void;
58
58
  }
@@ -58,7 +58,7 @@ export interface EventApi {
58
58
  */
59
59
  off(eventName: 'TeamSharingEntityChanged', callback: (TeamSharingEntityChangedInfo: TeamSharingEntityChangedInfo) => void): void;
60
60
  /**
61
- * Event fired when data changes in the Grid
61
+ * Event fired when a row is added, deleted or updated in the Grid
62
62
  * @param eventName GridDataChanged
63
63
  * @param callback GridDataChangedInfo which includes full details of what changed
64
64
  * @returns the unsubscribe function
@@ -4,6 +4,10 @@ import { BaseEventInfo } from './BaseEventInfo';
4
4
  * EventInfo returned by GridDataChanged event
5
5
  */
6
6
  export interface GridDataChangedInfo extends BaseEventInfo {
7
+ /**
8
+ * Timestamp of change occurrence (in milliseconds)
9
+ */
10
+ changedAt: number;
7
11
  /**
8
12
  * Data rows that have been added, updated, or deleted
9
13
  */
@@ -13,7 +17,7 @@ export interface GridDataChangedInfo extends BaseEventInfo {
13
17
  */
14
18
  rowTrigger: 'Add' | 'Edit' | 'Delete';
15
19
  /**
16
- * AG Grid Row Nodes that were affected by the Change
20
+ * Row Nodes that were affected by this change
17
21
  */
18
22
  rowNodes: RowNode[];
19
23
  }
@@ -77,7 +77,7 @@ export interface ExportApi {
77
77
  */
78
78
  exportDataToExcel(reportData: ReportData, fileName: string): void;
79
79
  /**
80
- * Opens Export popup screen
80
+ * Opens Settings Panel with Export section selected and visible
81
81
  */
82
82
  showExportPopup(): void;
83
83
  /**
@@ -121,5 +121,10 @@ export interface ExportApi {
121
121
  * Runs the report function of the CustomReport with the given reportName
122
122
  * @param reportName custom report name
123
123
  */
124
- runCustomReport(reportName: string): ReportData;
124
+ runCustomReport(reportName: string): ReportData | undefined;
125
+ /**
126
+ * Returns the ReportData for the Report with the given name
127
+ * @param reportName - the name of the report
128
+ */
129
+ getReportDataForReport(reportName: string): ReportData | undefined;
125
130
  }
@@ -99,7 +99,7 @@ export interface FormatColumnApi {
99
99
  */
100
100
  applyFormatColumnDisplayFormats(): void;
101
101
  /**
102
- * Opens the Format Column popup screen
102
+ * Opens Settings Panel with Format Column section selected and visible
103
103
  */
104
104
  showFormatColumnPopup(): void;
105
105
  /**
@@ -65,7 +65,7 @@ export interface FreeTextColumnApi {
65
65
  */
66
66
  checkFreeTextColumnForDataChange(dataChangedInfo: DataChangedInfo): void;
67
67
  /**
68
- * Opens FreeTextColumn popup screen
68
+ * Opens Settings Panel with Free Text Column section selected and visible
69
69
  */
70
70
  showFreeTextColumnPopup(): void;
71
71
  /**
@@ -11,6 +11,7 @@ import { AdaptableModule } from '../PredefinedConfig/Common/Types';
11
11
  import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
12
12
  import { GridOptions, RowNode } from '@ag-grid-community/all-modules';
13
13
  import { GridCellRange } from '../PredefinedConfig/Selection/GridCellRange';
14
+ import { RowsHighlightInfo } from '../PredefinedConfig/Common/RowsHighlightInfo';
14
15
  /**
15
16
  * Provides access to important properites of AdapTable e.g. sorting, selected cells etc.
16
17
  */
@@ -214,6 +215,11 @@ export interface GridApi {
214
215
  * @param rowNode rowNode to look up
215
216
  */
216
217
  getPrimaryKeyValueForRowNode(rowNode: RowNode): any;
218
+ /**
219
+ * Returns the Primary Kev Values for a given Row Node collection
220
+ * @param rowNode rowNodes to look up
221
+ */
222
+ getPrimaryKeyValuesForRowNodes(rowNodes: RowNode[]): any[];
217
223
  /**
218
224
  * Retrieves Cell in given Row and Column
219
225
  * @param rowNode Row to use
@@ -365,11 +371,21 @@ export interface GridApi {
365
371
  * @param rowHighlightInfo highlight instructions
366
372
  */
367
373
  highlightRow(rowHighlightInfo: RowHighlightInfo): void;
374
+ /**
375
+ * Highlight rows using an adaptable style
376
+ * @param rowHighlightInfo highlight instructions
377
+ */
378
+ highlightRows(rowsHighlightInfo: RowsHighlightInfo): void;
368
379
  /**
369
380
  * Remove highlight from row
370
381
  * @param primaryKeyValue
371
382
  */
372
383
  unHighlightRow(primaryKeyValue: RowHighlightInfo['primaryKeyValue']): void;
384
+ /**
385
+ * Remove highlight from row
386
+ * @param primaryKeyValue
387
+ */
388
+ unHighlightRows(primaryKeyValues: RowsHighlightInfo['primaryKeyValues']): void;
373
389
  /**
374
390
  * Remove all highlighted rows
375
391
  */
@@ -381,15 +397,20 @@ export interface GridApi {
381
397
  */
382
398
  refreshCells(rowNodes: RowNode[], columnIds: string[]): void;
383
399
  /**
384
- * Forces a render of a row
400
+ * Forces a re-render of the row with the given primary key value
385
401
  * @param primaryKey row primary key
386
402
  */
387
403
  refreshRowByPrimaryKey(primaryKey: any): void;
388
404
  /**
389
- *
405
+ * Forces a re-render of the given row
390
406
  * @param rowNode ag-grid row
391
407
  */
392
408
  refreshRowNode(rowNode: RowNode): void;
409
+ /**
410
+ * Forces a re-render of the given rows
411
+ * @param rowNodes ag-grid rows
412
+ */
413
+ refreshRowNodes(rowNodes: RowNode[]): void;
393
414
  /**
394
415
  * Returns number of rows in Data Source
395
416
  */
@@ -433,7 +454,7 @@ export interface GridApi {
433
454
  */
434
455
  getGridContainerElement(): HTMLElement | null;
435
456
  /**
436
- * Opens Grid Info popup screen
457
+ * Opens Settings Panel with Grid Info section selected and visible
437
458
  */
438
459
  showGridInfoPopup(): void;
439
460
  }
@@ -6,7 +6,9 @@ import { AdaptableScope } from '../../PredefinedConfig/Common/AdaptableScope';
6
6
  import { AdaptablePredicateDef } from '../../PredefinedConfig/Common/AdaptablePredicate';
7
7
  import { AdaptableAlert } from '../../PredefinedConfig/Common/AdaptableAlert';
8
8
  import { AdaptableForm, AdaptableFormData } from '../../PredefinedConfig/Common/AdaptableForm';
9
- import { AdaptableMessageType, AlertButtonContext } from '../../types';
9
+ import { AlertButtonContext } from '../../AdaptableOptions/AlertOptions';
10
+ import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
11
+ import { GridDataChangedInfo } from '../Events/GridDataChanged';
10
12
  export declare class AlertApiImpl extends ApiBase implements AlertApi {
11
13
  getAlertState(): AlertState;
12
14
  getAdaptableFormByName(name: string): AdaptableForm<AlertButtonContext> | undefined;
@@ -23,6 +25,7 @@ export declare class AlertApiImpl extends ApiBase implements AlertApi {
23
25
  executeAlertAction(actionName: AdaptableAlertAction, details: {
24
26
  alertDefinition: AlertDefinition;
25
27
  dataChangedInfo?: DataChangedInfo;
28
+ gridDataChangedInfo?: GridDataChangedInfo;
26
29
  formData?: AdaptableFormData;
27
30
  }): void;
28
31
  displayAlert(alertToShow: AdaptableAlert): Promise<any>;
@@ -9,6 +9,7 @@ const ApiBase_1 = require("./ApiBase");
9
9
  const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
10
10
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
11
11
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../Utilities/ObjectFactory"));
12
+ const AdaptableAlert_1 = require("../../PredefinedConfig/Common/AdaptableAlert");
12
13
  const AdaptableQuery_1 = require("../../PredefinedConfig/Common/AdaptableQuery");
13
14
  class AlertApiImpl extends ApiBase_1.ApiBase {
14
15
  getAlertState() {
@@ -61,22 +62,24 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
61
62
  buttonOnClick === null || buttonOnClick === void 0 ? void 0 : buttonOnClick.handler(button, context);
62
63
  this.adaptable.api.alertApi.executeAlertAction(action, {
63
64
  alertDefinition: context.alert.alertDefinition,
64
- dataChangedInfo: context.alert.dataChangedInfo,
65
+ dataChangedInfo: AdaptableAlert_1.isAdaptableCellChangedAlert(context.alert)
66
+ ? context.alert.dataChangedInfo
67
+ : null,
68
+ gridDataChangedInfo: AdaptableAlert_1.isAdaptableRowChangedAlert(context.alert)
69
+ ? context.alert.gridDataChangedInfo
70
+ : null,
65
71
  formData: context.formData,
66
72
  });
67
73
  });
68
74
  }
69
75
  }
70
76
  executeAlertAction(actionName, details) {
71
- var _a;
72
- const { alertDefinition, dataChangedInfo } = details;
73
- if (!dataChangedInfo) {
74
- return;
75
- }
76
- if (actionName === 'highlight-cell') {
77
- const highhlightType = (_a = alertDefinition.MessageType) !== null && _a !== void 0 ? _a : 'Info';
77
+ const { alertDefinition, dataChangedInfo, gridDataChangedInfo } = details;
78
+ const getBackgroundColor = (alertDefinition) => {
79
+ var _a;
80
+ const highlightType = (_a = alertDefinition.MessageType) !== null && _a !== void 0 ? _a : 'Info';
78
81
  let backgroundColor = '';
79
- switch (highhlightType) {
82
+ switch (highlightType) {
80
83
  case 'Error':
81
84
  backgroundColor = 'var(--ab-color-error)';
82
85
  break;
@@ -89,6 +92,10 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
89
92
  case 'Warning':
90
93
  backgroundColor = 'var(--ab-color-warn)';
91
94
  }
95
+ return backgroundColor;
96
+ };
97
+ if (actionName === 'highlight-cell' && dataChangedInfo) {
98
+ const backgroundColor = getBackgroundColor(alertDefinition);
92
99
  this.adaptable.api.gridApi.highlightCell({
93
100
  columnId: dataChangedInfo.column.columnId,
94
101
  primaryKeyValue: dataChangedInfo.primaryKeyValue,
@@ -97,40 +104,47 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
97
104
  },
98
105
  timeout: this.getAlertOptions().cellHighlightDuration,
99
106
  });
100
- return;
101
107
  }
102
- if (actionName === 'jump-to-cell') {
108
+ if (actionName === 'highlight-row' &&
109
+ gridDataChangedInfo &&
110
+ // no sense to highlight a deleted(non-existing) row
111
+ (gridDataChangedInfo === null || gridDataChangedInfo === void 0 ? void 0 : gridDataChangedInfo.rowTrigger) !== 'Delete') {
112
+ const backgroundColor = getBackgroundColor(alertDefinition);
113
+ const primaryKeyValues = this.adaptable.api.gridApi.getPrimaryKeyValuesForRowNodes(gridDataChangedInfo.rowNodes);
114
+ const rowsHighlightInfo = {
115
+ primaryKeyValues,
116
+ highlightStyle: {
117
+ BackColor: backgroundColor,
118
+ },
119
+ timeout: this.getAlertOptions().cellHighlightDuration,
120
+ };
121
+ this.adaptable.api.gridApi.highlightRows(rowsHighlightInfo);
122
+ }
123
+ if (actionName === 'jump-to-cell' && dataChangedInfo) {
103
124
  this.adaptable.api.gridApi.jumpToCell(dataChangedInfo.primaryKeyValue, dataChangedInfo.column.columnId);
104
- return;
105
125
  }
106
- if (actionName === 'jump-to-column') {
126
+ if (actionName === 'jump-to-row' &&
127
+ gridDataChangedInfo &&
128
+ // no sense to jump to a deleted(non-existing) row
129
+ (gridDataChangedInfo === null || gridDataChangedInfo === void 0 ? void 0 : gridDataChangedInfo.rowTrigger) !== 'Delete') {
130
+ const [firstRowNode] = gridDataChangedInfo.rowNodes;
131
+ const targetRowNodePrimaryKeyValue = this.adaptable.api.gridApi.getPrimaryKeyValueForRowNode(firstRowNode);
132
+ if (targetRowNodePrimaryKeyValue) {
133
+ this.adaptable.api.gridApi.jumpToRow(targetRowNodePrimaryKeyValue);
134
+ }
135
+ }
136
+ if (actionName === 'jump-to-column' && dataChangedInfo) {
107
137
  this.adaptable.api.gridApi.jumpToColumn(dataChangedInfo.column.columnId);
108
- return;
109
138
  }
110
139
  if (actionName === 'suspend') {
111
140
  this.adaptable.api.alertApi.suspendAlertDefinition(alertDefinition);
112
- return;
113
- }
114
- if (actionName === 'jump-to-row') {
115
- this.adaptable.api.gridApi.jumpToRow(dataChangedInfo.primaryKeyValue);
116
- return;
117
141
  }
118
- if (actionName === 'undo') {
142
+ if (actionName === 'undo' && dataChangedInfo) {
119
143
  this.adaptable.api.gridApi.undoCellEdit(dataChangedInfo);
120
144
  }
121
- // we no longer overwrite through an Alert Action
122
- /*
123
- if (actionName === 'overwrite' && formData && Object.keys(formData).length === 1) {
124
- const value = formData[Object.keys(formData)[0]];
125
- this.adaptable.api.gridApi.setCellValue(
126
- dataChangedInfo.columnId,
127
- value,
128
- dataChangedInfo.primaryKeyValue
129
- );
130
- }
131
- */
132
145
  }
133
146
  async displayAlert(alertToShow) {
147
+ var _a, _b;
134
148
  // 3 things we always do with an alert are:
135
149
  // 1. Dispatch the Alert (so it appears in the toolbar)
136
150
  this.addUidToAdaptableObject(alertToShow);
@@ -147,12 +161,16 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
147
161
  if (alertToShow.alertDefinition && alertToShow.alertDefinition.AlertProperties != undefined) {
148
162
  const alertDefinition = alertToShow.alertDefinition;
149
163
  const alertProperties = alertDefinition.AlertProperties;
150
- const dataChangedInfo = alertToShow.dataChangedInfo;
151
164
  // There are 4 possible other actions that could happen
165
+ // alertProperties.PreventEdit is handled separately, in the Adaptable.setupColumnValueSetter() function
152
166
  // 1. Show a Popup
153
167
  if (alertProperties.DisplayNotification && showPopup) {
154
168
  this.dispatchAction(PopupRedux.PopupShowAlert(alertToShow));
155
169
  }
170
+ // 2. Log to console
171
+ if (alertProperties.LogToConsole) {
172
+ LoggingHelper_1.ConsoleLogByMessageType(alertToShow.header + ': ' + alertToShow.message, alertDefinition.MessageType);
173
+ }
156
174
  // 3. Show it in a Div (if one has been set)
157
175
  if (alertProperties.ShowInDiv) {
158
176
  let alertDiv;
@@ -166,37 +184,46 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
166
184
  alertDiv.innerHTML = alertString;
167
185
  }
168
186
  }
187
+ // 4.JumpToCell and 5.JumpToRow are exclusive, based on alertType!
169
188
  // 4: Jump to the Cell
170
- if (alertProperties.JumpToCell && dataChangedInfo) {
171
- this.adaptable.jumpToCell(dataChangedInfo.column.columnId, dataChangedInfo.rowNode);
189
+ if (alertProperties.JumpToCell &&
190
+ AdaptableAlert_1.isAdaptableCellChangedAlert(alertToShow) &&
191
+ alertToShow.dataChangedInfo) {
192
+ this.adaptable.jumpToCell(alertToShow.dataChangedInfo.column.columnId, alertToShow.dataChangedInfo.rowNode);
172
193
  }
173
- // 5: Hight the cell - though that is taken care of in the Style Service
174
- if (alertProperties.HighlightCell && dataChangedInfo) {
175
- let alertNode = dataChangedInfo.rowNode;
176
- if (!alertNode) {
177
- alertNode = this.adaptable.getRowNodeForPrimaryKey(dataChangedInfo.primaryKeyValue);
178
- }
179
- if (alertNode) {
180
- this.adaptable.api.gridApi.refreshCells([alertNode], [dataChangedInfo.column.columnId]);
181
- setTimeout(() => {
182
- this.dispatchAction(SystemRedux.SystemAlertRemoveHighlight(alertToShow));
183
- }, this.adaptable.adaptableOptions.alertOptions.cellHighlightDuration);
194
+ // 5: Jump to the Row
195
+ else if (alertProperties.JumpToRow &&
196
+ AdaptableAlert_1.isAdaptableRowChangedAlert(alertToShow) &&
197
+ ((_a = alertToShow.gridDataChangedInfo) === null || _a === void 0 ? void 0 : _a.rowTrigger) === 'Add') {
198
+ const [firstRowNode] = alertToShow.gridDataChangedInfo.rowNodes;
199
+ if (firstRowNode) {
200
+ this.adaptable.jumpToRow(firstRowNode);
184
201
  }
185
202
  }
186
- if (alertProperties.HighlightRow && dataChangedInfo) {
187
- let alertNode = dataChangedInfo.rowNode;
203
+ // 6.HighlightCell and 7.HighlightRow are exclusive, based on alertType!
204
+ // 6: Highlight the cell - we just refresh the cells to trigger a re-evaluation of the Adaptable.setupColumn[Style/Class]
205
+ if (alertProperties.HighlightCell &&
206
+ AdaptableAlert_1.isAdaptableCellChangedAlert(alertToShow) &&
207
+ alertToShow.dataChangedInfo) {
208
+ let alertNode = alertToShow.dataChangedInfo.rowNode;
188
209
  if (!alertNode) {
189
- alertNode = this.adaptable.getRowNodeForPrimaryKey(dataChangedInfo.primaryKeyValue);
210
+ alertNode = this.adaptable.getRowNodeForPrimaryKey(alertToShow.dataChangedInfo.primaryKeyValue);
190
211
  }
191
212
  if (alertNode) {
192
- this.adaptable.api.gridApi.refreshRowNode(alertNode);
213
+ this.adaptable.api.gridApi.refreshCells([alertNode], [alertToShow.dataChangedInfo.column.columnId]);
193
214
  setTimeout(() => {
194
215
  this.dispatchAction(SystemRedux.SystemAlertRemoveHighlight(alertToShow));
195
216
  }, this.adaptable.adaptableOptions.alertOptions.cellHighlightDuration);
196
217
  }
197
218
  }
198
- if (alertProperties.LogToConsole) {
199
- LoggingHelper_1.ConsoleLogByMessageType(alertToShow.header + ': ' + alertToShow.message, alertDefinition.MessageType);
219
+ // 7. Highlight the row - we just refresh the rows to trigger a re-evaluation of the Adaptable.setupColumn[Style/Class]
220
+ else if (alertProperties.HighlightRow &&
221
+ AdaptableAlert_1.isAdaptableRowChangedAlert(alertToShow) &&
222
+ ((_b = alertToShow.gridDataChangedInfo) === null || _b === void 0 ? void 0 : _b.rowTrigger) === 'Add') {
223
+ this.adaptable.api.gridApi.refreshRowNodes(alertToShow.gridDataChangedInfo.rowNodes);
224
+ setTimeout(() => {
225
+ this.dispatchAction(SystemRedux.SystemAlertRemoveHighlight(alertToShow));
226
+ }, this.adaptable.adaptableOptions.alertOptions.cellHighlightDuration);
200
227
  }
201
228
  }
202
229
  }
@@ -212,7 +239,7 @@ class AlertApiImpl extends ApiBase_1.ApiBase {
212
239
  }
213
240
  showAlert(alertHeader, alertMessage, messageType, alertProperties) {
214
241
  const alertDefinition = ObjectFactory_1.default.CreateInternalAlertDefinitionForMessages(messageType, alertProperties);
215
- let alertToShow = ObjectFactory_1.default.CreateAlert(alertHeader, alertMessage, alertDefinition);
242
+ let alertToShow = ObjectFactory_1.default.CreateGenericAlert(alertHeader, alertMessage, alertDefinition);
216
243
  this.displayAlert(alertToShow);
217
244
  }
218
245
  showAlertInfo(alertHeader, alertMessage, alertProperties) {
@@ -5,4 +5,5 @@ export declare class BulkUpdateApiImpl extends ApiBase implements BulkUpdateApi
5
5
  getBulkUpdateValue(): string;
6
6
  showBulkUpdatePopup(): void;
7
7
  applyBulkUpdate(gridCells: GridCell[]): void;
8
+ setBulkUpdateValue(bulkUpdateValue: string): void;
8
9
  }
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
7
7
  const BulkUpdateRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/BulkUpdateRedux"));
8
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
8
9
  class BulkUpdateApiImpl extends ApiBase_1.ApiBase {
9
10
  getBulkUpdateValue() {
10
11
  return this.getAdaptableState().System.BulkUpdateValue;
@@ -15,5 +16,8 @@ class BulkUpdateApiImpl extends ApiBase_1.ApiBase {
15
16
  applyBulkUpdate(gridCells) {
16
17
  this.dispatchAction(BulkUpdateRedux.BulkUpdateApply(gridCells));
17
18
  }
19
+ setBulkUpdateValue(bulkUpdateValue) {
20
+ this.dispatchAction(SystemRedux.BulkUpdateChangeValue(bulkUpdateValue));
21
+ }
18
22
  }
19
23
  exports.BulkUpdateApiImpl = BulkUpdateApiImpl;