@adaptabletools/adaptable 15.4.1 → 15.4.2
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/bundle.cjs.js +105 -105
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
- package/src/Api/BulkUpdateApi.d.ts +3 -3
- package/src/Api/GridApi.d.ts +10 -19
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +2 -2
- package/src/Api/Implementation/BulkUpdateApiImpl.js +2 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +5 -13
- package/src/Api/Implementation/GridApiImpl.js +43 -13
- package/src/Api/Implementation/PlusMinusApiImpl.d.ts +2 -2
- package/src/Api/Implementation/PlusMinusApiImpl.js +2 -2
- package/src/Api/Implementation/SmartEditApiImpl.d.ts +2 -2
- package/src/Api/Implementation/SmartEditApiImpl.js +2 -2
- package/src/Api/Internal/ActionInternalApi.d.ts +0 -1
- package/src/Api/Internal/ActionInternalApi.js +0 -28
- package/src/Api/Internal/GridInternalApi.d.ts +0 -3
- package/src/Api/Internal/GridInternalApi.js +0 -23
- package/src/Api/PlusMinusApi.d.ts +3 -3
- package/src/Api/SmartEditApi.d.ts +3 -3
- package/src/PredefinedConfig/Selection/GridCell.d.ts +21 -0
- package/src/Redux/ActionsReducers/BulkUpdateRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/BulkUpdateRedux.js +2 -2
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +2 -2
- package/src/Redux/ActionsReducers/SmartEditRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/SmartEditRedux.js +2 -2
- package/src/Redux/Store/AdaptableStore.js +5 -5
- package/src/Strategy/CalculatedColumnModule.d.ts +4 -1
- package/src/Strategy/CalculatedColumnModule.js +30 -13
- package/src/Strategy/Interface/ISmartEditModule.d.ts +2 -2
- package/src/Strategy/PlusMinusModule.js +10 -1
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +2 -2
- package/src/Utilities/Helpers/PreviewHelper.d.ts +3 -1
- package/src/Utilities/Helpers/PreviewHelper.js +31 -1
- package/src/agGrid/Adaptable.d.ts +0 -1
- package/src/agGrid/Adaptable.js +0 -3
- package/src/metamodel/adaptable.metamodel.d.ts +16 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
-
import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
|
|
4
|
+
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
5
5
|
import * as CalculatedColumnRedux from '../Redux/ActionsReducers/CalculatedColumnRedux';
|
|
6
6
|
import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
|
|
7
7
|
import { CalculatedColumn } from '../PredefinedConfig/CalculatedColumnState';
|
|
@@ -16,7 +16,10 @@ export declare class CalculatedColumnModule extends AdaptableModuleBase implemen
|
|
|
16
16
|
updateOldConfig(): void;
|
|
17
17
|
getExplicitlyReferencedColumnIds(calculatedColumn: CalculatedColumn): string[];
|
|
18
18
|
getReferencedNamedQueryNames(calculatedColumn: CalculatedColumn): string[];
|
|
19
|
+
private isCalculatedColumn;
|
|
19
20
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
21
|
+
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
22
|
+
createEditCalculatedColumnMenuItem(column: AdaptableColumn): AdaptableMenuItem[];
|
|
20
23
|
getTeamSharingAction(): TeamSharingImportInfo<CalculatedColumn>;
|
|
21
24
|
toView(calculateColumn: CalculatedColumn): {
|
|
22
25
|
items: AdaptableObjectItemView[];
|
|
@@ -10,6 +10,7 @@ const CalculatedColumnWizard_1 = require("../View/CalculatedColumn/Wizard/Calcul
|
|
|
10
10
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
11
11
|
const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
|
|
12
12
|
const getCalculatedColumnSettingsTags_1 = require("../View/CalculatedColumn/Utilities/getCalculatedColumnSettingsTags");
|
|
13
|
+
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
13
14
|
class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
14
15
|
constructor(api) {
|
|
15
16
|
super(ModuleConstants.CalculatedColumnModuleId, ModuleConstants.CalculatedColumnFriendlyName, 'chart-and-grid', 'CalculatedColumnPopup', 'Create bespoke columns whose cell value is derived dynamically from an Expression', api);
|
|
@@ -51,22 +52,38 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
51
52
|
var _a;
|
|
52
53
|
return ((_a = this.api.queryApi.internalApi.getReferencedNamedQueryNames(this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query))) !== null && _a !== void 0 ? _a : []);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
isCalculatedColumn(column) {
|
|
56
|
+
return (column &&
|
|
57
|
+
Helper_1.default.objectExists(this.api.calculatedColumnApi
|
|
57
58
|
.getCalculatedColumns()
|
|
58
|
-
.find((cc) => cc.ColumnId == column.columnId))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
return [
|
|
65
|
-
this.createColumnMenuItemShowPopup('Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
66
|
-
];
|
|
67
|
-
}
|
|
59
|
+
.find((cc) => cc.ColumnId == column.columnId)));
|
|
60
|
+
}
|
|
61
|
+
addColumnMenuItems(column) {
|
|
62
|
+
if (this.isModuleEditable() && this.isCalculatedColumn(column)) {
|
|
63
|
+
return this.createEditCalculatedColumnMenuItem(column);
|
|
68
64
|
}
|
|
69
65
|
}
|
|
66
|
+
addContextMenuItems(menuContext) {
|
|
67
|
+
if (!this.isModuleAvailable()) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (this.isModuleEditable() &&
|
|
71
|
+
this.isCalculatedColumn(menuContext.adaptableColumn) &&
|
|
72
|
+
!menuContext.isRowGroupColumn &&
|
|
73
|
+
menuContext.isSingleSelectedCell) {
|
|
74
|
+
return this.createEditCalculatedColumnMenuItem(menuContext.adaptableColumn);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
createEditCalculatedColumnMenuItem(column) {
|
|
78
|
+
let popupParam = {
|
|
79
|
+
column: column,
|
|
80
|
+
action: 'Edit',
|
|
81
|
+
source: 'ColumnMenu',
|
|
82
|
+
};
|
|
83
|
+
return [
|
|
84
|
+
this.createColumnMenuItemShowPopup('Edit Calculated Column', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
|
|
85
|
+
];
|
|
86
|
+
}
|
|
70
87
|
getTeamSharingAction() {
|
|
71
88
|
return {
|
|
72
89
|
ModuleEntities: this.api.calculatedColumnApi.getCalculatedColumns(),
|
|
@@ -2,9 +2,9 @@ import { IModule } from './IModule';
|
|
|
2
2
|
import { IModuleActionReturn } from './IModuleActionReturn';
|
|
3
3
|
import { MathOperation } from '../../PredefinedConfig/Common/Enums';
|
|
4
4
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
5
|
-
import {
|
|
5
|
+
import { CellUpdateRequest } from '../../PredefinedConfig/Selection/GridCell';
|
|
6
6
|
export interface ISmartEditModule extends IModule {
|
|
7
7
|
CheckCorrectCellSelection(): IModuleActionReturn<boolean>;
|
|
8
8
|
BuildPreviewValues(smartEditValue: number, smartEditOperation: MathOperation): PreviewInfo;
|
|
9
|
-
ApplySmartEdit(
|
|
9
|
+
ApplySmartEdit(cellUpdateRequests: CellUpdateRequest[]): void;
|
|
10
10
|
}
|
|
@@ -144,7 +144,16 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
144
144
|
});
|
|
145
145
|
this.ShowErrorPreventMessage(failedPreventEdits);
|
|
146
146
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(successfulValues)) {
|
|
147
|
-
|
|
147
|
+
const cellUpdateRequests = [];
|
|
148
|
+
successfulValues.forEach((gridCell) => {
|
|
149
|
+
cellUpdateRequests.push({
|
|
150
|
+
columnId: gridCell.column.columnId,
|
|
151
|
+
newValue: gridCell.normalisedValue,
|
|
152
|
+
primaryKeyValue: gridCell.primaryKeyValue,
|
|
153
|
+
rowNode: gridCell.rowNode,
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
this.api.plusMinusApi.applyPlusMinus(cellUpdateRequests);
|
|
148
157
|
}
|
|
149
158
|
return shouldApplyPlusMinus;
|
|
150
159
|
}
|
|
@@ -2,7 +2,7 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
|
2
2
|
import { IModuleActionReturn } from './Interface/IModuleActionReturn';
|
|
3
3
|
import { ISmartEditModule } from './Interface/ISmartEditModule';
|
|
4
4
|
import { PreviewInfo } from '../Utilities/Interface/Preview';
|
|
5
|
-
import {
|
|
5
|
+
import { CellUpdateRequest } from '../PredefinedConfig/Selection/GridCell';
|
|
6
6
|
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
7
7
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
8
8
|
import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
|
|
@@ -11,7 +11,7 @@ export declare class SmartEditModule extends AdaptableModuleBase implements ISma
|
|
|
11
11
|
constructor(api: AdaptableApi);
|
|
12
12
|
getViewAccessLevel(): AccessLevel;
|
|
13
13
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
14
|
-
ApplySmartEdit(
|
|
14
|
+
ApplySmartEdit(cellUpdateRequests: CellUpdateRequest[]): void;
|
|
15
15
|
CheckCorrectCellSelection(): IModuleActionReturn<boolean>;
|
|
16
16
|
BuildPreviewValues(smartEditValue: number, smartEditOperation: SmartEditOperation): PreviewInfo;
|
|
17
17
|
}
|
|
@@ -41,8 +41,8 @@ class SmartEditModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
41
41
|
}
|
|
42
42
|
return [menuItemShowPopup];
|
|
43
43
|
}
|
|
44
|
-
ApplySmartEdit(
|
|
45
|
-
this.api.smartEditApi.applySmartEdit(
|
|
44
|
+
ApplySmartEdit(cellUpdateRequests) {
|
|
45
|
+
this.api.smartEditApi.applySmartEdit(cellUpdateRequests);
|
|
46
46
|
}
|
|
47
47
|
CheckCorrectCellSelection() {
|
|
48
48
|
let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PreviewResult, PreviewValidationSummary, PreviewInfo } from '../Interface/Preview';
|
|
2
|
-
import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
|
|
2
|
+
import { CellUpdateRequest, GridCell } from '../../PredefinedConfig/Selection/GridCell';
|
|
3
3
|
export declare function GetPreviewValidationSummary(previewResults: PreviewResult[]): PreviewValidationSummary;
|
|
4
4
|
export declare function GetValidationMessage(previewInfo: PreviewInfo, newValue: string): string;
|
|
5
5
|
export declare function GetCellInfosFromPreview(previewInfo: PreviewInfo, bypassValidationWarnings: boolean): GridCell[];
|
|
6
|
+
export declare function GetCellUpdateRequestsFromPreview(previewInfo: PreviewInfo, bypassValidationWarnings: boolean): CellUpdateRequest[];
|
|
6
7
|
export declare const PreviewHelper: {
|
|
7
8
|
GetPreviewValidationSummary: typeof GetPreviewValidationSummary;
|
|
8
9
|
GetValidationMessage: typeof GetValidationMessage;
|
|
9
10
|
GetCellInfosFromPreview: typeof GetCellInfosFromPreview;
|
|
11
|
+
GetCellUpdateRequestsFromPreview: typeof GetCellUpdateRequestsFromPreview;
|
|
10
12
|
};
|
|
11
13
|
export default PreviewHelper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PreviewHelper = exports.GetCellInfosFromPreview = exports.GetValidationMessage = exports.GetPreviewValidationSummary = void 0;
|
|
3
|
+
exports.PreviewHelper = exports.GetCellUpdateRequestsFromPreview = exports.GetCellInfosFromPreview = exports.GetValidationMessage = exports.GetPreviewValidationSummary = void 0;
|
|
4
4
|
const StringExtensions_1 = require("../Extensions/StringExtensions");
|
|
5
5
|
function GetPreviewValidationSummary(previewResults) {
|
|
6
6
|
let hasAnyValidation = false;
|
|
@@ -65,9 +65,39 @@ function GetCellInfosFromPreview(previewInfo, bypassValidationWarnings) {
|
|
|
65
65
|
return newValues;
|
|
66
66
|
}
|
|
67
67
|
exports.GetCellInfosFromPreview = GetCellInfosFromPreview;
|
|
68
|
+
function GetCellUpdateRequestsFromPreview(previewInfo, bypassValidationWarnings) {
|
|
69
|
+
let newValues = [];
|
|
70
|
+
if (bypassValidationWarnings) {
|
|
71
|
+
for (let previewResult of previewInfo.previewResults) {
|
|
72
|
+
if (previewResult.validationRules.length == 0) {
|
|
73
|
+
newValues.push({
|
|
74
|
+
primaryKeyValue: previewResult.id,
|
|
75
|
+
newValue: previewResult.computedValue,
|
|
76
|
+
rowNode: previewResult.rowNode,
|
|
77
|
+
columnId: previewInfo.column.columnId,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
previewInfo.previewResults
|
|
84
|
+
.filter((p) => p.validationRules.length == 0)
|
|
85
|
+
.forEach((pr) => {
|
|
86
|
+
newValues.push({
|
|
87
|
+
primaryKeyValue: pr.id,
|
|
88
|
+
columnId: previewInfo.column.columnId,
|
|
89
|
+
newValue: pr.computedValue,
|
|
90
|
+
rowNode: pr.rowNode,
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return newValues;
|
|
95
|
+
}
|
|
96
|
+
exports.GetCellUpdateRequestsFromPreview = GetCellUpdateRequestsFromPreview;
|
|
68
97
|
exports.PreviewHelper = {
|
|
69
98
|
GetPreviewValidationSummary,
|
|
70
99
|
GetValidationMessage,
|
|
71
100
|
GetCellInfosFromPreview,
|
|
101
|
+
GetCellUpdateRequestsFromPreview,
|
|
72
102
|
};
|
|
73
103
|
exports.default = exports.PreviewHelper;
|
|
@@ -199,7 +199,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
199
199
|
setSelectedCells(): SelectedCellInfo | undefined;
|
|
200
200
|
setSelectedRows(): SelectedRowInfo | undefined;
|
|
201
201
|
setDataValue(value: any, column: AdaptableColumn, primaryKeyValue: any, rowNode?: IRowNode): void;
|
|
202
|
-
setCellValue(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
203
202
|
cancelEdit(): void;
|
|
204
203
|
isCellEditable(rowNode: IRowNode, column: Column): boolean;
|
|
205
204
|
getGridCellsForColumn(columnId: string): GridCell[] | undefined;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -1779,9 +1779,6 @@ class Adaptable {
|
|
|
1779
1779
|
}
|
|
1780
1780
|
}
|
|
1781
1781
|
}
|
|
1782
|
-
setCellValue(cellDataChangedInfo) {
|
|
1783
|
-
this.setDataValue(cellDataChangedInfo.newValue, cellDataChangedInfo.column, cellDataChangedInfo.primaryKeyValue, cellDataChangedInfo.rowNode);
|
|
1784
|
-
}
|
|
1785
1782
|
cancelEdit() {
|
|
1786
1783
|
this.gridOptions.api.stopEditing(true);
|
|
1787
1784
|
}
|
|
@@ -1387,6 +1387,22 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1387
1387
|
kind: string;
|
|
1388
1388
|
desc: string;
|
|
1389
1389
|
};
|
|
1390
|
+
CellUpdateRequest: {
|
|
1391
|
+
name: string;
|
|
1392
|
+
kind: string;
|
|
1393
|
+
desc: string;
|
|
1394
|
+
props: ({
|
|
1395
|
+
name: string;
|
|
1396
|
+
kind: string;
|
|
1397
|
+
desc: string;
|
|
1398
|
+
isOpt?: undefined;
|
|
1399
|
+
} | {
|
|
1400
|
+
name: string;
|
|
1401
|
+
kind: string;
|
|
1402
|
+
desc: string;
|
|
1403
|
+
isOpt: boolean;
|
|
1404
|
+
})[];
|
|
1405
|
+
};
|
|
1390
1406
|
ChartContainer: {
|
|
1391
1407
|
name: string;
|
|
1392
1408
|
kind: string;
|