@adaptabletools/adaptable 20.0.8 → 20.0.10
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/agGrid.d.ts +1 -1
- package/agGrid.js +1 -1
- package/package.json +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +3 -4
- package/src/AdaptableState/LayoutState.d.ts +1 -1
- package/src/Strategy/Utilities/Layout/getLayoutFilterViewItems.js +1 -1
- package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +6 -5
- package/src/View/Components/ColumnFilter/utils.d.ts +2 -2
- package/src/View/Components/ColumnFilter/utils.js +49 -7
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +7 -6
- package/src/layout-manager/src/normalizeLayoutModel.js +0 -8
- package/src/layout-manager/src/simplifyLayoutModel.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
package/agGrid.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const AdaptableColumnType: {
|
|
|
40
40
|
*/
|
|
41
41
|
Fdc3Column: import("./src/AdaptableState/Common/AdaptableColumn").AdaptableColumnType;
|
|
42
42
|
/**
|
|
43
|
-
* Any column that is used to display Pivot Totals: PivotGrandTotal,
|
|
43
|
+
* Any column that is used to display Pivot Totals: PivotGrandTotal, PivotGroupTotal or PivotAggregationTotal
|
|
44
44
|
*/
|
|
45
45
|
PivotTotal: import("./src/AdaptableState/Common/AdaptableColumn").AdaptableColumnType;
|
|
46
46
|
/**
|
package/agGrid.js
CHANGED
|
@@ -46,7 +46,7 @@ export const AdaptableColumnType = {
|
|
|
46
46
|
*/
|
|
47
47
|
Fdc3Column: FDC3_COLUMN_TYPE,
|
|
48
48
|
/**
|
|
49
|
-
* Any column that is used to display Pivot Totals: PivotGrandTotal,
|
|
49
|
+
* Any column that is used to display Pivot Totals: PivotGrandTotal, PivotGroupTotal or PivotAggregationTotal
|
|
50
50
|
*/
|
|
51
51
|
PivotTotal: PIVOT_TOTAL_COLUMN_TYPE,
|
|
52
52
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.10",
|
|
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",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FilterActionOnDataChange } from '../AdaptableState/Common/FilterActionOnDataChange';
|
|
2
2
|
import { BaseContext } from '../../types';
|
|
3
|
-
import { AdaptableColumn } from '../AdaptableState/Common/AdaptableColumn';
|
|
4
3
|
import { SystemAlertPredicateId, SystemFilterPredicateId } from '../../types';
|
|
5
4
|
import { StrictExtract } from '../Utilities/Extensions/TypeExtensions';
|
|
6
5
|
import { AdaptableColumnContext } from '../AdaptableState/Common/AdaptableColumnContext';
|
|
@@ -92,21 +91,21 @@ export interface ColumnFilterOptions<TData = any> {
|
|
|
92
91
|
* @defaultValue Equals
|
|
93
92
|
* @gridInfoItem
|
|
94
93
|
*/
|
|
95
|
-
defaultNumericColumnFilter?: StrictExtract<SystemFilterPredicateId, 'GreaterThan' | 'LessThan' | 'Equals' | 'NotEquals' | 'In'> | ((
|
|
94
|
+
defaultNumericColumnFilter?: StrictExtract<SystemFilterPredicateId, 'GreaterThan' | 'LessThan' | 'Equals' | 'NotEquals' | 'In'> | ((adaptableColumnContext: AdaptableColumnContext<TData>) => StrictExtract<SystemFilterPredicateId, 'GreaterThan' | 'LessThan' | 'Equals' | 'NotEquals' | 'In'>);
|
|
96
95
|
/**
|
|
97
96
|
* Default filter type for text Columns
|
|
98
97
|
*
|
|
99
98
|
* @defaultValue Contains
|
|
100
99
|
* @gridInfoItem
|
|
101
100
|
*/
|
|
102
|
-
defaultTextColumnFilter?: StrictExtract<SystemFilterPredicateId, 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'In'> | ((
|
|
101
|
+
defaultTextColumnFilter?: StrictExtract<SystemFilterPredicateId, 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'In'> | ((adaptableColumnContext: AdaptableColumnContext<TData>) => StrictExtract<SystemFilterPredicateId, 'Is' | 'IsNot' | 'Contains' | 'NotContains' | 'StartsWith' | 'EndsWith' | 'Regex' | 'In'>);
|
|
103
102
|
/**
|
|
104
103
|
* Default filter type for date Columns
|
|
105
104
|
*
|
|
106
105
|
* @defaultValue On
|
|
107
106
|
* @gridInfoItem
|
|
108
107
|
*/
|
|
109
|
-
defaultDateColumnFilter?: StrictExtract<SystemFilterPredicateId, 'After' | 'Before' | 'On' | 'NotOn' | 'In'> | ((
|
|
108
|
+
defaultDateColumnFilter?: StrictExtract<SystemFilterPredicateId, 'After' | 'Before' | 'On' | 'NotOn' | 'In'> | ((adaptableColumnContext: AdaptableColumnContext<TData>) => StrictExtract<SystemFilterPredicateId, 'After' | 'Before' | 'On' | 'NotOn' | 'In'>);
|
|
110
109
|
/**
|
|
111
110
|
* Hides Dropdown in Quick Filter Bar for a given Column
|
|
112
111
|
*
|
|
@@ -75,7 +75,7 @@ export interface LayoutBase extends AdaptableObject {
|
|
|
75
75
|
*/
|
|
76
76
|
AutoSizeColumns?: boolean;
|
|
77
77
|
/**
|
|
78
|
-
* Display Grand Total Row at the top or bottom of the
|
|
78
|
+
* Display Grand Total Row at the top or bottom of the Layout
|
|
79
79
|
*/
|
|
80
80
|
GrandTotalRow?: 'top' | 'bottom' | boolean;
|
|
81
81
|
}
|
|
@@ -7,7 +7,7 @@ export const getFilterPreview = (columnFilter, api) => {
|
|
|
7
7
|
const columnType = api.columnApi.getColumnDataTypeForColumnId(columnFilter.ColumnId);
|
|
8
8
|
const qlDataType = mapColumnDataTypeToExpressionFunctionType(columnType);
|
|
9
9
|
const qlPredicateDefs = predicateDefs.map((pd) => mapAdaptablePredicateDefToQlPredicateDef(pd, qlDataType));
|
|
10
|
-
const qlPredicate = mapColumnFilterToQlPredicate(columnFilter, column, qlPredicateDefs, columnFilterOptions);
|
|
10
|
+
const qlPredicate = mapColumnFilterToQlPredicate(columnFilter, column, qlPredicateDefs, columnFilterOptions, api);
|
|
11
11
|
return `[${qlPredicateToString(qlPredicate, qlPredicateDefs)}]`;
|
|
12
12
|
};
|
|
13
13
|
export const getLayoutFilterViewItems = (layout, api) => {
|
|
@@ -10,7 +10,7 @@ export const LayoutColumnFilter = (props) => {
|
|
|
10
10
|
const predicateDefs = api.filterApi.columnFilterApi.getFilterPredicateDefsForColumn(column);
|
|
11
11
|
const qlDataType = mapColumnDataTypeToExpressionFunctionType(column.dataType);
|
|
12
12
|
const qlPredicateDefs = predicateDefs.map((predDef) => mapAdaptablePredicateDefToQlPredicateDef(predDef, qlDataType));
|
|
13
|
-
const qlPredicate = mapColumnFilterToQlPredicate(props.columnFilter, column, qlPredicateDefs, columnFilterOptions);
|
|
13
|
+
const qlPredicate = mapColumnFilterToQlPredicate(props.columnFilter, column, qlPredicateDefs, columnFilterOptions, api);
|
|
14
14
|
const handlePredicateChange = (newPredicate) => {
|
|
15
15
|
const newAdaptablePredicates = newPredicate.args.map(mapQlPredicateToAdaptablePredicate);
|
|
16
16
|
const newFilter = {
|
|
@@ -9,11 +9,12 @@ import { mapAdaptablePredicateDefToQlPredicateDef, mapColumnFilterToQlPredicate,
|
|
|
9
9
|
export const useAdaptableFilterWrapper = (columnId, handleOnChangeOverride) => {
|
|
10
10
|
const adaptable = useAdaptable();
|
|
11
11
|
const dispatch = useDispatch();
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
12
|
+
const api = adaptable.api;
|
|
13
|
+
const columnType = api.columnApi.getColumnDataTypeForColumnId(columnId);
|
|
14
|
+
const column = api.columnApi.getColumnWithColumnId(columnId);
|
|
15
|
+
const columnFilterOptions = api.optionsApi.getFilterOptions().columnFilterOptions;
|
|
15
16
|
const qlPredicateDefs = React.useMemo(() => {
|
|
16
|
-
const predicateDefs =
|
|
17
|
+
const predicateDefs = api.filterApi.columnFilterApi.getFilterPredicateDefsForColumn(column);
|
|
17
18
|
const qlDataType = mapColumnDataTypeToExpressionFunctionType(columnType);
|
|
18
19
|
return predicateDefs.map((predDef) => mapAdaptablePredicateDefToQlPredicateDef(predDef, qlDataType));
|
|
19
20
|
}, [columnId]);
|
|
@@ -22,7 +23,7 @@ export const useAdaptableFilterWrapper = (columnId, handleOnChangeOverride) => {
|
|
|
22
23
|
return currentLayout?.ColumnFilters?.find((cf) => cf.ColumnId === columnId);
|
|
23
24
|
}, [currentLayout?.ColumnFilters, columnId]);
|
|
24
25
|
const qlPredicate = column
|
|
25
|
-
? mapColumnFilterToQlPredicate(columnFilter, column, qlPredicateDefs, columnFilterOptions)
|
|
26
|
+
? mapColumnFilterToQlPredicate(columnFilter, column, qlPredicateDefs, columnFilterOptions, api)
|
|
26
27
|
: null;
|
|
27
28
|
const handleOnChange = (adaptablePredicate, logic = 'AND') => {
|
|
28
29
|
// make sure we always have the latest columnFiler
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { QlPredicate, QlPredicateDef } from '../../../parser/src/predicate';
|
|
2
|
-
import { AdaptableColumn, AdaptablePredicate, AdaptablePredicateDef, ColumnFilter, ColumnFilterOptions, ExpressionFunctionInputType } from '../../../types';
|
|
2
|
+
import { AdaptableApi, AdaptableColumn, AdaptablePredicate, AdaptablePredicateDef, ColumnFilter, ColumnFilterOptions, ExpressionFunctionInputType } from '../../../types';
|
|
3
3
|
export declare const mapAdaptablePredicateDefToQlPredicateDef: (adaptablePredicateDef: AdaptablePredicateDef, dataType: ExpressionFunctionInputType) => QlPredicateDef;
|
|
4
4
|
export declare const mapAdaptablePredicateToQlPredicate: (adaptablePredicate: AdaptablePredicate) => QlPredicate;
|
|
5
5
|
export declare const mapQlPredicateToAdaptablePredicate: (qlPredicate: QlPredicate) => AdaptablePredicate;
|
|
6
6
|
export declare const qlPredicateToString: (qlPredicate: QlPredicate, predicateDefs: QlPredicateDef[]) => string;
|
|
7
7
|
export declare const isPredicateEmpty: (predicate: QlPredicate, predicateDef: QlPredicateDef) => boolean;
|
|
8
|
-
export declare const mapColumnFilterToQlPredicate: (columnFilter: ColumnFilter, abColumn: AdaptableColumn, qlPredicateDefs: QlPredicateDef[], columnFilterOptions: ColumnFilterOptions) => QlPredicate;
|
|
8
|
+
export declare const mapColumnFilterToQlPredicate: (columnFilter: ColumnFilter, abColumn: AdaptableColumn, qlPredicateDefs: QlPredicateDef[], columnFilterOptions: ColumnFilterOptions, api: AdaptableApi) => QlPredicate;
|
|
@@ -77,7 +77,7 @@ export const isPredicateEmpty = (predicate, predicateDef) => {
|
|
|
77
77
|
predicate.args.length === 0 ||
|
|
78
78
|
predicate.args.every((arg) => arg == undefined));
|
|
79
79
|
};
|
|
80
|
-
export const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, columnFilterOptions) => {
|
|
80
|
+
export const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, columnFilterOptions, api) => {
|
|
81
81
|
const combinator = columnFilter?.PredicatesOperator ?? 'AND';
|
|
82
82
|
const qlPredicate = {
|
|
83
83
|
operator: combinator,
|
|
@@ -88,18 +88,60 @@ export const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicate
|
|
|
88
88
|
let defaultQlPredicate = null;
|
|
89
89
|
switch (abColumn.dataType) {
|
|
90
90
|
case 'number':
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
let defaultQlNumberPredicate;
|
|
92
|
+
const defaultNumericColumnFilter = columnFilterOptions.defaultNumericColumnFilter;
|
|
93
|
+
if (defaultNumericColumnFilter) {
|
|
94
|
+
if (typeof defaultNumericColumnFilter === 'function') {
|
|
95
|
+
const context = {
|
|
96
|
+
column: abColumn,
|
|
97
|
+
...api.internalApi.buildBaseContext(),
|
|
98
|
+
};
|
|
99
|
+
defaultQlNumberPredicate = defaultNumericColumnFilter(context);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
defaultQlNumberPredicate = defaultNumericColumnFilter;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
defaultQlPredicate = defaultQlNumberPredicate
|
|
106
|
+
? { operator: defaultQlNumberPredicate, args: [] }
|
|
93
107
|
: { operator: 'Equals', args: [] };
|
|
94
108
|
break;
|
|
95
109
|
case 'text':
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
let defaultQlTextPredicate;
|
|
111
|
+
const defaultTextColumnFilter = columnFilterOptions.defaultTextColumnFilter;
|
|
112
|
+
if (defaultTextColumnFilter) {
|
|
113
|
+
if (typeof defaultTextColumnFilter === 'function') {
|
|
114
|
+
const context = {
|
|
115
|
+
column: abColumn,
|
|
116
|
+
...api.internalApi.buildBaseContext(),
|
|
117
|
+
};
|
|
118
|
+
defaultQlTextPredicate = defaultTextColumnFilter(context);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
defaultQlTextPredicate = defaultTextColumnFilter;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
defaultQlPredicate = defaultQlTextPredicate
|
|
125
|
+
? { operator: defaultQlTextPredicate, args: [] }
|
|
98
126
|
: { operator: 'Contains', args: [] };
|
|
99
127
|
break;
|
|
100
128
|
case 'date':
|
|
101
|
-
|
|
102
|
-
|
|
129
|
+
let defaultQlDatePredicate;
|
|
130
|
+
const defaultDateColumnFilter = columnFilterOptions.defaultDateColumnFilter;
|
|
131
|
+
if (defaultDateColumnFilter) {
|
|
132
|
+
if (typeof defaultDateColumnFilter === 'function') {
|
|
133
|
+
const context = {
|
|
134
|
+
column: abColumn,
|
|
135
|
+
...api.internalApi.buildBaseContext(),
|
|
136
|
+
};
|
|
137
|
+
defaultQlDatePredicate = defaultDateColumnFilter(context);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
defaultQlDatePredicate = defaultDateColumnFilter;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
defaultQlPredicate = defaultQlDatePredicate
|
|
144
|
+
? { operator: defaultQlDatePredicate, args: [] }
|
|
103
145
|
: { operator: 'On', args: [] };
|
|
104
146
|
break;
|
|
105
147
|
case 'boolean':
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
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" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "20.0.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1746018963775 || Date.now(),
|
|
4
|
+
VERSION: "20.0.10" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -261,6 +261,9 @@ export class LayoutManager extends LMEmitter {
|
|
|
261
261
|
GrandTotalRow: layout.GrandTotalRow,
|
|
262
262
|
PivotExpandLevel: prevLayout?.PivotExpandLevel ?? -1,
|
|
263
263
|
};
|
|
264
|
+
if (layout.SuppressAggFuncInHeader) {
|
|
265
|
+
pivotLayout.SuppressAggFuncInHeader = layout.SuppressAggFuncInHeader;
|
|
266
|
+
}
|
|
264
267
|
const grandTotalColumn = this.gridApi.getGridOption('pivotRowTotals');
|
|
265
268
|
if (grandTotalColumn) {
|
|
266
269
|
pivotLayout.GrandTotalColumn = grandTotalColumn;
|
|
@@ -442,7 +445,6 @@ export class LayoutManager extends LMEmitter {
|
|
|
442
445
|
}
|
|
443
446
|
}
|
|
444
447
|
}
|
|
445
|
-
const grandTotalRow = this.gridApi.getGridOption('grandTotalRow');
|
|
446
448
|
const layout = simplifyTableLayoutModel({
|
|
447
449
|
TableColumns: TableColumns,
|
|
448
450
|
ColumnVisibility,
|
|
@@ -452,7 +454,8 @@ export class LayoutManager extends LMEmitter {
|
|
|
452
454
|
TableAggregationColumns,
|
|
453
455
|
ColumnPinning: ColumnPinning,
|
|
454
456
|
RowGroupValues,
|
|
455
|
-
GrandTotalRow: grandTotalRow,
|
|
457
|
+
GrandTotalRow: this.gridApi.getGridOption('grandTotalRow'),
|
|
458
|
+
SuppressAggFuncInHeader: this.gridApi.getGridOption('suppressAggFuncInHeader'),
|
|
456
459
|
});
|
|
457
460
|
return layout;
|
|
458
461
|
}
|
|
@@ -686,10 +689,8 @@ export class LayoutManager extends LMEmitter {
|
|
|
686
689
|
};
|
|
687
690
|
this.suppressGlobalAgGridEventListener = true;
|
|
688
691
|
const pivotMode = this.gridApi.isPivotMode();
|
|
689
|
-
if (layout.SuppressAggFuncInHeader !==
|
|
690
|
-
|
|
691
|
-
// @ts-ignore
|
|
692
|
-
this.gridApi.setGridOption('suppressAggFuncInHeader', layout.SuppressAggFuncInHeader);
|
|
692
|
+
if (!!layout.SuppressAggFuncInHeader !== !!this.gridApi.getGridOption('suppressAggFuncInHeader')) {
|
|
693
|
+
this.gridApi.setGridOption('suppressAggFuncInHeader', !!layout.SuppressAggFuncInHeader);
|
|
693
694
|
}
|
|
694
695
|
if (layout.GrandTotalRow) {
|
|
695
696
|
const grandTotalRow = layout.GrandTotalRow === true || layout.GrandTotalRow === 'top'
|
|
@@ -25,10 +25,6 @@ export function normalizeTableLayoutModel(layout, options) {
|
|
|
25
25
|
if (!layout.RowGroupedColumns) {
|
|
26
26
|
layout.RowGroupedColumns = [];
|
|
27
27
|
}
|
|
28
|
-
if (!Object.prototype.hasOwnProperty.call(layout, 'SuppressAggFuncInHeader')) {
|
|
29
|
-
// make it an own property
|
|
30
|
-
layout.SuppressAggFuncInHeader = undefined;
|
|
31
|
-
}
|
|
32
28
|
const ColumnOrderSet = new Set(layout.TableColumns);
|
|
33
29
|
if (layout.RowGroupedColumns && layout.RowGroupedColumns.length && layout.TableColumns) {
|
|
34
30
|
// the layout.TableColumns might not include the group columns
|
|
@@ -135,10 +131,6 @@ export function normalizePivotLayoutModel(layout) {
|
|
|
135
131
|
RowGroupDisplay: 'always-collapsed',
|
|
136
132
|
};
|
|
137
133
|
}
|
|
138
|
-
if (!Object.prototype.hasOwnProperty.call(layout, 'SuppressAggFuncInHeader')) {
|
|
139
|
-
// make it an own property
|
|
140
|
-
layout.SuppressAggFuncInHeader = undefined;
|
|
141
|
-
}
|
|
142
134
|
return layout;
|
|
143
135
|
}
|
|
144
136
|
export function normalizeLayoutModel(layout, options) {
|
|
@@ -17,7 +17,7 @@ export function simplifyTableLayoutModel(layout) {
|
|
|
17
17
|
if (!layout.RowGroupedColumns && layout.RowGroupValues) {
|
|
18
18
|
// delete layout.RowGroupValues;
|
|
19
19
|
}
|
|
20
|
-
if (layout.SuppressAggFuncInHeader
|
|
20
|
+
if (!layout.SuppressAggFuncInHeader) {
|
|
21
21
|
delete layout.SuppressAggFuncInHeader;
|
|
22
22
|
}
|
|
23
23
|
// this is the default value
|
|
@@ -63,7 +63,7 @@ export function simplifyPivotLayoutModel(layout) {
|
|
|
63
63
|
if (layout.ColumnWidths && !Object.keys(layout.ColumnWidths).length) {
|
|
64
64
|
delete layout.ColumnWidths;
|
|
65
65
|
}
|
|
66
|
-
if (layout.SuppressAggFuncInHeader
|
|
66
|
+
if (!layout.SuppressAggFuncInHeader) {
|
|
67
67
|
delete layout.SuppressAggFuncInHeader;
|
|
68
68
|
}
|
|
69
69
|
if (layout.PivotAggregationColumns && !layout.PivotAggregationColumns.length) {
|