@adaptabletools/adaptable-cjs 22.0.8 → 22.0.9
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/src/AdaptableOptions/FilterOptions.d.ts +23 -6
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +4 -0
- package/src/Api/Implementation/ColumnFilterApiImpl.js +0 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/ColumnFilterModule.js +4 -2
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Utilities/Services/DataService.js +6 -0
- package/src/agGrid/AdaptableAgGrid.js +2 -5
- package/src/components/Tree/TreeList/index.d.ts +1 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.9",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -227,7 +227,6 @@ export interface InFilterValueResult {
|
|
|
227
227
|
* Information about items in the IN Column Filter
|
|
228
228
|
*/
|
|
229
229
|
export interface InFilterValueInfo extends InFilterValue {
|
|
230
|
-
id: string | number;
|
|
231
230
|
/**
|
|
232
231
|
* Whether Item is currently selected
|
|
233
232
|
*/
|
|
@@ -255,23 +254,41 @@ export interface InFilterValueInfo extends InFilterValue {
|
|
|
255
254
|
*/
|
|
256
255
|
export interface CustomInFilterValuesContext<TData = any> extends AdaptableColumnContext {
|
|
257
256
|
/**
|
|
258
|
-
*
|
|
257
|
+
* Distinct Column values in natural (unsorted) row iteration order.
|
|
258
|
+
*
|
|
259
|
+
* When the Column uses a Tree Filter, items have a hierarchical structure.
|
|
260
|
+
*
|
|
261
|
+
* Computed lazily on first access.
|
|
259
262
|
*/
|
|
260
263
|
defaultValues: Required<InFilterValueInfo>[];
|
|
261
264
|
/**
|
|
262
|
-
*
|
|
265
|
+
* Distinct Column values sorted by the Column's own sort direction (Asc / Desc).
|
|
266
|
+
*
|
|
267
|
+
* If the Column has no active sort, values are returned in the same order as `defaultValues`.
|
|
268
|
+
*
|
|
269
|
+
* When the Column uses a Tree Filter, items have a hierarchical structure.
|
|
270
|
+
*
|
|
271
|
+
* Computed lazily on first access.
|
|
263
272
|
*/
|
|
264
273
|
sortedValues: Required<InFilterValueInfo>[];
|
|
265
274
|
/**
|
|
266
|
-
*
|
|
275
|
+
* Distinct Column values in the order they appear in the grid from top to bottom.
|
|
276
|
+
*
|
|
277
|
+
* Always a flat list, even when the Column uses a Tree Filter.
|
|
278
|
+
*
|
|
279
|
+
* Computed lazily on first access.
|
|
267
280
|
*/
|
|
268
281
|
orderedValues: Required<InFilterValueInfo>[];
|
|
269
282
|
/**
|
|
270
|
-
*
|
|
283
|
+
* Current text in the IN Filter search box.
|
|
284
|
+
*
|
|
285
|
+
* Useful when implementing server-side filtering of the value list.
|
|
271
286
|
*/
|
|
272
287
|
currentSearchValue: string;
|
|
273
288
|
/**
|
|
274
|
-
*
|
|
289
|
+
* The result returned by the previous invocation of `FilterOptions.customInFilterValues`, if any.
|
|
290
|
+
*
|
|
291
|
+
* Useful for avoiding expensive recomputations (e.g. when filtering is async or server-side).
|
|
275
292
|
*/
|
|
276
293
|
previousFilterResult?: InFilterValueResult;
|
|
277
294
|
}
|
|
@@ -36,4 +36,8 @@ export interface CellDataChangedInfo<TData = any> {
|
|
|
36
36
|
* What triggered the change - user, background change or a reverted change?
|
|
37
37
|
*/
|
|
38
38
|
trigger?: 'edit' | 'tick' | 'undo' | 'aggChange';
|
|
39
|
+
/**
|
|
40
|
+
* Whether the change was prevented by a validation rule
|
|
41
|
+
*/
|
|
42
|
+
preventEdit?: boolean;
|
|
39
43
|
}
|
|
@@ -36,7 +36,7 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
36
36
|
this.api.internalApi
|
|
37
37
|
.getDataService()
|
|
38
38
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
39
|
-
if (cellDataChangedInfo.trigger !== 'aggChange') {
|
|
39
|
+
if (cellDataChangedInfo.trigger !== 'aggChange' && !cellDataChangedInfo.preventEdit) {
|
|
40
40
|
this.api.internalApi
|
|
41
41
|
.getCalculatedColumnExpressionService()
|
|
42
42
|
.listentoCellDataChange(cellDataChangedInfo);
|
|
@@ -28,8 +28,10 @@ class ColumnFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
28
28
|
this.api.internalApi
|
|
29
29
|
.getDataService()
|
|
30
30
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
if (!cellDataChangedInfo.preventEdit) {
|
|
32
|
+
const changedColumnId = cellDataChangedInfo.column.columnId;
|
|
33
|
+
this.api.filterApi.columnFilterApi.resetFilterValues(changedColumnId);
|
|
34
|
+
}
|
|
33
35
|
});
|
|
34
36
|
// we reset the filter cache on sort change, because we might have columns
|
|
35
37
|
// with "In" filters, with custom values, which use `context.orderedValues`
|
|
@@ -33,7 +33,9 @@ class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase
|
|
|
33
33
|
this.api.internalApi
|
|
34
34
|
.getDataService()
|
|
35
35
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
36
|
-
if (this.isListeningToCellDataChanges &&
|
|
36
|
+
if (this.isListeningToCellDataChanges &&
|
|
37
|
+
this.isDataChangeLoggable(cellDataChangedInfo) &&
|
|
38
|
+
!cellDataChangedInfo.preventEdit) {
|
|
37
39
|
this.api.dataChangeHistoryApi.addDataChangeHistoryEntry(cellDataChangedInfo);
|
|
38
40
|
}
|
|
39
41
|
});
|
|
@@ -39,7 +39,7 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
39
39
|
this.api.internalApi
|
|
40
40
|
.getDataService()
|
|
41
41
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
42
|
-
if (cellDataChangedInfo.trigger === 'undo') {
|
|
42
|
+
if (cellDataChangedInfo.trigger === 'undo' || cellDataChangedInfo.preventEdit) {
|
|
43
43
|
// do NOT handle reverted changes
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -34,7 +34,7 @@ class FreeTextColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
34
34
|
this.api.internalApi
|
|
35
35
|
.getDataService()
|
|
36
36
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
37
|
-
if (cellDataChangedInfo.trigger !== 'aggChange') {
|
|
37
|
+
if (cellDataChangedInfo.trigger !== 'aggChange' && !cellDataChangedInfo.preventEdit) {
|
|
38
38
|
this.api.freeTextColumnApi.internalApi.handleFreeTextColumnDataChange(cellDataChangedInfo);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -45,6 +45,12 @@ class DataService {
|
|
|
45
45
|
emit = (eventName, data) => this.emitter.emit(eventName, data);
|
|
46
46
|
CreateCellDataChangedEvent(cellDataChangedInfo) {
|
|
47
47
|
if (cellDataChangedInfo.newValue != cellDataChangedInfo.oldValue) {
|
|
48
|
+
const validationRules = this.adaptable.api.internalApi
|
|
49
|
+
.getValidationService()
|
|
50
|
+
.getValidationRulesForDataChange(cellDataChangedInfo);
|
|
51
|
+
if (validationRules.length) {
|
|
52
|
+
cellDataChangedInfo.preventEdit = true;
|
|
53
|
+
}
|
|
48
54
|
this.emitter.emitSync('CellDataChanged', cellDataChangedInfo);
|
|
49
55
|
this.adaptable.api.eventApi.internalApi.fireCellChangedEvent(cellDataChangedInfo);
|
|
50
56
|
const dataChangeLogEntry = this.extractDataChangeLogEntry(cellDataChangedInfo);
|
|
@@ -1024,7 +1024,7 @@ class AdaptableAgGrid {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
return (params) => {
|
|
1026
1026
|
// might be a summary row
|
|
1027
|
-
if (params.data?.[RowSummary_1.ROW_SUMMARY_ROW_ID]) {
|
|
1027
|
+
if (params.data?.[RowSummary_1.ROW_SUMMARY_ROW_ID] != undefined) {
|
|
1028
1028
|
return params.data[RowSummary_1.ROW_SUMMARY_ROW_ID];
|
|
1029
1029
|
}
|
|
1030
1030
|
if (params.level > 0) {
|
|
@@ -1040,7 +1040,7 @@ class AdaptableAgGrid {
|
|
|
1040
1040
|
const id = [...parentKeys, Math.abs(hash)].join('/');
|
|
1041
1041
|
return id;
|
|
1042
1042
|
}
|
|
1043
|
-
if (params.data?.[primaryKey]) {
|
|
1043
|
+
if (params.data?.[primaryKey] != undefined) {
|
|
1044
1044
|
const primaryKeyValue = params.data[primaryKey];
|
|
1045
1045
|
return typeof primaryKeyValue === 'number'
|
|
1046
1046
|
? `${primaryKeyValue}`
|
|
@@ -2713,11 +2713,9 @@ class AdaptableAgGrid {
|
|
|
2713
2713
|
};
|
|
2714
2714
|
// No distinct values so lets return unique grid cells
|
|
2715
2715
|
const mapFn = (gridCell, level) => {
|
|
2716
|
-
const itemId = `${gridCell.rowNode?.id}-${gridCell.column?.columnId}`;
|
|
2717
2716
|
if (level || Array.isArray(gridCell.children)) {
|
|
2718
2717
|
const cell = gridCell;
|
|
2719
2718
|
const inFilterValue = {
|
|
2720
|
-
id: itemId,
|
|
2721
2719
|
value: gridCell.rawValue,
|
|
2722
2720
|
label: gridCell.displayValue,
|
|
2723
2721
|
level: level ?? 0,
|
|
@@ -2738,7 +2736,6 @@ class AdaptableAgGrid {
|
|
|
2738
2736
|
return inFilterValue;
|
|
2739
2737
|
}
|
|
2740
2738
|
return {
|
|
2741
|
-
id: itemId,
|
|
2742
2739
|
value: gridCell.rawValue,
|
|
2743
2740
|
label: gridCell.displayValue,
|
|
2744
2741
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DataSourcePropOnTreeSelectionChange_MultiNode, InfiniteTableProps, TreeDataSourceProps } from '../../InfiniteTable';
|
|
3
3
|
export type TreeListItem<T = any> = {
|
|
4
|
-
id
|
|
4
|
+
id?: string | number;
|
|
5
5
|
label: string;
|
|
6
6
|
children?: TreeListItem<T>[];
|
|
7
7
|
};
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "22.0.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1775641581659 || Date.now(),
|
|
6
|
+
VERSION: "22.0.9" || '--current-version--',
|
|
7
7
|
};
|