@adaptabletools/adaptable 10.0.3 → 10.0.4-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/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +3 -4
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +6 -0
- package/src/Api/Implementation/AlertApiImpl.js +5 -5
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +32 -35
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +1 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -2
- package/src/Api/Implementation/GridApiImpl.js +8 -9
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
- package/src/Api/Implementation/InternalApiImpl.js +4 -4
- package/src/Api/Implementation/LayoutApiImpl.js +3 -3
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -8
- package/src/Api/InternalApi.d.ts +1 -1
- package/src/Api/UserInterfaceApi.d.ts +3 -2
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +3 -3
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +3 -3
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.js +12 -11
- package/src/Strategy/BulkUpdateModule.js +5 -5
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +5 -5
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.js +6 -6
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.js +1 -1
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/ReportService.js +11 -11
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +3 -3
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.js +14 -14
- package/src/View/Components/FilterForm/QuickFilterForm.js +13 -13
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.js +4 -4
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +6 -6
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +3 -3
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +2 -2
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +2 -2
- package/src/agGrid/Adaptable.js +57 -51
- package/src/agGrid/agGridHelper.js +32 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/metamodel/adaptable.metamodel.d.ts +51 -5
- package/src/metamodel/adaptable.metamodel.js +99 -30
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -124,18 +124,14 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
124
124
|
}
|
|
125
125
|
return this.getPermittedValuesForScope(column, editLookUpItems);
|
|
126
126
|
}
|
|
127
|
-
getEditLookUpValuesForEditLookUpItem(editLookUpItem,
|
|
128
|
-
if (!editLookUpItem) {
|
|
129
|
-
return undefined;
|
|
130
|
-
}
|
|
131
|
-
const column = this.adaptable.api.columnApi.getColumnFromId(columnId);
|
|
132
|
-
if (!column) {
|
|
127
|
+
getEditLookUpValuesForEditLookUpItem(editLookUpItem, gridCell) {
|
|
128
|
+
if (!editLookUpItem || !gridCell || !gridCell.column) {
|
|
133
129
|
return undefined;
|
|
134
130
|
}
|
|
135
131
|
let editLookUpValues = editLookUpItem.values;
|
|
136
132
|
// first do the function then get hardcoded items
|
|
137
133
|
if (editLookUpValues != null && typeof editLookUpValues === 'function') {
|
|
138
|
-
return editLookUpValues(column,
|
|
134
|
+
return editLookUpValues(gridCell.column, gridCell);
|
|
139
135
|
}
|
|
140
136
|
else {
|
|
141
137
|
let arr = editLookUpValues;
|
|
@@ -145,7 +141,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
145
141
|
}
|
|
146
142
|
// if no hard-coded values or function provided then just get the distinct values for the column
|
|
147
143
|
// this will use the columnapi method that first looks for permitted values and then distinct values
|
|
148
|
-
return this.adaptable.api.columnApi.getDistinctDisplayValuesForColumn(columnId);
|
|
144
|
+
return this.adaptable.api.columnApi.getDistinctDisplayValuesForColumn(gridCell.column.columnId);
|
|
149
145
|
}
|
|
150
146
|
addColumnMenuItem(columnMenuItem) {
|
|
151
147
|
var _a;
|
package/src/Api/InternalApi.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export interface InternalApi {
|
|
|
78
78
|
setGridCell(gridCell: GridCell): void;
|
|
79
79
|
setToolbarTitle(): string;
|
|
80
80
|
getQueryPreviewData(): any;
|
|
81
|
-
buildDataChangedInfo(config: Pick<DataChangedInfo, 'newValue' | 'oldValue' | '
|
|
81
|
+
buildDataChangedInfo(config: Pick<DataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): DataChangedInfo;
|
|
82
82
|
setLastAppliedShortCut(gridCell: GridCell | undefined): void;
|
|
83
83
|
setDefaultDashboardTab(): void;
|
|
84
84
|
updateCurrentDraftLayout(layout: Layout): void;
|
|
@@ -2,6 +2,7 @@ import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
|
2
2
|
import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
|
|
3
3
|
import { UserMenuItem } from '../PredefinedConfig/Common/Menu';
|
|
4
4
|
import { ActionColumn, BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../AdaptableOptions/UserInterfaceOptions';
|
|
5
|
+
import { GridCell } from '../PredefinedConfig/Selection/GridCell';
|
|
5
6
|
/**
|
|
6
7
|
* Functions relating to User Interface section of Adaptable State
|
|
7
8
|
*/
|
|
@@ -44,9 +45,9 @@ export interface UserInterfaceApi {
|
|
|
44
45
|
/**
|
|
45
46
|
* Retrieves actual Look Up Values from an EditLookUpItem
|
|
46
47
|
* @param editLookUpItem editLookUpItem to check
|
|
47
|
-
* @param
|
|
48
|
+
* @param gridCell: the currently edited Grid Cell
|
|
48
49
|
*/
|
|
49
|
-
getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues,
|
|
50
|
+
getEditLookUpValuesForEditLookUpItem(editLookUpItem: EditLookUpPermittedValues, gridCell: GridCell): any[] | undefined;
|
|
50
51
|
/**
|
|
51
52
|
* Adds menu item to Column Menu
|
|
52
53
|
* @param userMenuItem Menu Item to add
|
|
@@ -6,15 +6,15 @@ export interface AdaptableColumnBase extends AdaptableObject {
|
|
|
6
6
|
/**
|
|
7
7
|
* Name of Column in underlying grid (e.g. field or colId)
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
columnId: string;
|
|
10
10
|
/**
|
|
11
11
|
* How Column is referred to in Adaptable UI; 'Caption' or 'Header' property in underlying grid
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
friendlyName: string;
|
|
14
14
|
/**
|
|
15
15
|
* DataType of the column
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
|
|
18
18
|
}
|
|
19
19
|
export declare const isValidOrderForColumnGroups: ({ oldColumns, newColumns, }: {
|
|
20
20
|
oldColumns: AdaptableColumn[];
|
|
@@ -24,10 +24,10 @@ export declare const isValidOrderForColumnGroups: ({ oldColumns, newColumns, }:
|
|
|
24
24
|
* Defines a Column Group
|
|
25
25
|
*/
|
|
26
26
|
export interface AdaptableColumnGroup {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
allowGroupSplit: boolean;
|
|
28
|
+
columnGroupId: string;
|
|
29
|
+
friendlyName: string;
|
|
30
|
+
groupCount: number;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Defines an Adaptable Column - created at run-time based on vendor grid column definition
|
|
@@ -36,89 +36,89 @@ export interface AdaptableColumn extends AdaptableColumnBase {
|
|
|
36
36
|
/**
|
|
37
37
|
* Is this the Primary Key column
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
isPrimaryKey: boolean;
|
|
40
40
|
/**
|
|
41
41
|
* Column width
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
width?: number;
|
|
44
44
|
/**
|
|
45
45
|
* Flex details of the column
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
flex?: number;
|
|
48
48
|
/**
|
|
49
49
|
* Is column editable
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
readOnly: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* Is Column currently visible
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
visible: boolean;
|
|
56
56
|
/**
|
|
57
57
|
* Is Column sortable
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
sortable: boolean;
|
|
60
60
|
/**
|
|
61
61
|
* Is Column able to be filtered
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
filterable: boolean;
|
|
64
64
|
/**
|
|
65
65
|
* Can Column be moved at run-time to a new position
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
moveable: boolean;
|
|
68
68
|
/**
|
|
69
69
|
* Can Column be removed from the grid
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
hideable: boolean;
|
|
72
72
|
/**
|
|
73
73
|
* Can Column form a Row Group
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
groupable: boolean;
|
|
76
76
|
/**
|
|
77
77
|
* Can Column be used in a Pivot Grid
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
pivotable: boolean;
|
|
80
80
|
/**
|
|
81
81
|
* Is Column able to display aggregations (e.g. 'sum') when grouped
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
aggregatable: boolean;
|
|
84
84
|
/**
|
|
85
85
|
* Can the Column be in included in Queries / Expressions
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
queryable: boolean;
|
|
88
88
|
/**
|
|
89
89
|
* Available aggregations for the Column
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
availableAggregationFunctions?: string[];
|
|
92
92
|
/**
|
|
93
93
|
* Custom aggregation function for the Column
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
aggregationFunction?: string;
|
|
96
96
|
/**
|
|
97
97
|
* Is Column currently grouped
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
isGrouped: boolean;
|
|
100
100
|
/**
|
|
101
101
|
* Is Column pinned or locked into position
|
|
102
102
|
*/
|
|
103
|
-
|
|
103
|
+
isFixed: boolean;
|
|
104
104
|
/**
|
|
105
105
|
* Is it a Sparkline Column
|
|
106
106
|
*/
|
|
107
|
-
|
|
107
|
+
isSparkline: boolean;
|
|
108
108
|
/**
|
|
109
109
|
* Has colummn been excluded from Quick Search results
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
isExcludedFromQuickSearch: boolean;
|
|
112
112
|
/**
|
|
113
113
|
* The parent column group, if the column belongs to one
|
|
114
114
|
*/
|
|
115
|
-
|
|
115
|
+
columnGroup?: AdaptableColumnGroup;
|
|
116
116
|
}
|
|
117
117
|
export interface AdaptableColumnProperties {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
sortable: boolean;
|
|
119
|
+
filterable: boolean;
|
|
120
|
+
moveable: boolean;
|
|
121
|
+
groupable: boolean;
|
|
122
|
+
pivotable: boolean;
|
|
123
|
+
aggregatable: boolean;
|
|
124
124
|
}
|
|
@@ -8,14 +8,14 @@ exports.isValidOrderForColumnGroups = ({ oldColumns, newColumns, }) => {
|
|
|
8
8
|
let count = 0;
|
|
9
9
|
columns.forEach((column) => {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
if (column.
|
|
12
|
-
column.
|
|
13
|
-
!column.
|
|
14
|
-
if (prevGroup !== column.
|
|
11
|
+
if (column.columnGroup &&
|
|
12
|
+
column.columnGroup.groupCount > 1 &&
|
|
13
|
+
!column.columnGroup.allowGroupSplit) {
|
|
14
|
+
if (prevGroup !== column.columnGroup.columnGroupId) {
|
|
15
15
|
count++;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
prevGroup = (_b = (_a = column.
|
|
18
|
+
prevGroup = (_b = (_a = column.columnGroup) === null || _a === void 0 ? void 0 : _a.columnGroupId) !== null && _b !== void 0 ? _b : '';
|
|
19
19
|
});
|
|
20
20
|
return count;
|
|
21
21
|
};
|
|
@@ -467,7 +467,7 @@ exports.SystemPredicateDefs = [
|
|
|
467
467
|
columnScope: { All: true },
|
|
468
468
|
moduleScope: ['alert'],
|
|
469
469
|
handler: ({ value, column, api, node }) => {
|
|
470
|
-
return (column === null || column === void 0 ? void 0 : column.
|
|
470
|
+
return (column === null || column === void 0 ? void 0 : column.isPrimaryKey) ? api.columnApi.getDistinctRawValuesForColumn(column.columnId, node).includes(value)
|
|
471
471
|
: false;
|
|
472
472
|
},
|
|
473
473
|
},
|
|
@@ -478,7 +478,7 @@ exports.SystemPredicateDefs = [
|
|
|
478
478
|
moduleScope: ['alert'],
|
|
479
479
|
handler: ({ value, api, column, node }) => {
|
|
480
480
|
const distinctValues = column
|
|
481
|
-
? api.columnApi.getDistinctRawValuesForColumn(column.
|
|
481
|
+
? api.columnApi.getDistinctRawValuesForColumn(column.columnId, node)
|
|
482
482
|
: [];
|
|
483
483
|
return !distinctValues.includes(value);
|
|
484
484
|
},
|
|
@@ -490,7 +490,7 @@ exports.SystemPredicateDefs = [
|
|
|
490
490
|
moduleScope: ['alert'],
|
|
491
491
|
handler: ({ value, api, column, node }) => {
|
|
492
492
|
const distinctValues = column
|
|
493
|
-
? api.columnApi.getDistinctRawValuesForColumn(column.
|
|
493
|
+
? api.columnApi.getDistinctRawValuesForColumn(column.columnId, node)
|
|
494
494
|
: [];
|
|
495
495
|
return distinctValues.includes(value);
|
|
496
496
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
2
|
+
import { AdaptableColumn } from './AdaptableColumn';
|
|
2
3
|
/**
|
|
3
4
|
* Defines a Cell Edit - includes full details of old and new values, the column and the enclosing Row
|
|
4
5
|
*/
|
|
@@ -16,9 +17,9 @@ export interface DataChangedInfo {
|
|
|
16
17
|
*/
|
|
17
18
|
newValue: any;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Column in which cell is situated
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
column: AdaptableColumn;
|
|
22
23
|
/**
|
|
23
24
|
* Primary Key Column's value for the row where edited cell is situated
|
|
24
25
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
2
|
+
import { AdaptableColumn } from '../Common/AdaptableColumn';
|
|
2
3
|
/**
|
|
3
4
|
* Defines a Cell in Adaptable - every cell is an intersection of a Column Id and a Primary Key Value
|
|
4
5
|
*/
|
|
@@ -6,7 +7,7 @@ export interface GridCell {
|
|
|
6
7
|
/**
|
|
7
8
|
* Column in which cell is situtated
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
column: AdaptableColumn;
|
|
10
11
|
/**
|
|
11
12
|
* Actual raw value of cell
|
|
12
13
|
*/
|
|
@@ -497,6 +497,6 @@ exports.SystemReducer = (state = initialState, action) => {
|
|
|
497
497
|
return state;
|
|
498
498
|
}
|
|
499
499
|
};
|
|
500
|
-
const getDataChangeHistoryKey = ({ columnId, primaryKeyValue }) => {
|
|
500
|
+
const getDataChangeHistoryKey = ({ column: columnId, primaryKeyValue, }) => {
|
|
501
501
|
return JSON.stringify({ columnId, primaryKeyValue });
|
|
502
502
|
};
|
|
@@ -386,7 +386,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
386
386
|
if (((_c = actionTyped.alert.alertDefinition.AlertProperties) === null || _c === void 0 ? void 0 : _c.HighlightCell) &&
|
|
387
387
|
actionTyped.alert.dataChangedInfo) {
|
|
388
388
|
let rowNode = actionTyped.alert.dataChangedInfo.rowNode;
|
|
389
|
-
adaptable.refreshCells([rowNode], [actionTyped.alert.dataChangedInfo.columnId], true);
|
|
389
|
+
adaptable.refreshCells([rowNode], [actionTyped.alert.dataChangedInfo.column.columnId], true);
|
|
390
390
|
}
|
|
391
391
|
return ret;
|
|
392
392
|
}
|
|
@@ -402,7 +402,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
402
402
|
var _a;
|
|
403
403
|
if (((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) && alert.dataChangedInfo) {
|
|
404
404
|
let rowNode = alert.dataChangedInfo.rowNode;
|
|
405
|
-
adaptable.refreshCells([rowNode], [alert.dataChangedInfo.columnId], true);
|
|
405
|
+
adaptable.refreshCells([rowNode], [alert.dataChangedInfo.column.columnId], true);
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
408
|
return ret;
|
|
@@ -416,7 +416,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
416
416
|
let ret = next(action);
|
|
417
417
|
if (actionTyped.alert.dataChangedInfo) {
|
|
418
418
|
let rowNode = actionTyped.alert.dataChangedInfo.rowNode;
|
|
419
|
-
adaptable.refreshCells([rowNode], [actionTyped.alert.dataChangedInfo.columnId], true);
|
|
419
|
+
adaptable.refreshCells([rowNode], [actionTyped.alert.dataChangedInfo.column.columnId], true);
|
|
420
420
|
}
|
|
421
421
|
return ret;
|
|
422
422
|
}
|
|
@@ -118,26 +118,26 @@ class AdaptableModuleBase {
|
|
|
118
118
|
return false;
|
|
119
119
|
}
|
|
120
120
|
if (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(functionType)) {
|
|
121
|
-
if (functionType == 'sort' && !column.
|
|
122
|
-
return column.
|
|
121
|
+
if (functionType == 'sort' && !column.isSparkline) {
|
|
122
|
+
return column.sortable;
|
|
123
123
|
}
|
|
124
124
|
else if (functionType == 'editable') {
|
|
125
|
-
return !column.
|
|
125
|
+
return !column.readOnly;
|
|
126
126
|
}
|
|
127
127
|
else if (functionType == 'style') {
|
|
128
|
-
return !column.
|
|
128
|
+
return !column.isSparkline;
|
|
129
129
|
}
|
|
130
130
|
else if (functionType == 'sparkline') {
|
|
131
|
-
return column.
|
|
131
|
+
return column.isSparkline;
|
|
132
132
|
}
|
|
133
133
|
else if (functionType == 'numeric') {
|
|
134
|
-
return column.
|
|
134
|
+
return column.dataType == Enums_1.DataType.Number;
|
|
135
135
|
}
|
|
136
136
|
else if (functionType == 'filter') {
|
|
137
|
-
return column.
|
|
137
|
+
return column.filterable;
|
|
138
138
|
}
|
|
139
139
|
else if (functionType == 'quickfilter') {
|
|
140
|
-
return this.api.columnApi.usesAdaptableQuickFilter(column.
|
|
140
|
+
return this.api.columnApi.usesAdaptableQuickFilter(column.columnId);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
return true;
|
|
@@ -22,7 +22,8 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
22
22
|
}
|
|
23
23
|
if (this.api.internalApi.getAdaptableOptions().notificationsOptions
|
|
24
24
|
.dataChangeDetectionPolicy === 'formattedValue') {
|
|
25
|
-
const { oldValue, newValue
|
|
25
|
+
const { oldValue, newValue } = dataChangedInfo;
|
|
26
|
+
const columnId = dataChangedInfo.column.columnId;
|
|
26
27
|
const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, oldValue);
|
|
27
28
|
const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, newValue);
|
|
28
29
|
if (oldFormattedValue === newFormattedValue) {
|
|
@@ -50,7 +51,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
50
51
|
else if (this.api.scopeApi.scopeHasColumns(alertDefinition.Scope)) {
|
|
51
52
|
return this.api.scopeApi
|
|
52
53
|
.getColumnsForScope(alertDefinition.Scope)
|
|
53
|
-
.map((adaptableColumn) => adaptableColumn.
|
|
54
|
+
.map((adaptableColumn) => adaptableColumn.columnId);
|
|
54
55
|
}
|
|
55
56
|
return [];
|
|
56
57
|
}
|
|
@@ -192,7 +193,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
192
193
|
}
|
|
193
194
|
addColumnMenuItems(column) {
|
|
194
195
|
if (column && this.isModuleEditable()) {
|
|
195
|
-
if (!this.api.columnApi.isCalculatedColumn(column.
|
|
196
|
+
if (!this.api.columnApi.isCalculatedColumn(column.columnId)) {
|
|
196
197
|
const flashingAlertDefinitions = this.api.alertApi.getFlashingAlertDefinitions();
|
|
197
198
|
const flashingAlertForCurrentColumn = flashingAlertDefinitions.find((flashingAlertDefinition) => {
|
|
198
199
|
return this.api.scopeApi.isColumnInScope(column, flashingAlertDefinition.Scope);
|
|
@@ -205,7 +206,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
205
206
|
return [
|
|
206
207
|
this.createColumnMenuItemReduxAction('Add Flashing Alert', this.moduleInfo.Glyph, AlertRedux.FlashingAlertDefinitionAdd({
|
|
207
208
|
Scope: {
|
|
208
|
-
ColumnIds: [column.
|
|
209
|
+
ColumnIds: [column.columnId],
|
|
209
210
|
},
|
|
210
211
|
Rule: {
|
|
211
212
|
Predicate: { PredicateId: 'Any' },
|
|
@@ -229,7 +230,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
232
|
const flashingAlertForRow = this.api.internalApi.getAdaptableFlashingAlertFor(menuContext.primaryKeyValue);
|
|
232
|
-
const flashingAlertForCell = this.api.internalApi.getAdaptableFlashingAlertFor(menuContext.primaryKeyValue, menuContext.adaptableColumn.
|
|
233
|
+
const flashingAlertForCell = this.api.internalApi.getAdaptableFlashingAlertFor(menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
|
|
233
234
|
if (flashingAlertForRow && flashingAlertForRow.flashTarget === 'row') {
|
|
234
235
|
items.push(this.createColumnMenuItemReduxAction('Clear Flashing Alert for Row', this.moduleInfo.Glyph, SystemRedux.SystemFlashingAlertDelete(flashingAlertForRow)));
|
|
235
236
|
}
|
|
@@ -272,12 +273,12 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
272
273
|
showAlertForDefinitions(dataChangedInfo, alertDefinitions = []) {
|
|
273
274
|
alertDefinitions.forEach((alertDefinition) => {
|
|
274
275
|
// might be better to do a single alert with all the messages?
|
|
275
|
-
this.api.alertApi.showAlert(
|
|
276
|
+
this.api.alertApi.showAlert(dataChangedInfo.column.friendlyName, this.api.alertApi.getAlertDescription(alertDefinition, dataChangedInfo), alertDefinition, dataChangedInfo);
|
|
276
277
|
});
|
|
277
278
|
}
|
|
278
279
|
showFlashingAlertsForDefinitions(dataChangedInfo, flashingAlertDefinitions = []) {
|
|
279
|
-
const allColumnIds = this.api.columnApi.getColumns().map((c) => c.
|
|
280
|
-
const columnDataType =
|
|
280
|
+
const allColumnIds = this.api.columnApi.getColumns().map((c) => c.columnId);
|
|
281
|
+
const columnDataType = dataChangedInfo.column.dataType;
|
|
281
282
|
const numeric = columnDataType === 'Number';
|
|
282
283
|
const isComparableType = numeric || columnDataType === 'Date';
|
|
283
284
|
let up = false;
|
|
@@ -292,7 +293,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
292
293
|
}
|
|
293
294
|
flashingAlertDefinitions.forEach((flashingAlertDefinition) => {
|
|
294
295
|
const flashTarget = this.api.alertApi.getFlashingAlertFlashTarget(flashingAlertDefinition);
|
|
295
|
-
const flashColumnIds = { [dataChangedInfo.columnId]: true };
|
|
296
|
+
const flashColumnIds = { [dataChangedInfo.column.columnId]: true };
|
|
296
297
|
if (flashTarget === 'row') {
|
|
297
298
|
allColumnIds.forEach((colId) => {
|
|
298
299
|
flashColumnIds[colId] = true;
|
|
@@ -319,7 +320,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
319
320
|
}
|
|
320
321
|
getBaseAlertDefinitionsForDataChange(dataChangedEvent, definitions, defaultNoPredicateReturn = false) {
|
|
321
322
|
let relatedAlertDefinitions = definitions
|
|
322
|
-
.filter((v) => this.api.scopeApi.isColumnInScope(
|
|
323
|
+
.filter((v) => this.api.scopeApi.isColumnInScope(dataChangedEvent.column, v.Scope))
|
|
323
324
|
.filter((alertDefinition) => !AdaptableQuery_1.isReactiveQuery(alertDefinition.Rule));
|
|
324
325
|
let triggeredAlerts = [];
|
|
325
326
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(relatedAlertDefinitions)) {
|
|
@@ -353,7 +354,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
353
354
|
// TODO send real display value
|
|
354
355
|
displayValue: null,
|
|
355
356
|
node: dataChangedEvent.rowNode,
|
|
356
|
-
column:
|
|
357
|
+
column: dataChangedEvent.column,
|
|
357
358
|
}, defaultNoPredicateReturn);
|
|
358
359
|
}
|
|
359
360
|
getTeamSharingAction() {
|
|
@@ -20,7 +20,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
20
20
|
let menuItemShowPopup = undefined;
|
|
21
21
|
if (!menuContext.isRowGroupColumn && this.isModuleEditable()) {
|
|
22
22
|
if (menuContext.adaptableColumn &&
|
|
23
|
-
!menuContext.adaptableColumn.
|
|
23
|
+
!menuContext.adaptableColumn.readOnly &&
|
|
24
24
|
menuContext.isSelectedCell &&
|
|
25
25
|
menuContext.isSingleSelectedColumn &&
|
|
26
26
|
this.api.gridApi.areCellsEditable(menuContext.selectedCellInfo.gridCells)) {
|
|
@@ -70,7 +70,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
let selectedColumn = selectedCellInfo.columns[0];
|
|
73
|
-
if (selectedColumn && selectedColumn.
|
|
73
|
+
if (selectedColumn && selectedColumn.readOnly) {
|
|
74
74
|
return {
|
|
75
75
|
IsValid: false,
|
|
76
76
|
Alert: {
|
|
@@ -102,9 +102,9 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
102
102
|
let columnId = '';
|
|
103
103
|
if (!this.api.internalApi.isGridInPivotMode()) {
|
|
104
104
|
if (selectedCellInfo != null && selectedCellInfo.columns.length > 0) {
|
|
105
|
-
columnId = selectedCellInfo.columns[0].
|
|
105
|
+
columnId = selectedCellInfo.columns[0].columnId;
|
|
106
106
|
let typedBulkUpdateValue;
|
|
107
|
-
switch (selectedCellInfo.columns[0].
|
|
107
|
+
switch (selectedCellInfo.columns[0].dataType) {
|
|
108
108
|
case Enums_1.DataType.Number:
|
|
109
109
|
typedBulkUpdateValue = Number(bulkUpdateValue);
|
|
110
110
|
break;
|
|
@@ -119,7 +119,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
119
119
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
120
120
|
oldValue: selectedCell.rawValue,
|
|
121
121
|
newValue: typedBulkUpdateValue,
|
|
122
|
-
|
|
122
|
+
column: selectedCell.column,
|
|
123
123
|
primaryKeyValue: selectedCell.primaryKeyValue,
|
|
124
124
|
rowNode: selectedCell.rowNode,
|
|
125
125
|
trigger: 'edit',
|
|
@@ -40,7 +40,7 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
40
40
|
if (column && this.isModuleEditable()) {
|
|
41
41
|
if (this.api.calculatedColumnApi
|
|
42
42
|
.getAllCalculatedColumn()
|
|
43
|
-
.find((cc) => cc.ColumnId == column.
|
|
43
|
+
.find((cc) => cc.ColumnId == column.columnId)) {
|
|
44
44
|
let popupParam = {
|
|
45
45
|
column: column,
|
|
46
46
|
action: 'Edit',
|
|
@@ -38,14 +38,14 @@ class CellSummaryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
38
38
|
let allValues = [];
|
|
39
39
|
let numericColumns = [];
|
|
40
40
|
selectedCellInfo.columns.map((c) => {
|
|
41
|
-
if (c && c.
|
|
42
|
-
numericColumns.push(c.
|
|
41
|
+
if (c && c.dataType == Enums_1.DataType.Number) {
|
|
42
|
+
numericColumns.push(c.columnId);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
selectedCellInfo.gridCells.forEach((selectedCell) => {
|
|
46
46
|
let value = selectedCell.rawValue;
|
|
47
47
|
allValues.push(value);
|
|
48
|
-
if (ArrayExtensions_1.ArrayExtensions.ContainsItem(numericColumns, selectedCell.columnId)) {
|
|
48
|
+
if (ArrayExtensions_1.ArrayExtensions.ContainsItem(numericColumns, selectedCell.column.columnId)) {
|
|
49
49
|
let valueAsNumber = Number(value);
|
|
50
50
|
// possible that its not a number despite it being a numeric column
|
|
51
51
|
if (!isNaN(Number(valueAsNumber))) {
|
|
@@ -22,7 +22,7 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
22
22
|
else if (this.api.scopeApi.scopeHasColumns(conditionalStyle.Scope)) {
|
|
23
23
|
return this.api.scopeApi
|
|
24
24
|
.getColumnsForScope(conditionalStyle.Scope)
|
|
25
|
-
.map((adaptableColumn) => adaptableColumn.
|
|
25
|
+
.map((adaptableColumn) => adaptableColumn.columnId);
|
|
26
26
|
}
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
@@ -73,7 +73,7 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
73
73
|
this.api.conditionalStyleApi.editConditionalStyles(oldConditionalStyles);
|
|
74
74
|
}
|
|
75
75
|
addColumnMenuItems(column) {
|
|
76
|
-
if (column && this.isModuleEditable() && !column.
|
|
76
|
+
if (column && this.isModuleEditable() && !column.isSparkline) {
|
|
77
77
|
let conditionalStyles = this.api.conditionalStyleApi.getConditionalStylesForColumn(column);
|
|
78
78
|
let firstConditionalStyle = ArrayExtensions_1.default.IsNotNullOrEmpty(conditionalStyles)
|
|
79
79
|
? conditionalStyles.find((cs) => this.api.scopeApi.isColumnInScopeColumns(column, cs.Scope))
|
|
@@ -160,7 +160,7 @@ class ConditionalStyleModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
160
160
|
value: value,
|
|
161
161
|
oldValue: null,
|
|
162
162
|
displayValue: column
|
|
163
|
-
? this.api.gridApi.getDisplayValueFromRowNode(node, column.
|
|
163
|
+
? this.api.gridApi.getDisplayValueFromRowNode(node, column.columnId)
|
|
164
164
|
: value,
|
|
165
165
|
node: node,
|
|
166
166
|
column: column,
|
|
@@ -19,10 +19,10 @@ class CustomSortModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
21
|
addColumnMenuItems(column) {
|
|
22
|
-
if (column && this.isModuleEditable() && column.
|
|
22
|
+
if (column && this.isModuleEditable() && column.sortable) {
|
|
23
23
|
let customSort = this.api.customSortApi
|
|
24
24
|
.getAllCustomSort()
|
|
25
|
-
.find((x) => x.ColumnId == column.
|
|
25
|
+
.find((x) => x.ColumnId == column.columnId);
|
|
26
26
|
let label = customSort ? 'Edit ' : 'Create ';
|
|
27
27
|
// dont show a menu item if there is a custom sort that uses a comparer function
|
|
28
28
|
const columnSortComparer = this.api.internalApi.getCustomSortComparer(column);
|
|
@@ -26,7 +26,7 @@ class ExportModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
26
|
this.api.scopeApi.scopeHasColumns(report.Scope)) {
|
|
27
27
|
return this.api.scopeApi
|
|
28
28
|
.getColumnsForScope(report.Scope)
|
|
29
|
-
.map((adaptableColumn) => adaptableColumn.
|
|
29
|
+
.map((adaptableColumn) => adaptableColumn.columnId);
|
|
30
30
|
}
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
@@ -32,7 +32,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
32
32
|
let menuItemClickFunction = undefined;
|
|
33
33
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
34
34
|
if (menuContext.adaptableColumn &&
|
|
35
|
-
menuContext.adaptableColumn.
|
|
35
|
+
menuContext.adaptableColumn.filterable &&
|
|
36
36
|
menuContext.isSingleSelectedColumn &&
|
|
37
37
|
menuContext.gridCell != null) {
|
|
38
38
|
let isMultiple = menuContext.selectedCellInfo.gridCells.length > 1;
|
|
@@ -42,7 +42,7 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
42
42
|
})
|
|
43
43
|
: [menuContext.gridCell.primaryKeyValue];
|
|
44
44
|
let clickFunction = () => {
|
|
45
|
-
this.api.filterApi.createColumnFilterForCell(menuContext.adaptableColumn.
|
|
45
|
+
this.api.filterApi.createColumnFilterForCell(menuContext.adaptableColumn.columnId, pkValues);
|
|
46
46
|
};
|
|
47
47
|
menuItemClickFunction = this.createColumnMenuItemClickFunction(isMultiple ? 'Filter on Cell Values' : 'Filter on Cell Value', this.moduleInfo.Glyph, clickFunction);
|
|
48
48
|
}
|
|
@@ -53,14 +53,14 @@ class FilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
53
53
|
let baseMenuItems = [];
|
|
54
54
|
if (column && this.api.gridApi.isQuickFilterAvailable()) {
|
|
55
55
|
const isFilterVisible = this.api.filterApi.isQuickFilterVisible();
|
|
56
|
-
if (this.isModuleEditable() && this.api.columnApi.usesAdaptableQuickFilter(column.
|
|
56
|
+
if (this.isModuleEditable() && this.api.columnApi.usesAdaptableQuickFilter(column.columnId)) {
|
|
57
57
|
baseMenuItems.push(this.createColumnMenuItemReduxAction(isFilterVisible ? 'Hide Quick Filter Bar' : 'Show Quick Filter Bar', isFilterVisible ? 'unchecked' : 'check', isFilterVisible ? FilterRedux.QuickFilterBarHide() : FilterRedux.QuickFilterBarShow()));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
if (column && this.canCreateColumnMenuItem(column, 'ReadOnly', 'filter')) {
|
|
61
61
|
let existingColumnFilter = this.api.filterApi
|
|
62
62
|
.getAllColumnFilter()
|
|
63
|
-
.find((x) => x.ColumnId == column.
|
|
63
|
+
.find((x) => x.ColumnId == column.columnId);
|
|
64
64
|
if (existingColumnFilter) {
|
|
65
65
|
baseMenuItems.push(this.createColumnMenuItemReduxAction('Clear Filter', this.moduleInfo.Glyph, FilterRedux.ColumnFilterClear(existingColumnFilter)));
|
|
66
66
|
}
|