@adaptabletools/adaptable 11.1.0 → 11.1.1-canary.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/LICENSE.md +5 -5
- package/agGrid.d.ts +2 -2
- package/base.css +4 -6
- package/bundle.cjs.js +67 -67
- package/index.css +4 -6
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -2
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -2
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +8 -12
- package/src/Api/AlertApi.d.ts +3 -5
- package/src/Api/DataChangeHistoryApi.d.ts +3 -3
- package/src/Api/Events/CellChanged.d.ts +2 -2
- package/src/Api/ExportApi.d.ts +3 -3
- package/src/Api/FreeTextColumnApi.d.ts +3 -3
- package/src/Api/GridApi.d.ts +4 -4
- package/src/Api/Implementation/AlertApiImpl.d.ts +3 -3
- package/src/Api/Implementation/AlertApiImpl.js +20 -20
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +3 -3
- package/src/Api/Implementation/EventApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ExportApiImpl.js +7 -8
- package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -7
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +5 -5
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -2
- package/src/Api/Implementation/InternalApiImpl.js +6 -6
- package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -1
- package/src/Api/InternalApi.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableFlashingCell.d.ts +2 -2
- package/src/PredefinedConfig/Common/{DataChangedInfo.d.ts → CellDataChangedInfo.d.ts} +1 -5
- package/src/PredefinedConfig/Common/{DataChangedInfo.js → CellDataChangedInfo.js} +0 -0
- package/src/PredefinedConfig/Common/DataChangedScope.d.ts +4 -0
- package/src/PredefinedConfig/Common/DataChangedScope.js +2 -0
- package/src/PredefinedConfig/SystemState.d.ts +2 -2
- package/src/Redux/ActionsReducers/GridRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +5 -5
- package/src/Redux/Store/AdaptableStore.js +15 -15
- package/src/Strategy/AlertModule.js +12 -10
- package/src/Strategy/BulkUpdateModule.js +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +8 -6
- package/src/Strategy/FlashingCellModule.d.ts +2 -2
- package/src/Strategy/FlashingCellModule.js +21 -15
- package/src/Strategy/FormatColumnModule.js +4 -2
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +6 -3
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ObjectFactory.d.ts +2 -2
- package/src/Utilities/ObjectFactory.js +2 -2
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +3 -3
- package/src/Utilities/Services/DataService.d.ts +5 -5
- package/src/Utilities/Services/DataService.js +12 -10
- package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IDataService.d.ts +6 -6
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/Interface/IValidationService.d.ts +4 -4
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/ValidationService.d.ts +4 -4
- package/src/Utilities/Services/ValidationService.js +17 -17
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +2 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +1 -6
- package/src/agGrid/ActionColumnRenderer.js +50 -59
- package/src/agGrid/Adaptable.d.ts +3 -2
- package/src/agGrid/Adaptable.js +54 -49
- package/src/metamodel/adaptable.metamodel.d.ts +34 -34
- package/src/metamodel/adaptable.metamodel.js +73 -73
- package/src/types.d.ts +7 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/src/Utilities/Emitter.js
CHANGED
|
@@ -100,13 +100,16 @@ class Emittery {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
onIncludeFiredOnce(eventName) {
|
|
103
|
+
onIncludeFiredOnce(eventName, listener) {
|
|
104
104
|
const triggeredEventsMap = triggeredMap.get(this);
|
|
105
105
|
const eventInfo = triggeredEventsMap.get(eventName);
|
|
106
106
|
if (eventInfo) {
|
|
107
|
-
|
|
107
|
+
listener(eventInfo.data);
|
|
108
|
+
return () => { };
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return this.on(eventName, listener);
|
|
108
112
|
}
|
|
109
|
-
return this.once(eventName);
|
|
110
113
|
}
|
|
111
114
|
onIncludeFired(eventName, listener) {
|
|
112
115
|
const triggeredEventsMap = triggeredMap.get(this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
-
declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
2
|
+
export declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
3
3
|
declare type AggregationFunction = 'SUM';
|
|
4
4
|
declare type ComparisonFunction = 'EQ' | 'NEQ' | 'LT' | 'GT' | 'LTE' | 'GTE';
|
|
5
5
|
export declare const aggregatedBooleanExpressionFunctions: Record<AggregationFunctionName, ExpressionFunction>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExpressionContext } from '../../parser/src/types';
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
export interface BaseParameter<T = string, N = string> {
|
|
6
6
|
type: T;
|
|
7
7
|
name: N;
|
|
@@ -12,7 +12,7 @@ export interface ColumnParameter extends BaseParameter<'config', 'COL'> {
|
|
|
12
12
|
export declare const getStringValues: (context: ExpressionContext, ...stringArguments: string[]) => string[];
|
|
13
13
|
export declare const getStringValue: (context: ExpressionContext, stringArgument: string) => string;
|
|
14
14
|
export declare const isTextSearchCaseInsensitive: (context: ExpressionContext) => boolean;
|
|
15
|
-
export declare const getDataChangeLog$: (context: ExpressionContext, columnNameFilter: string) => Observable<
|
|
15
|
+
export declare const getDataChangeLog$: (context: ExpressionContext, columnNameFilter: string) => Observable<CellDataChangedInfo>;
|
|
16
16
|
export declare const handleWhereFunction: (args: any[], context: ExpressionContext) => any;
|
|
17
17
|
export declare const extractColumnParameter: (consumingFunctionName: string, args: BaseParameter[]) => ColumnParameter;
|
|
18
18
|
export declare const extractParameter: <T extends BaseParameter<string, string>>(consumingFunctionName: string, allowedType: T["type"], allowedOperands: T["name"][], args: BaseParameter[], isOptional?: boolean) => T;
|
|
@@ -18,7 +18,7 @@ exports.getStringValue = (context, stringArgument) => {
|
|
|
18
18
|
return exports.isTextSearchCaseInsensitive(context) ? stringArgument.toLowerCase() : stringArgument;
|
|
19
19
|
};
|
|
20
20
|
exports.isTextSearchCaseInsensitive = (context) => !context.api.internalApi.isTextComparisonCaseSensitive();
|
|
21
|
-
// returns an observable which filters the source$ emissions and emits only if the
|
|
21
|
+
// returns an observable which filters the source$ emissions and emits only if the CellDataChangedInfo relates to the given column
|
|
22
22
|
// optionally, if a filter function (where clause) is provided, it is also evaluated
|
|
23
23
|
exports.getDataChangeLog$ = (context, columnNameFilter) => {
|
|
24
24
|
let dataChangeLog$ = context.api.internalApi.getDataService().dataChangeLog$;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
-
declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | ObservableFunction | ChangeFunction;
|
|
2
|
+
export declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | ObservableFunction | ChangeFunction;
|
|
3
3
|
declare type ObservableFunction = 'ROW_CHANGE' | 'GRID_CHANGE';
|
|
4
4
|
declare type ChangeFunction = 'MAX' | 'MIN' | 'NONE' | 'COUNT';
|
|
5
5
|
export declare const observableExpressionFunctions: Record<ObservableFunctionName, ExpressionFunction>;
|
|
@@ -13,7 +13,7 @@ import { ConditionalStyle } from '../PredefinedConfig/ConditionalStyleState';
|
|
|
13
13
|
import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
|
|
14
14
|
import { FreeTextColumn } from '../PredefinedConfig/FreeTextColumnState';
|
|
15
15
|
import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
|
|
16
|
-
import {
|
|
16
|
+
import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
|
|
17
17
|
import { Glue42Report, Glue42Schedule } from '../PredefinedConfig/Glue42State';
|
|
18
18
|
import { IPushPullReport } from '../PredefinedConfig/SystemState';
|
|
19
19
|
import { IPushPullSchedule } from '../PredefinedConfig/IPushPullState';
|
|
@@ -34,7 +34,7 @@ export declare function CreateEmptyCalculatedColumn(isFilterable: boolean): Calc
|
|
|
34
34
|
export declare function CreateEmptyNamedQuery(expression?: string): NamedQuery;
|
|
35
35
|
export declare function CreateEmptyPlusMinusNudge(): PlusMinusNudge;
|
|
36
36
|
export declare function CreateGenericAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition): AdaptableGenericAlert;
|
|
37
|
-
export declare function CreateCellChangedAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition,
|
|
37
|
+
export declare function CreateCellChangedAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition, cellDataChangedInfo: CellDataChangedInfo): AdaptableCellChangedAlert;
|
|
38
38
|
export declare function CreateRowChangedAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition, gridDataChange: GridDataChangedInfo): AdaptableRowChangedAlert;
|
|
39
39
|
export declare function CreateEmptyAlertDefinition(): AlertDefinition;
|
|
40
40
|
export declare function CreateEmptyFlashingCellDefinition(): FlashingCellDefinition;
|
|
@@ -61,14 +61,14 @@ function CreateGenericAlert(alertHeader, alertMessage, alertDefinition) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
exports.CreateGenericAlert = CreateGenericAlert;
|
|
64
|
-
function CreateCellChangedAlert(alertHeader, alertMessage, alertDefinition,
|
|
64
|
+
function CreateCellChangedAlert(alertHeader, alertMessage, alertDefinition, cellDataChangedInfo) {
|
|
65
65
|
return {
|
|
66
66
|
alertType: 'cellChanged',
|
|
67
67
|
Uuid: Uuid_1.createUuid(),
|
|
68
68
|
header: alertHeader,
|
|
69
69
|
message: alertMessage,
|
|
70
70
|
alertDefinition,
|
|
71
|
-
|
|
71
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
exports.CreateCellChangedAlert = CreateCellChangedAlert;
|
|
@@ -12,8 +12,8 @@ class CalculatedColumnExpressionService {
|
|
|
12
12
|
this.adaptable = adaptable;
|
|
13
13
|
this.adaptable.api.internalApi
|
|
14
14
|
.getDataService()
|
|
15
|
-
.on('
|
|
16
|
-
if (
|
|
15
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
16
|
+
if (cellDataChangedInfo.trigger === 'aggChange') {
|
|
17
17
|
// do NOT handle changes on group rows
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ class CalculatedColumnExpressionService {
|
|
|
21
21
|
this.aggregatedScalarCalculatedColumnsMap.forEach((aggregatedScalarCalculatedColumn) => {
|
|
22
22
|
if (aggregatedScalarCalculatedColumn
|
|
23
23
|
.getColumnDependencies()
|
|
24
|
-
.includes(
|
|
24
|
+
.includes(cellDataChangedInfo.column.columnId)) {
|
|
25
25
|
aggregatedScalarCalculatedColumn.refreshAggregatedColumnValue();
|
|
26
26
|
refreshedCalculatedColumns.push(aggregatedScalarCalculatedColumn.getCalculatedColumnId());
|
|
27
27
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { IDataService } from './Interface/IDataService';
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
import {
|
|
3
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
4
4
|
import { EmitterCallback } from '../../Utilities/Emitter';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
export declare class DataService implements IDataService {
|
|
7
7
|
private adaptable;
|
|
8
8
|
private emitter;
|
|
9
9
|
private readonly dataChangeLogSubject$;
|
|
10
|
-
dataChangeLog$: Observable<
|
|
10
|
+
dataChangeLog$: Observable<CellDataChangedInfo>;
|
|
11
11
|
private undoChangeLog;
|
|
12
12
|
private undoChangeTimers;
|
|
13
13
|
constructor(adaptable: IAdaptable);
|
|
14
14
|
on: (eventName: string, callback: EmitterCallback) => (() => void);
|
|
15
15
|
emit: (eventName: string, data?: any) => Promise<any>;
|
|
16
|
-
CreateDataChangedEvent(
|
|
17
|
-
logUndoChange(change:
|
|
18
|
-
extractUndoChange(change:
|
|
16
|
+
CreateDataChangedEvent(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
17
|
+
logUndoChange(change: CellDataChangedInfo): void;
|
|
18
|
+
extractUndoChange(change: CellDataChangedInfo): CellDataChangedInfo | undefined;
|
|
19
19
|
destroy(): void;
|
|
20
20
|
private getUndoChangeKey;
|
|
21
21
|
private logDataChange;
|
|
@@ -20,11 +20,11 @@ class DataService {
|
|
|
20
20
|
this.undoChangeLog = new Map();
|
|
21
21
|
this.undoChangeTimers = new Map();
|
|
22
22
|
}
|
|
23
|
-
CreateDataChangedEvent(
|
|
24
|
-
if (
|
|
25
|
-
this.emitter.emitSync('
|
|
26
|
-
this.adaptable.api.gridApi.fireCellChangedEvent(
|
|
27
|
-
this.logDataChange(
|
|
23
|
+
CreateDataChangedEvent(cellDataChangedInfo) {
|
|
24
|
+
if (cellDataChangedInfo.newValue != cellDataChangedInfo.oldValue) {
|
|
25
|
+
this.emitter.emitSync('CellDataChanged', cellDataChangedInfo);
|
|
26
|
+
this.adaptable.api.gridApi.fireCellChangedEvent(cellDataChangedInfo);
|
|
27
|
+
this.logDataChange(cellDataChangedInfo);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
// we need this temporary "shared memory" because the value change and the AG Grid cellChanged event are asynchronous
|
|
@@ -69,16 +69,18 @@ class DataService {
|
|
|
69
69
|
newValue,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
logDataChange(
|
|
73
|
-
const dataChangeLogEntry = this.extractDataChangeLogEntry(
|
|
72
|
+
logDataChange(cellDataChangedInfo) {
|
|
73
|
+
const dataChangeLogEntry = this.extractDataChangeLogEntry(cellDataChangedInfo);
|
|
74
74
|
this.dataChangeLogSubject$.next(dataChangeLogEntry);
|
|
75
75
|
}
|
|
76
|
-
extractDataChangeLogEntry(
|
|
76
|
+
extractDataChangeLogEntry(cellDataChangedInfo) {
|
|
77
77
|
// create rowData snapshot
|
|
78
|
-
const rowData =
|
|
78
|
+
const rowData = cellDataChangedInfo.rowData
|
|
79
|
+
? Helper_1.default.cloneObject(cellDataChangedInfo.rowData)
|
|
80
|
+
: null;
|
|
79
81
|
// strip down rowNode properties as it is pretty "heavy" on the memory
|
|
80
82
|
const rowNode = rowData ? { data: rowData } : null;
|
|
81
|
-
return Object.assign(Object.assign({},
|
|
83
|
+
return Object.assign(Object.assign({}, cellDataChangedInfo), { rowNode,
|
|
82
84
|
rowData });
|
|
83
85
|
}
|
|
84
86
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
4
4
|
export declare type ReactiveAlertInfo = {
|
|
5
5
|
alertDefinition: AlertDefinition;
|
|
6
6
|
type: 'alert';
|
|
7
|
-
dataChangeLogEntry:
|
|
7
|
+
dataChangeLogEntry: CellDataChangedInfo;
|
|
8
8
|
};
|
|
9
9
|
export interface IAlertService extends IAdaptableService {
|
|
10
10
|
createReactiveAlert(alertDefinition: AlertDefinition): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
4
4
|
export interface IDataService extends IAdaptableService {
|
|
5
|
-
CreateDataChangedEvent(
|
|
6
|
-
on(eventName: '
|
|
7
|
-
readonly dataChangeLog$: Observable<
|
|
8
|
-
logUndoChange(undoChange:
|
|
9
|
-
extractUndoChange(undoChange:
|
|
5
|
+
CreateDataChangedEvent(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
6
|
+
on(eventName: 'CellDataChanged', callback: (cellDataChangedInfo: CellDataChangedInfo) => void): () => void;
|
|
7
|
+
readonly dataChangeLog$: Observable<CellDataChangedInfo>;
|
|
8
|
+
logUndoChange(undoChange: CellDataChangedInfo): void;
|
|
9
|
+
extractUndoChange(undoChange: CellDataChangedInfo): CellDataChangedInfo | undefined;
|
|
10
10
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { IAdaptableService } from './IAdaptableService';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
|
|
6
6
|
import { AggregationParameter } from '../../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
7
7
|
import { ModuleExpressionFunctions } from '../../../AdaptableOptions/AdaptableQLOptions';
|
|
8
8
|
export interface IQueryLanguageService extends IAdaptableService {
|
|
9
9
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: RowNode): boolean;
|
|
10
10
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
11
|
-
evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<
|
|
12
|
-
evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): Observable<
|
|
11
|
+
evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
12
|
+
evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
13
13
|
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
|
|
14
14
|
validateBoolean(expression: string, module: AdaptableModule, config?: {
|
|
15
15
|
force?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
2
2
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
4
4
|
export interface IValidationService extends IAdaptableService {
|
|
5
|
-
getValidationRulesForDataChange(
|
|
6
|
-
performValidation(
|
|
7
|
-
performServerValidation(
|
|
5
|
+
getValidationRulesForDataChange(cellDataChangedInfo: CellDataChangedInfo): AlertDefinition[];
|
|
6
|
+
performValidation(cellDataChangedInfo: CellDataChangedInfo): boolean;
|
|
7
|
+
performServerValidation(cellDataChangedInfo: CellDataChangedInfo, config: {
|
|
8
8
|
onServerValidationCompleted: () => void;
|
|
9
9
|
}): () => boolean;
|
|
10
10
|
createValidationDescription(alertDefinition: AlertDefinition): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IQueryLanguageService } from './Interface/IQueryLanguageService';
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
6
6
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
7
7
|
import { ModuleExpressionFunctions } from '../../AdaptableOptions/AdaptableQLOptions';
|
|
@@ -17,8 +17,8 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
17
17
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: any): any;
|
|
18
18
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
19
19
|
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
|
|
20
|
-
evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<
|
|
21
|
-
evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): Observable<
|
|
20
|
+
evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
21
|
+
evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
22
22
|
validateBoolean(expressionInput: string, module: AdaptableModule, config?: {
|
|
23
23
|
force?: boolean;
|
|
24
24
|
}): {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
import { IValidationService } from './Interface/IValidationService';
|
|
4
4
|
import { AlertDefinition } from '../../PredefinedConfig/AlertState';
|
|
5
5
|
export declare class ValidationService implements IValidationService {
|
|
6
6
|
private adaptable;
|
|
7
7
|
constructor(adaptable: IAdaptable);
|
|
8
|
-
getValidationRulesForDataChange(
|
|
9
|
-
performValidation(
|
|
8
|
+
getValidationRulesForDataChange(cellDataChangedInfo: CellDataChangedInfo): AlertDefinition[];
|
|
9
|
+
performValidation(cellDataChangedInfo: CellDataChangedInfo): boolean;
|
|
10
10
|
private IsAlertDefinitionTriggered;
|
|
11
|
-
performServerValidation(
|
|
11
|
+
performServerValidation(cellDataChangedInfo: CellDataChangedInfo, config: {
|
|
12
12
|
onServerValidationCompleted: () => void;
|
|
13
13
|
}): () => boolean;
|
|
14
14
|
createValidationDescription(alertDefinition: AlertDefinition): string;
|
|
@@ -11,28 +11,28 @@ class ValidationService {
|
|
|
11
11
|
this.adaptable = adaptable;
|
|
12
12
|
}
|
|
13
13
|
// Not sure where to put this: was in the Module but might be better here until I can work out a way of having an event with a callback...
|
|
14
|
-
getValidationRulesForDataChange(
|
|
14
|
+
getValidationRulesForDataChange(cellDataChangedInfo) {
|
|
15
15
|
// if the new value is the same as the old value then we can get out as we dont see it as an edit?
|
|
16
|
-
if (
|
|
16
|
+
if (cellDataChangedInfo.oldValue == cellDataChangedInfo.newValue) {
|
|
17
17
|
return [];
|
|
18
18
|
}
|
|
19
19
|
let editingRules = this.adaptable.api.alertApi
|
|
20
20
|
.getAlertDefinitionsWithPreventEdit()
|
|
21
|
-
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(
|
|
21
|
+
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(cellDataChangedInfo.column, v.Scope));
|
|
22
22
|
let failedValidations = [];
|
|
23
23
|
if (ArrayExtensions_1.ArrayExtensions.IsNotEmpty(editingRules)) {
|
|
24
24
|
editingRules.forEach((alertDefinition) => {
|
|
25
25
|
if (alertDefinition.Rule.BooleanExpression) {
|
|
26
|
-
let isSatisfiedExpression =
|
|
26
|
+
let isSatisfiedExpression = cellDataChangedInfo.rowNode != null &&
|
|
27
27
|
this.adaptable.api.internalApi
|
|
28
28
|
.getQueryLanguageService()
|
|
29
|
-
.evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId,
|
|
29
|
+
.evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId, cellDataChangedInfo.rowNode);
|
|
30
30
|
if (isSatisfiedExpression) {
|
|
31
31
|
failedValidations.push(alertDefinition);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
if (this.IsAlertDefinitionTriggered(alertDefinition,
|
|
35
|
+
if (this.IsAlertDefinitionTriggered(alertDefinition, cellDataChangedInfo)) {
|
|
36
36
|
failedValidations.push(alertDefinition);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -40,15 +40,15 @@ class ValidationService {
|
|
|
40
40
|
}
|
|
41
41
|
return failedValidations;
|
|
42
42
|
}
|
|
43
|
-
performValidation(
|
|
44
|
-
const failedRules = this.getValidationRulesForDataChange(
|
|
43
|
+
performValidation(cellDataChangedInfo) {
|
|
44
|
+
const failedRules = this.getValidationRulesForDataChange(cellDataChangedInfo);
|
|
45
45
|
if (failedRules.length > 0) {
|
|
46
46
|
let alert = {
|
|
47
47
|
alertType: 'cellChanged',
|
|
48
48
|
header: 'Alert',
|
|
49
49
|
message: 'Perform Edit Alert Fired',
|
|
50
50
|
alertDefinition: failedRules[0],
|
|
51
|
-
|
|
51
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
52
52
|
};
|
|
53
53
|
this.adaptable.api.alertApi.publishAlertFiredEvent(alert);
|
|
54
54
|
return false;
|
|
@@ -64,25 +64,25 @@ class ValidationService {
|
|
|
64
64
|
column: dataChangedEvent.column,
|
|
65
65
|
}, false);
|
|
66
66
|
}
|
|
67
|
-
performServerValidation(
|
|
67
|
+
performServerValidation(cellDataChangedInfo, config) {
|
|
68
68
|
return () => {
|
|
69
69
|
this.adaptable.adaptableOptions.editOptions
|
|
70
|
-
.validateOnServer(
|
|
70
|
+
.validateOnServer(cellDataChangedInfo)
|
|
71
71
|
.then((validationResult) => {
|
|
72
72
|
var _a, _b;
|
|
73
73
|
if (validationResult.NewValue === undefined) {
|
|
74
|
-
validationResult.NewValue =
|
|
74
|
+
validationResult.NewValue = cellDataChangedInfo.newValue;
|
|
75
75
|
}
|
|
76
76
|
// If they have changed the return value then we should update the grid, log the function change
|
|
77
77
|
// otherwise the value will persist
|
|
78
|
-
if (validationResult.NewValue !==
|
|
79
|
-
|
|
80
|
-
// this.adaptable.setValue(
|
|
81
|
-
const row = (_a =
|
|
78
|
+
if (validationResult.NewValue !== cellDataChangedInfo.newValue) {
|
|
79
|
+
cellDataChangedInfo.newValue = validationResult.NewValue;
|
|
80
|
+
// this.adaptable.setValue(cellDataChangedInfo, false);
|
|
81
|
+
const row = (_a = cellDataChangedInfo.rowNode) === null || _a === void 0 ? void 0 : _a.data;
|
|
82
82
|
if (!row) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(
|
|
85
|
+
row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(cellDataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : cellDataChangedInfo.column.columnId] = validationResult.NewValue;
|
|
86
86
|
this.adaptable.api.gridApi.updateGridData([row]);
|
|
87
87
|
if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
|
|
88
88
|
this.adaptable.adaptableOptions.editOptions.displayServerValidationMessages) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
export interface DataChangeHistoryGridProps {
|
|
4
4
|
adaptableContainerId: string;
|
|
5
5
|
agGridContainerId: string;
|
|
6
|
-
changeHistoryLog: Record<string,
|
|
6
|
+
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
7
7
|
onUndoChange: (changeKey: string) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const DataChangeHistoryGrid: (props: DataChangeHistoryGridProps) => JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
4
4
|
import { SystemDataChangeHistoryDisableAction, SystemDataChangeHistoryEnableAction, SystemDataChangeHistoryResumeAction, SystemDataChangeHistorySuspendAction } from '../../Redux/ActionsReducers/SystemRedux';
|
|
5
5
|
import { DataChangeHistoryMode } from '../../PredefinedConfig/SystemState';
|
|
6
6
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
7
7
|
interface DataChangeHistoryPopupProps extends ModuleViewPopupProps<DataChangeHistoryPopupComponent> {
|
|
8
|
-
changeHistoryLog: Record<string,
|
|
8
|
+
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
9
9
|
changeHistoryMode: DataChangeHistoryMode;
|
|
10
10
|
activationTime: Date;
|
|
11
11
|
suspensionTime: Date;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { ICellRendererComp, ICellRendererParams
|
|
2
|
-
export declare class CustomTooltip implements ITooltipComp {
|
|
3
|
-
private eGui;
|
|
4
|
-
init(params: ITooltipParams): void;
|
|
5
|
-
getGui(): any;
|
|
6
|
-
}
|
|
1
|
+
import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/all-modules';
|
|
7
2
|
export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
8
3
|
private eGui;
|
|
9
4
|
private eventListener;
|
|
@@ -1,85 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionColumnRenderer =
|
|
3
|
+
exports.ActionColumnRenderer = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButton"));
|
|
6
6
|
const react_dom_1 = require("react-dom");
|
|
7
7
|
const React = tslib_1.__importStar(require("react"));
|
|
8
|
-
|
|
9
|
-
init(params) {
|
|
10
|
-
this.eGui = document.createElement('div');
|
|
11
|
-
this.eGui.classList.add('custom-tooltip');
|
|
12
|
-
let { field, lastValidation, validationFailedMsg } = params.value;
|
|
13
|
-
this.eGui.innerHTML = `
|
|
14
|
-
<div class="validation-msg">
|
|
15
|
-
FIELD-${field.toUpperCase()} - invalid value:
|
|
16
|
-
"<span class="invalid-value"> ${lastValidation} </span>",
|
|
17
|
-
${validationFailedMsg}
|
|
18
|
-
</div>
|
|
19
|
-
`;
|
|
20
|
-
}
|
|
21
|
-
getGui() {
|
|
22
|
-
return this.eGui;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.CustomTooltip = CustomTooltip;
|
|
8
|
+
const uuid_1 = require("../components/utils/uuid");
|
|
26
9
|
class ActionColumnRenderer {
|
|
27
10
|
// gets called once before the renderer is used
|
|
28
11
|
init(params) {
|
|
29
12
|
var _a;
|
|
30
13
|
const adaptable = params.api.__adaptable;
|
|
31
|
-
|
|
14
|
+
const actionCol = (_a = adaptable.api.userInterfaceApi
|
|
32
15
|
.getAllActionColumn()) === null || _a === void 0 ? void 0 : _a.find((ac) => ac.columnId == params.colDef.colId);
|
|
33
|
-
if (actionCol) {
|
|
16
|
+
if (actionCol && actionCol.actionColumnButton) {
|
|
17
|
+
let actionButtons = Array.isArray(actionCol.actionColumnButton)
|
|
18
|
+
? actionCol.actionColumnButton
|
|
19
|
+
: [actionCol.actionColumnButton];
|
|
20
|
+
if (!actionButtons.length) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// actionButtons don't have IDs, so we need to generate them to be used later as a react component key
|
|
24
|
+
actionButtons = actionButtons.map((actionButton) => (Object.assign(Object.assign({}, actionButton), { Uuid: uuid_1.createUuid() })));
|
|
34
25
|
// create the cell
|
|
35
26
|
this.eGui = document.createElement('div');
|
|
36
27
|
this.eGui.className = 'ab-ActionColumn';
|
|
37
|
-
let pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
38
|
-
let button = actionCol.actionColumnButton;
|
|
39
|
-
let context = {
|
|
40
|
-
actionColumn: actionCol,
|
|
41
|
-
primaryKeyValue: pkValue,
|
|
42
|
-
rowNode: params.node,
|
|
43
|
-
adaptableApi: adaptable.api,
|
|
44
|
-
};
|
|
45
28
|
// if its a group node then only show if set to do so
|
|
46
29
|
if (adaptable.api.gridApi.isGroupRowNode(params.node) && !actionCol.includeGroupedRows) {
|
|
47
30
|
this.eGui.innerHTML = '';
|
|
48
31
|
return;
|
|
49
32
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
33
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
34
|
+
const buttonContext = {
|
|
35
|
+
actionColumn: actionCol,
|
|
36
|
+
primaryKeyValue: pkValue,
|
|
37
|
+
rowNode: params.node,
|
|
38
|
+
adaptableApi: adaptable.api,
|
|
39
|
+
};
|
|
40
|
+
const renderActionButtons = (buttons, adaptableApi, context) => {
|
|
41
|
+
return (React.createElement(React.Fragment, null, buttons.map((button) => {
|
|
42
|
+
var _a, _b;
|
|
43
|
+
if (button.hidden && button.hidden(button, context)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const defaultIconProps = {
|
|
47
|
+
style: {
|
|
48
|
+
height: 15,
|
|
49
|
+
width: 15,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
|
|
53
|
+
const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
54
|
+
const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
55
|
+
const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
56
|
+
const handleClick = () => {
|
|
57
|
+
button.onClick(button, context);
|
|
58
|
+
// Timeout to let any updates to be done before re-rendering the component
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
// when called again it triggers a re-render
|
|
61
|
+
// https:reactjs.org/docs/react-dom.html#render
|
|
62
|
+
doRender();
|
|
63
|
+
}, 16);
|
|
64
|
+
};
|
|
65
|
+
const disabled = button.disabled && button.disabled(button, context);
|
|
66
|
+
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' },
|
|
67
|
+
button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
68
|
+
buttonLabel));
|
|
69
|
+
})));
|
|
79
70
|
};
|
|
80
71
|
const eGui = this.eGui;
|
|
81
72
|
function doRender() {
|
|
82
|
-
react_dom_1.render(
|
|
73
|
+
react_dom_1.render(renderActionButtons(actionButtons, adaptable.api, buttonContext), eGui);
|
|
83
74
|
}
|
|
84
75
|
this.render = doRender;
|
|
85
76
|
doRender();
|
|
@@ -7,7 +7,7 @@ import { AdaptableApi } from '../Api/AdaptableApi';
|
|
|
7
7
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
8
8
|
import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
|
|
9
9
|
import { ColumnSort } from '../PredefinedConfig/Common/ColumnSort';
|
|
10
|
-
import {
|
|
10
|
+
import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
|
|
11
11
|
import { DataUpdateConfig } from '../PredefinedConfig/Common/DataUpdateConfig';
|
|
12
12
|
import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
|
|
13
13
|
import { ReportData } from '../PredefinedConfig/ExportState';
|
|
@@ -74,6 +74,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
74
74
|
private _id;
|
|
75
75
|
private currentColumnDefs?;
|
|
76
76
|
private rowListeners;
|
|
77
|
+
private isCheckedColumnDataType;
|
|
77
78
|
_on: (eventName: string, callback: EmitterCallback) => (() => void);
|
|
78
79
|
_onIncludeFired: (eventName: string, callback: EmitterCallback) => (() => void);
|
|
79
80
|
_emit: (eventName: string, data?: any) => Promise<any>;
|
|
@@ -149,7 +150,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
149
150
|
private updateLayoutFromGrid;
|
|
150
151
|
setSelectedCells(): SelectedCellInfo | undefined;
|
|
151
152
|
setSelectedRows(): SelectedRowInfo | undefined;
|
|
152
|
-
setValue(
|
|
153
|
+
setValue(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
153
154
|
cancelEdit(): void;
|
|
154
155
|
isCellEditable(rowNode: RowNode, column: Column): boolean;
|
|
155
156
|
getDistinctValuesForColumn(column: AdaptableColumn, visibleRowsOnly: boolean, skipRowNode?: RowNode, permittedValues?: any[]): GridCell[];
|