@adaptabletools/adaptable 11.0.8 → 11.1.1-canary.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.
- package/base.css +19 -11
- package/bundle.cjs.js +125 -125
- package/index.css +23 -11
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/Api/AlertApi.d.ts +2 -1
- package/src/Api/BulkUpdateApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/GridDataChanged.d.ts +5 -1
- package/src/Api/GridApi.d.ts +23 -2
- package/src/Api/Implementation/AlertApiImpl.d.ts +4 -1
- package/src/Api/Implementation/AlertApiImpl.js +79 -52
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +7 -2
- package/src/Api/Implementation/EventApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
- package/src/Api/Implementation/GridApiImpl.js +24 -3
- package/src/Api/Implementation/InternalApiImpl.d.ts +9 -2
- package/src/Api/Implementation/InternalApiImpl.js +37 -1
- package/src/Api/Implementation/LayoutApiImpl.d.ts +6 -1
- package/src/Api/Implementation/LayoutApiImpl.js +45 -4
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
- package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
- package/src/Api/InternalApi.d.ts +9 -2
- package/src/Api/LayoutApi.d.ts +33 -3
- package/src/PredefinedConfig/AlertState.d.ts +7 -3
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
- package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
- package/src/PredefinedConfig/ConfigState.d.ts +4 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +11 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +32 -1
- package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
- package/src/Redux/Store/AdaptableStore.js +69 -27
- package/src/Strategy/AlertModule.d.ts +5 -3
- package/src/Strategy/AlertModule.js +60 -16
- package/src/Strategy/BulkUpdateModule.js +5 -0
- package/src/Strategy/ExportModule.js +1 -0
- package/src/Strategy/SmartEditModule.js +6 -0
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +6 -3
- package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
- package/src/Utilities/ObjectFactory.d.ts +8 -6
- package/src/Utilities/ObjectFactory.js +26 -12
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/ValidationService.js +1 -0
- package/src/View/AdaptableView.js +2 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
- package/src/View/Alert/Wizard/AlertWizard.js +83 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Components/FilterForm/FilterForm.js +2 -2
- package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
- package/src/View/Components/Panels/PanelFooter.js +14 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
- package/src/View/Layout/LayoutPopup.js +3 -24
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
- package/src/View/Layout/LayoutViewPanel.js +5 -18
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
- package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
- package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
- package/src/agGrid/Adaptable.d.ts +4 -2
- package/src/agGrid/Adaptable.js +65 -69
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +23 -8
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
- package/src/components/Dialog/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +10 -8
- package/src/components/WindowModal/WindowModal.js +4 -2
- package/src/components/WindowModal/useStacking.d.ts +9 -0
- package/src/components/WindowModal/useStacking.js +45 -0
- package/src/env.js +3 -3
- package/src/metamodel/adaptable.metamodel.d.ts +51 -11
- package/src/metamodel/adaptable.metamodel.js +146 -21
- package/src/types.d.ts +3 -2
- package/version.d.ts +1 -1
- 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
|
-
|
|
2143
|
-
|
|
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-
|
|
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-
|
|
2162
|
-
grid-column: 2 /2; }
|
|
2163
|
+
grid-area: 1 / 2 / 2 / 3; }
|
|
2163
2164
|
|
|
2164
2165
|
.ab-LayoutEditor__RowGroupsListPanel {
|
|
2165
|
-
grid-
|
|
2166
|
-
grid-column: 2 /2; }
|
|
2166
|
+
grid-area: 2 / 2 / 3 / 3; }
|
|
2167
2167
|
|
|
2168
2168
|
.ab-LayoutEditor__PivotListPanel {
|
|
2169
|
-
grid-
|
|
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
|
|
3
|
+
"version": "11.1.1-canary.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.
|
|
59
|
+
"@ag-grid-community/all-modules": ">=27.1.0"
|
|
60
60
|
}
|
|
61
61
|
}
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1648213605950;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -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
|
*
|
package/src/Api/AlertApi.d.ts
CHANGED
|
@@ -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
|
/**
|
|
@@ -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
|
}
|
package/src/Api/ConfigApi.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
package/src/Api/EventApi.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
20
|
+
* Row Nodes that were affected by this change
|
|
17
21
|
*/
|
|
18
22
|
rowNodes: RowNode[];
|
|
19
23
|
}
|
package/src/Api/GridApi.d.ts
CHANGED
|
@@ -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
|
|
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
|
*/
|
|
@@ -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 {
|
|
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
|
|
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
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
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 (
|
|
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 === '
|
|
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-
|
|
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 &&
|
|
171
|
-
|
|
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:
|
|
174
|
-
if (alertProperties.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
187
|
-
|
|
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.
|
|
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
|
-
|
|
199
|
-
|
|
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.
|
|
242
|
+
let alertToShow = ObjectFactory_1.default.CreateGenericAlert(alertHeader, alertMessage, alertDefinition);
|
|
216
243
|
this.displayAlert(alertToShow);
|
|
217
244
|
}
|
|
218
245
|
showAlertInfo(alertHeader, alertMessage, alertProperties) {
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
245
|
+
incrementUserStateRevision(stateKey) {
|
|
246
246
|
let state = this.getUserStateByStateKey(stateKey);
|
|
247
|
-
state.Revision
|
|
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) {
|
|
@@ -10,7 +10,7 @@ class EventApiImpl extends ApiBase_1.ApiBase {
|
|
|
10
10
|
this.on = (eventName, callback) => {
|
|
11
11
|
let result;
|
|
12
12
|
if (eventName === 'AdaptableReady') {
|
|
13
|
-
result = this.emitter.
|
|
13
|
+
result = this.emitter.onIncludeFiredOnce(eventName, callback);
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
16
|
result = this.emitter.on(eventName, callback);
|
|
@@ -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;
|