@adaptabletools/adaptable-cjs 20.0.8 → 20.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/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 +2 -2
- package/src/layout-manager/src/simplifyLayoutModel.js +3 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.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
|
@@ -58,7 +58,7 @@ exports.AdaptableColumnType = {
|
|
|
58
58
|
*/
|
|
59
59
|
Fdc3Column: AdaptableColumn_1.FDC3_COLUMN_TYPE,
|
|
60
60
|
/**
|
|
61
|
-
* Any column that is used to display Pivot Totals: PivotGrandTotal,
|
|
61
|
+
* Any column that is used to display Pivot Totals: PivotGrandTotal, PivotGroupTotal or PivotAggregationTotal
|
|
62
62
|
*/
|
|
63
63
|
PivotTotal: AdaptableColumn_1.PIVOT_TOTAL_COLUMN_TYPE,
|
|
64
64
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.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",
|
|
@@ -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
|
}
|
|
@@ -10,7 +10,7 @@ const getFilterPreview = (columnFilter, api) => {
|
|
|
10
10
|
const columnType = api.columnApi.getColumnDataTypeForColumnId(columnFilter.ColumnId);
|
|
11
11
|
const qlDataType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
|
|
12
12
|
const qlPredicateDefs = predicateDefs.map((pd) => (0, utils_1.mapAdaptablePredicateDefToQlPredicateDef)(pd, qlDataType));
|
|
13
|
-
const qlPredicate = (0, utils_1.mapColumnFilterToQlPredicate)(columnFilter, column, qlPredicateDefs, columnFilterOptions);
|
|
13
|
+
const qlPredicate = (0, utils_1.mapColumnFilterToQlPredicate)(columnFilter, column, qlPredicateDefs, columnFilterOptions, api);
|
|
14
14
|
return `[${(0, utils_1.qlPredicateToString)(qlPredicate, qlPredicateDefs)}]`;
|
|
15
15
|
};
|
|
16
16
|
exports.getFilterPreview = getFilterPreview;
|
|
@@ -14,7 +14,7 @@ const LayoutColumnFilter = (props) => {
|
|
|
14
14
|
const predicateDefs = api.filterApi.columnFilterApi.getFilterPredicateDefsForColumn(column);
|
|
15
15
|
const qlDataType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(column.dataType);
|
|
16
16
|
const qlPredicateDefs = predicateDefs.map((predDef) => (0, utils_1.mapAdaptablePredicateDefToQlPredicateDef)(predDef, qlDataType));
|
|
17
|
-
const qlPredicate = (0, utils_1.mapColumnFilterToQlPredicate)(props.columnFilter, column, qlPredicateDefs, columnFilterOptions);
|
|
17
|
+
const qlPredicate = (0, utils_1.mapColumnFilterToQlPredicate)(props.columnFilter, column, qlPredicateDefs, columnFilterOptions, api);
|
|
18
18
|
const handlePredicateChange = (newPredicate) => {
|
|
19
19
|
const newAdaptablePredicates = newPredicate.args.map(utils_1.mapQlPredicateToAdaptablePredicate);
|
|
20
20
|
const newFilter = {
|
|
@@ -13,11 +13,12 @@ const utils_1 = require("./utils");
|
|
|
13
13
|
const useAdaptableFilterWrapper = (columnId, handleOnChangeOverride) => {
|
|
14
14
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
15
15
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
16
|
+
const api = adaptable.api;
|
|
17
|
+
const columnType = api.columnApi.getColumnDataTypeForColumnId(columnId);
|
|
18
|
+
const column = api.columnApi.getColumnWithColumnId(columnId);
|
|
19
|
+
const columnFilterOptions = api.optionsApi.getFilterOptions().columnFilterOptions;
|
|
19
20
|
const qlPredicateDefs = React.useMemo(() => {
|
|
20
|
-
const predicateDefs =
|
|
21
|
+
const predicateDefs = api.filterApi.columnFilterApi.getFilterPredicateDefsForColumn(column);
|
|
21
22
|
const qlDataType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
|
|
22
23
|
return predicateDefs.map((predDef) => (0, utils_1.mapAdaptablePredicateDefToQlPredicateDef)(predDef, qlDataType));
|
|
23
24
|
}, [columnId]);
|
|
@@ -26,7 +27,7 @@ const useAdaptableFilterWrapper = (columnId, handleOnChangeOverride) => {
|
|
|
26
27
|
return currentLayout?.ColumnFilters?.find((cf) => cf.ColumnId === columnId);
|
|
27
28
|
}, [currentLayout?.ColumnFilters, columnId]);
|
|
28
29
|
const qlPredicate = column
|
|
29
|
-
? (0, utils_1.mapColumnFilterToQlPredicate)(columnFilter, column, qlPredicateDefs, columnFilterOptions)
|
|
30
|
+
? (0, utils_1.mapColumnFilterToQlPredicate)(columnFilter, column, qlPredicateDefs, columnFilterOptions, api)
|
|
30
31
|
: null;
|
|
31
32
|
const handleOnChange = (adaptablePredicate, logic = 'AND') => {
|
|
32
33
|
// 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;
|
|
@@ -86,7 +86,7 @@ const isPredicateEmpty = (predicate, predicateDef) => {
|
|
|
86
86
|
predicate.args.every((arg) => arg == undefined));
|
|
87
87
|
};
|
|
88
88
|
exports.isPredicateEmpty = isPredicateEmpty;
|
|
89
|
-
const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, columnFilterOptions) => {
|
|
89
|
+
const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, columnFilterOptions, api) => {
|
|
90
90
|
const combinator = columnFilter?.PredicatesOperator ?? 'AND';
|
|
91
91
|
const qlPredicate = {
|
|
92
92
|
operator: combinator,
|
|
@@ -97,18 +97,60 @@ const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, c
|
|
|
97
97
|
let defaultQlPredicate = null;
|
|
98
98
|
switch (abColumn.dataType) {
|
|
99
99
|
case 'number':
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
let defaultQlNumberPredicate;
|
|
101
|
+
const defaultNumericColumnFilter = columnFilterOptions.defaultNumericColumnFilter;
|
|
102
|
+
if (defaultNumericColumnFilter) {
|
|
103
|
+
if (typeof defaultNumericColumnFilter === 'function') {
|
|
104
|
+
const context = {
|
|
105
|
+
column: abColumn,
|
|
106
|
+
...api.internalApi.buildBaseContext(),
|
|
107
|
+
};
|
|
108
|
+
defaultQlNumberPredicate = defaultNumericColumnFilter(context);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
defaultQlNumberPredicate = defaultNumericColumnFilter;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
defaultQlPredicate = defaultQlNumberPredicate
|
|
115
|
+
? { operator: defaultQlNumberPredicate, args: [] }
|
|
102
116
|
: { operator: 'Equals', args: [] };
|
|
103
117
|
break;
|
|
104
118
|
case 'text':
|
|
105
|
-
|
|
106
|
-
|
|
119
|
+
let defaultQlTextPredicate;
|
|
120
|
+
const defaultTextColumnFilter = columnFilterOptions.defaultTextColumnFilter;
|
|
121
|
+
if (defaultTextColumnFilter) {
|
|
122
|
+
if (typeof defaultTextColumnFilter === 'function') {
|
|
123
|
+
const context = {
|
|
124
|
+
column: abColumn,
|
|
125
|
+
...api.internalApi.buildBaseContext(),
|
|
126
|
+
};
|
|
127
|
+
defaultQlTextPredicate = defaultTextColumnFilter(context);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
defaultQlTextPredicate = defaultTextColumnFilter;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
defaultQlPredicate = defaultQlTextPredicate
|
|
134
|
+
? { operator: defaultQlTextPredicate, args: [] }
|
|
107
135
|
: { operator: 'Contains', args: [] };
|
|
108
136
|
break;
|
|
109
137
|
case 'date':
|
|
110
|
-
|
|
111
|
-
|
|
138
|
+
let defaultQlDatePredicate;
|
|
139
|
+
const defaultDateColumnFilter = columnFilterOptions.defaultDateColumnFilter;
|
|
140
|
+
if (defaultDateColumnFilter) {
|
|
141
|
+
if (typeof defaultDateColumnFilter === 'function') {
|
|
142
|
+
const context = {
|
|
143
|
+
column: abColumn,
|
|
144
|
+
...api.internalApi.buildBaseContext(),
|
|
145
|
+
};
|
|
146
|
+
defaultQlDatePredicate = defaultDateColumnFilter(context);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
defaultQlDatePredicate = defaultDateColumnFilter;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
defaultQlPredicate = defaultQlDatePredicate
|
|
153
|
+
? { operator: defaultQlDatePredicate, args: [] }
|
|
112
154
|
: { operator: 'On', args: [] };
|
|
113
155
|
break;
|
|
114
156
|
case 'boolean':
|
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: "20.0.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1746012364827 || Date.now(),
|
|
6
|
+
VERSION: "20.0.9" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -445,7 +445,6 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
const grandTotalRow = this.gridApi.getGridOption('grandTotalRow');
|
|
449
448
|
const layout = (0, simplifyLayoutModel_1.simplifyTableLayoutModel)({
|
|
450
449
|
TableColumns: TableColumns,
|
|
451
450
|
ColumnVisibility,
|
|
@@ -455,7 +454,8 @@ class LayoutManager extends LMEmitter_1.LMEmitter {
|
|
|
455
454
|
TableAggregationColumns,
|
|
456
455
|
ColumnPinning: ColumnPinning,
|
|
457
456
|
RowGroupValues,
|
|
458
|
-
GrandTotalRow: grandTotalRow,
|
|
457
|
+
GrandTotalRow: this.gridApi.getGridOption('grandTotalRow'),
|
|
458
|
+
SuppressAggFuncInHeader: this.gridApi.getGridOption('suppressAggFuncInHeader'),
|
|
459
459
|
});
|
|
460
460
|
return layout;
|
|
461
461
|
}
|
|
@@ -59,6 +59,9 @@ function simplifyTableLayoutModel(layout) {
|
|
|
59
59
|
if (!layout.GrandTotalRow) {
|
|
60
60
|
delete layout.GrandTotalRow;
|
|
61
61
|
}
|
|
62
|
+
if (!layout.SuppressAggFuncInHeader) {
|
|
63
|
+
delete layout.SuppressAggFuncInHeader;
|
|
64
|
+
}
|
|
62
65
|
return layout;
|
|
63
66
|
}
|
|
64
67
|
exports.simplifyTableLayoutModel = simplifyTableLayoutModel;
|